Hide lines from code block

Hello!

I’m looking into how I could validate my code blocks. For that, I sometimes need to add context to the code block that I would like to not display once the site is built.

Looking at code block and fences in Zola, I think something very close to how hl_lines works would suit my needs: allow code block to hide lines · mockersf/zola@4c0ed75 · GitHub (it’s on master, code blocks don’t seem to work very well on next).

```rust,hidden_lines=1
import my_crate::prelude::*;
hello_world();

Would that be something that is interesting for Zola?

Another possibility would be to do like mdBook and hide lines starting by a # (mdBook-specific features - mdBook Documentation) but that could not work for some languages

I think it’s fine to add, maybe just call it hide_lines.

Another possibility would be to do like mdBook and hide lines starting by a #

Definitely not, that would break many code blocks as you say.

it’s on master , code blocks don’t seem to work very well on next

Which issues do you have?

My bad, it was an issue with my theme that missed a configuration.

I opened a PR: Hide lines in code block by mockersf · Pull Request #1453 · getzola/zola · GitHub