Skip to content
Discussion options

You must be logged in to vote

Hi @SlayerDevelopment,

Yes, you can use Docling to infer the heading hierarchy, then split the exported Markdown into one folder per top-level section, keeping subsections together.

This approach was tested with Docling 2.126.0 and docling-core 2.96.0. In these versions, level-1 section headers export as ##, with subsections as ###, etc.

import re
from pathlib import Path

from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import (
    HeadingHierarchyOptions,
    PdfPipelineOptions,
)
from docling.document_converter import DocumentConverter, PdfFormatOption

options = PdfPipelineOptions(
    heading_hierarchy_options=HeadingHierarchyOptions(enab…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DanielNg0729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants