Skip to content

feat: add parameter to choose of which pages export the doctags #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickymaggio02
Copy link

@rickymaggio02 rickymaggio02 commented May 12, 2025

Add parameter to export only certain pages to doctors from a Docling document

Signed-off-by: rickymaggio02 <riccardo.maggioni@googlemail.com>
Copy link

mergify bot commented May 12, 2025

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)(?:\(.+\))?(!)?:

Copy link
Collaborator

@vagenas vagenas left a comment

Choose a reason for hiding this comment

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

@rickymaggio02

  • I have left some inline comments/suggestions.
  • Besides, let's test-cover the new param (you can draw inspiration from how we test minified in test_docling_doc.py).

@@ -3885,6 +3885,7 @@ def export_to_doctags( # noqa: C901
add_table_cell_location: bool = False,
add_table_cell_text: bool = True,
minified: bool = False,
pages: Optional[list[int]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make it a set since the underlying parameter is also a set.

Suggested change
pages: Optional[list[int]] = None,
pages: Optional[set[int]] = None,

@@ -3903,6 +3904,7 @@ def export_to_doctags( # noqa: C901
:param # table specific flagsadd_table_cell_location: bool
:param add_table_cell_text: bool: (Default value = True)
:param minified: bool: (Default value = False)
:param pages: list[int]: (Default value = None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
:param pages: list[int]: (Default value = None)
:param pages: set[int]: (Default value = None)

@vagenas vagenas self-assigned this May 21, 2025
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.

2 participants