rust-lang / rust-lang/mdBook

How to remove comments from generated HTML

Open
#2,756 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-question
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Question

I have some comments in md files like this <!-- some content -->,this comments will output to generated HTML, If someone looks at the source code of the webpage they will see the comments too.

Is there a way to ignore comments completely while generating the html pages?

addtional, hugo use --minify to support this
https://discourse.gohugo.io/t/adding-comments-in-a-blog-post-in-a-way-that-it-is-not-added-to-the-generated-html/52677

Version

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 Markdown comments are transformed into generated HTML in mdBook. Compare the current output with the requested behavior and determine what existing generation or minification path would need to change; done means comments are omitted from generated pages without removing other intended content.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.