rust-lang / rust-lang/mdBook

Include part and chapter titles when printing html

Open
#2,257 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Print C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
Avg merge
2d 21h
Merged PRs (30d)
12

Description

Problem

When printing the output to a pdf only contents of the individual markdown files are included. This means that part and chapter titles defined in the summary are excluded from the resulting document.

With chapters this not as big of a problem, because you can simply add the title from the summary to the beginning of the corresponding markdown file manually, although you are still missing the automatic numbering. On the other hand with part titles this problem is much more significant as there are no corresponding files where they could be added.

Proposed Solution

The solution could be to automatically add a headings based on the level of the file and a special type heading for parts when rendering the pdf output. It could also be nice to have the part title optionally on a separate page.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the summary and individual Markdown files are converted into HTML and PDF output. Determine how chapter and part heading levels, numbering, and optional page breaks should be represented, then add focused coverage for the resulting rendered document.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.