Simple way to modify the HTML output by the HTML renderer?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.2k
- Forks
- 1.9k
- PR merge metrics
- PR metrics pending
Description
Question
Hello, I need to make some custom modifications to the HTML generated by the HTML renderer before it is written to the HTML files, is there a simple way to do that?
I thought that I could just write another renderer and have mdBook call it after the HTML renderer, but it looks like the file writing logic is inside the HTML renderer, with no way to add some external transformer in between, and that the only way currently would be to write another full HTML renderer.
Is there some simpler way?
Thank you.
Version
mdbook v0.4.43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the HTML renderer and the file-writing logic described in the issue, then trace how mdBook invokes renderers. Determine whether a supported transformation hook can be specified and define the expected behavior for modifying HTML before files are written.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100