You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snippets feature. Remove lines inside a snippet that contain a remove/omit/hide notation (e.g. !-8<- ).
Motivation
Currently there are a couple of ways to control the contents of a snippet.
Snippet Sections are great if you can group content together
Snippet Lines are useful if the content layout isn't expected to shift
The use-case I have for snippets isn't really covered by these existing features. But would be solved if I could essentially "comment out" specific lines, adding a notation which would hide different lines.
Context
I have multiple source files which I'd like to include in my documentation, this is one example:
Users reading the documentation will essentially need to create a copy of this data structure. But the version I present to users needs to be stripped down significantly.
The problem I face is that the lines I need to omit from this file are so scattered, neither snippet lines or sections really works.
> snippet lines, very brittle
--8<-- "src.yml:10:10,13:13,14:16,19:23,27:27,31:35,38:38"
This removes the huge burden of ensuring the docs stay up to date with the source files. As snippets are simply configured inside the source file itself.
Additional note
Being able to declare blocks as well would be useful. As sometimes a comment can't be added to the end of a line.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Snippets feature. Remove lines inside a snippet that contain a remove/omit/hide notation (e.g.
!-8<-).Motivation
Currently there are a couple of ways to control the contents of a snippet.
The use-case I have for snippets isn't really covered by these existing features. But would be solved if I could essentially "comment out" specific lines, adding a notation which would hide different lines.
Context
I have multiple source files which I'd like to include in my documentation, this is one example:
Users reading the documentation will essentially need to create a copy of this data structure. But the version I present to users needs to be stripped down significantly.
The problem I face is that the lines I need to omit from this file are so scattered, neither snippet lines or sections really works.
> snippet lines, very brittle --8<-- "src.yml:10:10,13:13,14:16,19:23,27:27,31:35,38:38"Instead, being able to omit specific lines inside the source file itself would be hugely beneficial.
This removes the huge burden of ensuring the docs stay up to date with the source files. As snippets are simply configured inside the source file itself.
Additional note
Being able to declare blocks as well would be useful. As sometimes a comment can't be added to the end of a line.
All reactions