-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Problem
In https://opengl.zgtm.eu/chapter_3.html I have Rust code, that contains multiline strings, which themselves contain C code (OpenGL shader).
E.g.:
const VERTEX_SHADER_SOURCE: &CStr = c"
#version 410 core
in vec3 position;
void main() {
gl_Position = vec4(position, 1.0f);
}
";
I want syntax coloring, so I declared the code as rust
(```rust). However, as the embedded C code in the string contains lines beginning with #
, I need a way to disable the default behaviour of mdBook to hide all lines that begin with a `#`.
Proposed Solution
I propose to add a new config option default-hidelines
under output.html.code
that is "true" by default, but can be set to "false" if one wishes to disable the default behaviour:
[output.html.code]
default-hidelines = false
I have written a PR that implements this solution in #2518 .
Notes
Since I use the {{#include ..}}
-helper of mdBook to include the code from the actual source files, I cannot use the workaround of using a double ##
, that was proposed in #2518.