Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration option to disable the default hidelines feature for rust #2518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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