-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Markdown fragment files #403
Comments
Can you show a small example of what you mean? Like C#'s partial classes, but for markdown? |
Kind of, but with the ability for the partial file to be unpackaged at the inclusion line.. |
There is no out-of-the-box support for something like this, but it should be rather straight forward to implement as an extension. For example, you can implement a parser to catch the include syntax and emit a |
@MihaZupan I have a preliminary cut of the code working, I have found some restrictions though with potential rendering implementation.. I dont want to ruin the commit history though.. is it OK to commit and push on a branch to the repo? |
If you have a local change, you can fork this repo and push your changes there. |
The root.md file "includes" another "includeTest.md" xoofx#403
Added the parser to the pipeline builder Created the html renderer which basically recurses and added it to the HtmlRenderer class. xoofx#403
done =] welcome the feedback (but will add a disclaimer.. it was late and i was tired) not that a coder has used THAT excuse before ;) The SimpleExample project has two markdown files and shows the include line working/rendering |
That's when the cool code appears. Thanks. Yes, that would be the general idea for approaching it. This could be a neat extension, but it would require a few more usability additions, at minimum:
I would be careful about using Comments about the implementation:
To concider: Optionally cache the included files? I would expect the common use case for this to include the header/footer that doesn't change. |
That's weird.. this confused me so I looked at the page i linked to, the The path is assumed to always be local/relative, but a check could be added to enable that not being the case.
See what I mean about coding tired! I knew that ! :( I didn't know about the So moving forward:
Thanks for the feedback! |
I have suggested this in the past, but sometimes this problem is handled differently through a text templating (e.g Jekyll with GitHub pages). You can use something like scriban for example (I did use it along Markdig to implement a prototype of static website generator for instance). But if a markdown syntax is not enough common (supported by a few of the major Markdown engine), I would prefer not to be included in Markdig default extensions. For example, they are using their own include syntax in DocFx and it is working fine for their case. |
@WattsC-90 - Do you have your latest changes committed anywhere? I'd love to leverage what you've created so far and extend upon it if need be. Nice work!!! |
Unfortunately not, given everything covid related at the moment iv been working from home and as such tried to stay away from code in the evenings! Wasnt ever leaving the screen otherwise. My intention was to try do a couple of hours this weekend which will move it to an extension as opposed to fully inside the main engine. |
Is it possible, with the library as it is, to suport fragmented markdown files? I am looking to hse this library as a documentation tool, and the only feature i cant see listed is file fragments! If not, ill have a dig through the code when i get a moment..
The text was updated successfully, but these errors were encountered: