Skip to content

Commit

Permalink
feat: add inline groups, revamp Markdown export incl. list groups (#156)
Browse files Browse the repository at this point in the history
* feat: add inline groups, update markdown export

Signed-off-by: Panos Vagenas <[email protected]>

* rename parameter for clarity

Signed-off-by: Panos Vagenas <[email protected]>

* drop redundant `traverse_inline`, use only `visited`

Signed-off-by: Panos Vagenas <[email protected]>

* update API usage after rebase

Signed-off-by: Panos Vagenas <[email protected]>

* minor refactor

Signed-off-by: Panos Vagenas <[email protected]>

* extend nesting logic to list groups

Signed-off-by: Panos Vagenas <[email protected]>

* (MD export) add inline formulas, placeholders for `KeyValueItem`, `FormItem`

Signed-off-by: Panos Vagenas <[email protected]>

* include 3rd-level list item in test

Signed-off-by: Panos Vagenas <[email protected]>

* update test file with more recent conversion result

Signed-off-by: Panos Vagenas <[email protected]>

* update list construction pattern so that sublists are added to actual ListItems

Signed-off-by: Panos Vagenas <[email protected]>

---------

Signed-off-by: Panos Vagenas <[email protected]>
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas authored Feb 25, 2025
1 parent 4708f93 commit 2abaf9b
Show file tree
Hide file tree
Showing 33 changed files with 18,195 additions and 3,449 deletions.
264 changes: 164 additions & 100 deletions docling_core/types/doc/document.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docling_core/types/doc/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class GroupLabel(str, Enum):
FORM_AREA = "form_area"
KEY_VALUE_AREA = "key_value_area"
COMMENT_SECTION = "comment_section"
INLINE = "inline"

def __str__(self):
"""Get string value."""
Expand Down
5 changes: 3 additions & 2 deletions docs/DoclingDocument.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@
"slide",
"form_area",
"key_value_area",
"comment_section"
"comment_section",
"inline"
],
"title": "GroupLabel",
"type": "string"
Expand Down Expand Up @@ -1765,7 +1766,7 @@
"type": "string"
},
"version": {
"default": "1.1.0",
"default": "1.2.0",
"pattern": "^(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "Version",
"type": "string"
Expand Down
Loading

0 comments on commit 2abaf9b

Please sign in to comment.