Skip to content

feat: add DocLang backend - #3573

Merged
PeterStaar-IBM merged 5 commits into
mainfrom
feat/add-doclang-backend
Jun 9, 2026
Merged

PeterStaar-IBM merged 5 commits into
mainfrom
feat/add-doclang-backend

Conversation

@PeterStaar-IBM

@PeterStaar-IBM PeterStaar-IBM commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

This PR adds DocLang support to Docling.

It introduces a new XML backend for DocLang files, backed by the DocLang deserializer provided by docling-core.
Docling now detects .dclg and .dclg.xml inputs, exposes InputFormat.XML_DOCLANG, and supports conversion from
DocLang XML into DoclingDocument.

The PR also adds DocLang as an output format via OutputFormat.DOCLANG, including CLI support through:

docling input.pdf --to doclang

which writes .dclg.xml output using DoclingDocument.export_to_doclang().

## Changes

- Add DocLangDocumentBackend
- Register InputFormat.XML_DOCLANG
- Detect .dclg and .dclg.xml inputs
- Support DocumentConverter.convert_string(..., format=InputFormat.XML_DOCLANG)
- Add OutputFormat.DOCLANG
- Add CLI export support for --to doclang
- Update service response typing for DocLang artifacts/content
- Update README and docs supported-format listings
- Add tests for backend conversion, extension detection, convert_string, CLI export, and DoclingDocument -> DocLang
  -> DoclingDocument round-trips

@github-actions

github-actions Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @PeterStaar-IBM, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@PeterStaar-IBM
PeterStaar-IBM marked this pull request as ready for review June 9, 2026 14:13
Signed-off-by: Peter Staar <[email protected]>
@codecov

codecov Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling/backend/xml/doclang_backend.py 88.09% 5 Missing ⚠️
docling/document_converter.py 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ceberam

ceberam commented Jun 9, 2026

Copy link
Copy Markdown
Member

We can document that we support .dclg and dclg.xml in docs/usage/supported_formats.md

@dolfim-ibm dolfim-ibm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@PeterStaar-IBM
PeterStaar-IBM merged commit 7c37732 into main Jun 9, 2026
80 of 84 checks passed
@PeterStaar-IBM
PeterStaar-IBM deleted the feat/add-doclang-backend branch June 9, 2026 16:29
@dosubot

dosubot Bot commented Jun 9, 2026

Copy link
Copy Markdown

Documentation Updates

1 document(s) were updated by changes in this PR:

What are the detailed pipeline options and processing behaviors for PDF, DOCX, PPTX, and XLSX files in the Python SDK?
View Changes
@@ -1,7 +1,7 @@
 ### PDF
 - **Pipeline/Backend**: `StandardPdfPipeline` + `DoclingParseDocumentBackend` (default: `docling_parse`)
 - **Key Options**:
-    - `from_formats`: Supported input formats include `docx`, `pptx`, `html`, `image`, `pdf`, `asciidoc`, `md` (including `txt`, `text`, `qmd`, `rmd`), `csv`, `xlsx`, `xml_uspto`, `xml_jats`, `xml_xbrl`, `mets_gbs`, `json_docling`, `audio`, `vtt`, `latex`
+    - `from_formats`: Supported input formats include `docx`, `pptx`, `html`, `image`, `pdf`, `asciidoc`, `md` (including `txt`, `text`, `qmd`, `rmd`), `csv`, `xlsx`, `xml_uspto`, `xml_jats`, `xml_xbrl`, `xml_doclang`, `mets_gbs`, `json_docling`, `audio`, `vtt`, `latex`
     - `to_formats`: Supported output formats include `md`, `json`, `yaml`, `html`, `html_split_page`, `text`, `doctags`, `vtt`
     - `pdf_backend`: Allowed values: `pypdfium2`, `docling_parse`, `threaded_docling_parse`, `dlparse_v1`, `dlparse_v2`, `dlparse_v4` (default: `docling_parse`)
         - `threaded_docling_parse`: Threaded Docling Parse backend optimized for concurrent page parsing in the standard PDF pipeline

How did I do? Any feedback?  Join Discord

haladamateusz pushed a commit to haladamateusz/docling that referenced this pull request Jun 12, 2026
* upgraded to latest docling-core

Signed-off-by: Peter Staar <[email protected]>

* implemented new backend for doclang

Signed-off-by: Peter Staar <[email protected]>

* updated the README and index file

Signed-off-by: Peter Staar <[email protected]>

* updated README, index and supported_formats. Also added export to doclang into cli

Signed-off-by: Peter Staar <[email protected]>

---------

Signed-off-by: Peter Staar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants