Skip to content

Conversation

zgtm
Copy link

@zgtm zgtm commented Jan 3, 2025

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]

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Jan 3, 2025
@zgtm zgtm force-pushed the no-defaul-hidelines branch from 9b4cf94 to 6d7839b Compare January 3, 2025 13:37
@max-heller
Copy link
Contributor

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.

@zgtm
Copy link
Author

zgtm commented Jan 20, 2025

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. 😬)

@rustbot

This comment has been minimized.

@zgtm zgtm force-pushed the no-defaul-hidelines branch 2 times, most recently from bc1e3cc to 861e47b Compare August 21, 2025 01:21
@zgtm zgtm force-pushed the no-defaul-hidelines branch from 861e47b to 150f9c8 Compare August 21, 2025 01:26
@zgtm
Copy link
Author

zgtm commented Aug 21, 2025

Updated to

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants