Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @wittjeff, all your commits are properly signed off. 🎉 |
Merge Protections🔴 1 of 2 protections blocking · waiting on 👀 reviews
🔴 Require two reviewer for test updatesWaiting for
This rule is failing.When test data is updated, we require two reviewers
Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. CI safety: not assessed. Possibly related pull requests
Reference data changes
Only the first 80 of 137 reference files were compared. The |
6eed59c to
0f9585b
Compare
|
Rebased onto main (1517ab7). #693 took schema 1.11.0 while this was in review, so the bump is now 1.11.0 → 1.12.0: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Block quotes become a first-class group: GroupLabel.BLOCK_QUOTE and a BlockQuoteGroup subtype with `cite` (the source URL) and `captions` (the attribution, a caption text item that is a child of the group and is referenced here, like the captions of a FloatingItem). - add_block_quote_group() / insert_block_quote_group(); add_group() and insert_group() route the new label; delete_items() and orphan repair keep the attribution references in sync. - BaseBlockQuoteSerializer slot on DocSerializer with a transparent default. HTML emits <blockquote cite> inside a <figure> with a <figcaption> attribution; Markdown emits '> ' lines with a linked attribution; LaTeX a quote environment; DocLang keeps the attribution inside the named group; DocTags stays transparent. - Chunkers treat a BlockQuoteGroup as one unit, like ListGroup. - Schema 1.13.0 with the downgrade projector to 1.12.0 (relabel to unspecified, strip cite and captions), schema snapshot and tests. Closes docling-project#861 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com>
… line A GFM table cell holds a single line, and the table serializer replaces every newline in a cell with a space. A multi-paragraph quote rendered with a marker on every line therefore came out as "> first > > second", which reads as a nested quote. Inside a table cell the quote now has one marker in front of its joined blocks, with the attribution last. Reported on docling-project/docling#4855 from a judgment whose quotes all sit in layout table cells. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com>
Codecov flagged eight lines of the block quote change without a test. Covering them found one defect: a quote with an attribution and no quoted blocks emitted a bare <figcaption>, which is only valid inside a <figure> that also holds flow content. The HTML serializer now keeps an empty <blockquote> with the cite attribute inside the figure in that case. The isinstance guard in serialize_block_quote_attribution was dead: get_excluded_refs is abstract on BaseDocSerializer, so every serializer has it. New tests cover the group factories' name and content_layer arguments, orphan repair of a referenced attribution, the transparent DocLang export of a quote that crosses a page, the attribution-only quote in HTML and Markdown, and an empty quote. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com>
Follow-up invited in docling#4055, where the suggestion was to leave tooltip, field type, required and radio-group semantics on FormFieldInfo until docling-core had somewhere typed to put them. Adds four fields to FieldItem: - control: the kind of control, as a new FieldControl enum (text, checkbox, radio, choice, signature, button, other). This is the document-level reading rather than the raw PDF entry: an AcroForm /Btn resolves to CHECKBOX, RADIO or BUTTON by its flags, and the untouched /FT name stays on PdfWidget.widget_field_type. - description: a producer-supplied description of what to enter -- an AcroForm /TU tooltip, or an HTML title. Distinct from FieldHintItem, which is text drawn on the page. - required: whether a value must be supplied. - options: the values a CHOICE or RADIO control accepts, which is what makes a radio group legible at document level: one FieldItem whose value is the selection, plus the set it was selected from. Read-only is deliberately not among them. FieldValueItem.kind already carries read_only/fillable, and duplicating it on the parent would leave two places to disagree. The page-level half of this already landed in docling-project#733: PdfWidget carries widget_description, widget_field_type, widget_field_flags and widget_appearance_state, so producers have the raw state to derive these from and this commit only adds the document-level destination. Schema 1.13.0 -> 1.14.0 with the full docling-project#703 regime: history entry, a 1.14 -> 1.13 projector stripping the four keys, the 1.14 snapshot, and a TestProjector_1_14_to_1_13 class. FieldItem is a strict model, so an unannounced addition would have broken 1.13 clients outright. Schema 1.11.0 went to the inline whitespace contract (docling-project#693) and 1.12.0 to TrackItem (docling-project#940) while this was in review, and 1.13.0 is the BlockQuoteGroup bump of docling-project#878, which this branch is stacked on. The history entry records v2.110.0 as the placeholder release, to be adjusted at release time. Goldens regenerated with DOCLING_GEN_TEST_DATA=1: the churn is the version stamp plus the required/options keys on field items. Signed-off-by: Jeff Witt <1848307+wittjeff@users.noreply.github.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
0f9585b to
5c4ec26
Compare
Note
Stacked on #878. Schema 1.12.0 went to
TrackItem(#940), and #878 (BlockQuoteGroup) holds 1.13.0, so this PR now takes 1.14.0 and sits on top of the #878 branch. The first three commits belong to #878. Only the last commit,feat(form): give AcroForm field metadata typed slots on FieldItem, is this PR. It is a draft until #878 merges; after that it is rebased onmainand shows one commit again.Summary
Gives AcroForm field metadata a typed home at document level, which is the follow-up @cau-git invited in docling#4055:
The page-level half already landed in #733, so
PdfWidgetcarrieswidget_description,widget_field_type,widget_field_flagsandwidget_appearance_state. This adds the document-level destination those can be read into.What changed
Four fields on
FieldItem:control: FieldControl | None/FTplus flagstext,checkbox,radio,choice,signature,button,otherdescription: str | None/TUtooltiprequired: bool/FfRequired bitoptions: list[str]/Opt, or radio export valuesFieldControlis the document-level reading of the control rather than the raw PDF entry: an AcroForm/Btnresolves toCHECKBOX,RADIOorBUTTONby its flags, and the untouched/FTname stays available onPdfWidget.widget_field_type. The enum sits next to the models initems/form.py, following the precedent ofOrientationinitems/table/table_data.py.descriptionis deliberately distinct fromFieldHintItem: a hint is text drawn on the page, while this is metadata the producer attached to the field and that never appears in the rendering.optionsis what makes a radio group legible at document level — oneFieldItemwhose value is the selection, plus the set it was selected from. It covers/Chdropdowns in the same slot.add_field_item()takes all four as keyword arguments, andoptionsis copied on the way in so a caller's list cannot mutate the document.One deliberate omission
Read-only is not among them, though the invitation listed "required/read-only".
FieldValueItem.kindalready carriesread_only/fillable, and duplicating it on the parent would leave two places free to disagree. TheFieldItemdocstring records that the editability of a field lives on its value. Happy to add it if you would rather have it on both.Schema version
FieldItemis a strict model (additionalProperties: false), so this would break 1.13 clients outright. Bumped 1.13.0 → 1.14.0 with the full #703 regime:SCHEMA_VERSION_HISTORYentry (v2.110.0is a placeholder for the release that ships it, to adjust at release time as feat: make inline serializers concatenate runs faithfully #693 did)_project_1_14_to_1_13stripping the four keys, leaving the page-levelPdfWidgetstate it derives from untoucheddocs/schemas/DoclingDocument_1_14.jsonTestProjector_1_14_to_1_13While this PR was in review, schema 1.11.0 went to the inline whitespace contract (#693) and 1.12.0 to
TrackItem(#940), and #878 holds 1.13.0. The projector chain is now 1.14 → 1.13 → 1.12 → … with no change to the other projectors.The projector test class includes a case that builds a populated document through the public helper and validates the projected dict against the 1.13 snapshot with
jsonschema, because the generictest_every_projector_produces_valid_outputonly exercises a minimal dict and would pass even if this projector stripped nothing.Validation
Rebased on the #878 branch (1e01d32), which is on
mainat ede3b17.prek runon the files of this PR's commit is clean (Ruff, projector coverage, ty, docs). Full suite 1901 passed, 12 skipped, 53 xfailed; dclq 13 passed. The groundtruth churn is therequired/optionskeys plus the version stamp;controlanddescriptionstay off the wire when unset becauseexport_to_dictexcludesNone. No binary test data changes.The two tooling gaps found on the first round (snapshot capture order,
DOCLING_GEN_TEST_DATAin the unit goldens) were fixed separately in #842.🤖 Generated with Claude Code