-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add include by anchor in preprocessor (partial include) #851
Conversation
This would be so nice to have! |
I would be happy to finish the work if I can get more feedback 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks fine to me. Just needs a rebase and some docs.
@Dylan-DPC Do you have any thoughts on this?
I'm very excited, I'd love to see this land. FWIW, I reviewed the code briefly and thought it looked good. |
@CBenoit Do you think you'll be able to rebase this and add some docs? If not, that's ok, I can take it over if you don't have the time. |
@ehuss I'm currently working on it! If everything rebase nicely it'll be finished soon. |
Okay! Everything should be fine now 👍 |
Great, thanks! |
Add include by anchor in preprocessor (partial include)
For issue #811.
I apologize for the late pull request.
I'm not super happy with
https://github.com/rust-lang-nursery/mdBook/pull/851/files#diff-d6ae283361f866777987f4630e148843R138
and
https://github.com/rust-lang-nursery/mdBook/pull/851/files#diff-182fe74cafd75eb44defddf4511f3591R70
Please, tell me what you think about the anchored syntax. I'll update the user guide after.
In current implementation, first anchor must match regex "ANCHOR:\s*[\w\d_-]+" and similarly the ending anchor must match "ANCHOR_END:\s*[\w\d_-]+". In included file:
Then in the book:
Lines containing anchor patterns inside the included anchor are ignored, as such the result is: