docling-project / docling-project/docling

Feature Request: Include Excel Sheet Names as Headings in Markdown Export

Open
#3,229 0 comments 1 reaction 0 assignees View on GitHub
enhancement triage/close-stale
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

**Summary**
When converting Excel files, Docling internally captures sheet names as `GroupItem` objects (e.g., `name="sheet: {name}"`, `label=GroupLabel.SECTION`). However, these sheet names are not rendered as visible headings in the Markdown output.

**Problem**
During `export_to_markdown()`, the logical document structure (sheet grouping) is not reflected in the final Markdown. This makes it difficult to distinguish content originating from different sheets, especially for multi-sheet workbooks.

**Expected Behavior**
Sheet names should be emitted as Markdown section headers (e.g., `## Sheet Name`) during export.

**Proposed Solutions**

1. Automatically render `GroupItem` names (where `label=SECTION`) as Markdown headings.
2. Introduce an optional flag, e.g.:

```python
doc.export_to_markdown(include_group_headings=True)
```
3. Allow customization of heading levels (e.g., `##`, `###`) for better integration into downstream pipelines.

**Current Workarounds**

* Manually iterating over pages and injecting headers.
* Using `page_break_placeholder` to visually separate sheets.
* Parsing `GroupItem` names programmatically.

These approaches add complexity and require post-processing that could be handled natively.

**Why This Matters**

* Improves readability of exported Markdown.
* Preserves document structure more faithfully.
* Reduces need for custom post-processing in RAG pipelines and document ingestion workflows.

**Additional Context**
This behavior was observed in the Excel backend implementation where sheets are grouped but not surfaced in Markdown output.

---

Happy to contribute or test a PR if this direction aligns with the project.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.