Add include by anchor in preprocessor (partial include)#851
Merged
Conversation
|
This would be so nice to have! |
Contributor
Author
|
I would be happy to finish the work if I can get more feedback 👍 |
ehuss
reviewed
Jul 5, 2019
Contributor
ehuss
left a comment
There was a problem hiding this comment.
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. |
Contributor
|
@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. |
Contributor
Author
|
@ehuss I'm currently working on it! If everything rebase nicely it'll be finished soon. |
Contributor
Author
|
Okay! Everything should be fine now 👍 |
Contributor
|
Great, thanks! |
Ruin0x11
pushed a commit
to Ruin0x11/mdBook
that referenced
this pull request
Aug 30, 2020
Add include by anchor in preprocessor (partial include)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: