Closed chinedufn closed 5 years ago
Another thing that would be useful is being able to start from some string and then end at some offset number of lines.
{{ #include /path/to/file.rs:"Include this in":+10 }}
So this would start at the first line that contained "Include this in"
and end at that line number +10 (or end of file if there aren't 10 more lines)
Made a preprocessor for this mdbook-bookimport
https://github.com/tailwind/mdbook-bookimport
An issue and a pull request are already open: https://github.com/rust-lang-nursery/mdBook/pull/851 and https://github.com/rust-lang-nursery/mdBook/issues/811
But your mdbook-bookimport
is a great replacement while we wait for a new maintainer! :+1:
Ohhhh awesome thanks for the links!
Right now you can include the contents of a file in between two line numbers.
This has been useful - but can lead to some rot if you modify a file and forget to update your mdbook.
That rot has led me to sometimes split some code into another file - not because I wanted to or thought that it made sense - but because I wanted to be able to include it into an mdbook without forgetting to update the include statement.
I'm thinking that it would be useful to be able to include between some start and end sequence
Here's a rough sketch:
Could certainly be done in a third-party plugin - but I'm thinking that something like this might be useful enough to include in core...?
Rough ideas above so.. any thoughts are appreciated!