Skip to content
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

feat: Add page markers option to markdown export #194

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

Conversation

Adolar13
Copy link

This PR adds a new 'add_page_markers' option to the export_to_markdown and
save_as_markdown functions in DoclingDocument. When enabled, this option adds
page markers (e.g., ##PAGE 1##) to the markdown output, making it easier to
identify content from different pages in the exported document.

The implementation includes:

  1. Adding the add_page_markers parameter to DocSerializer
  2. Modifying the MarkdownDocSerializer.serialize method to add page markers
  3. Adding tests to verify the functionality

This feature is useful for documents with multiple pages where maintaining
page boundaries in the exported markdown is important.

Fixes docling-project/docling#309 (comment)

Signed-off-by: Paul [email protected]

Copy link

mergify bot commented Mar 14, 2025

Merge Protections

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

🔴 Require two reviewer for test updates

This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

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

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.

Add option to export_to_markdown to mark page breaks
1 participant