-
-
Notifications
You must be signed in to change notification settings - Fork 268
Description
Description
When writing tutorials, a common use-case is to first show small parts of a file, before showing more extensive parts (or the entire file). For example:
// --8<-- [start:hello]
fun hello() {
blah blah;
// --8<-- [start:interesting]
// Do some interesting stuff here!
var x = foo();
bar(x);
// --8<-- [end:interesting]
}
// --8<-- [end:hello]
When hello is then included in some markdown, it will render a block like so:
fun hello() {
blah blah;
// --8<-- [start:interesting]
// Do some interesting stuff here!
var x = foo();
bar(x);
// --8<-- [end:interesting]
}
But the scissors aren't at all relevant to the example, and it's not desirable for the user to see them. It would be much nicer if they would see the following:
fun hello() {
blah blah;
// Do some interesting stuff here!
var x = foo();
bar(x);
}
One workaround is of course to duplicate the code (either in the same or different files, depending on how it works) such that there are no nested snippets, but that's a bit messy and makes it harder to maintain.
Benefits
It would benefit anyone wanting to render snippets containing nested snippets.
Solution Idea
If there are reasons for not wanting this behavior by default, perhaps it could be enabled as an option.