Open andreasohlund opened 8 years ago
The code for our snippets parsing is here https://github.com/SimonCropp/CaptureSnippets
Rather than adding a feature to markdown-preview that is custom tailored to one target usage, could you create a package that post-processes the Markdown file to perform the import and then previews that?
I guess you are saying:
Is that correct?
Yes, that's what I'm suggesting.
Ok, any pointers how to "trick" markdown preview to show the generated file instead of the one being edited?
I'm looking for a way to add support for pulling in text/markdown from external files and include that in the preview. What would be the best way to approach this?
Background
The way we do documentation for NServiceBus is by storing our docs as markdown files in a GH repo and render that repo into a static site. As part of doing this we support the concept of including code snippets using the following syntax in the .md file:
The reason to include the code from external files is that we have them included in a visual studio projects so that we can compile all snippets to ensure that the syntax is correct.
Example:
https://github.com/Particular/docs.particular.net/blob/master/nservicebus/rabbitmq/configuration-api.md
renders as
http://docs.particular.net/nservicebus/rabbitmq/configuration-api#configuring-rabbitmq-transport-to-be-used
and the included code snippets are pulled from
https://github.com/Particular/docs.particular.net/blob/master/Snippets/Snippets_5/Transports/RabbitMQ/Usage.cs
during rendering.