mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Add configuration option to disable the default hidelines feature for rust

Open zgtm opened this issue 1 year ago • 7 comments

Simple change that adds a configuration option to disable the default hidelines feature for rust:

Usage:

[output.html.code]
default-hidelines = false

I need this in my book since I have several multi-line strings that have lines starting with #. (Embedded code snippets with preprocessor directives.)

~~Let me know if this needs a test.~~

If you want I can also add a line to the manual, but since this is a niche feature, the doc string might just be enough. :)

[Edit: Added a test]

zgtm avatar Jan 03 '25 13:01 zgtm

I need this in my book since I have several multi-line strings that have lines starting with #. (Embedded code snippets with preprocessor directives.)

You can use two consecutive hashes ## to keep the line visible.

max-heller avatar Jan 18 '25 23:01 max-heller

Hi @max-heller, thanks for the hint!

Unfortunately this will not work in my case, as I'm trying to include the code from a source file via {{#include filename}}, and the source file will only work with this particular line starting with a single '#'.

(One could argue whether the line hiding mechanism should be disabled completely for included sources via {{#include filename}}. But I did not want to open that can of worms. :grimacing:)

zgtm avatar Jan 20 '25 19:01 zgtm

:umbrella: The latest upstream changes (possibly 21f2435182e4a80c0bd0e3184ce36f7a57529d08) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Aug 18 '25 18:08 rustbot

Updated to

  • resolve merge conflicts
  • conform to updated formatting guidelines
  • fix creation of now-non_exhaustive structs

zgtm avatar Aug 21 '25 01:08 zgtm

:umbrella: The latest upstream changes (possibly 1c034bdd9a8ecc2212a7613efd60995dc90dd0a8) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Sep 17 '25 03:09 rustbot

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

rustbot avatar Oct 07 '25 21:10 rustbot

Rebased onto the new HTML rendering pipeline (#2844).

zgtm avatar Oct 07 '25 21:10 zgtm