You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a few enhancements, MM could easily be used as a documentation browser for our source code.
The three enhancements I'm thinking of:
Custom stylesheet/layout, on a per-solution basis. Just a way to make the preview prettier and add boilerplate HTML
Handle relative links correctly. In my Markdown, if I have a link to test.md it should tell VS to open that file if it exists. This will make it MM acts as a browser almost within VS. It will open extra tabs, but then you can use VS' built in back/forward to navigate between docs.
Switch to using Pandoc to generate HTML
Markdown# is cool, but I've had better luck packaging Pandoc.exe and executing it against markdown files to generate HTML. Here's a sample in C#:
// Process to output dirvarpandocStart=newProcessStartInfo();pandocStart.FileName="pandoc";// Standalone HTML generation using a template file// Use Github Markdown processing!pandocStart.Arguments="pandoc -r markdown_github --highlight-style=kate --template=template.html --toc";pandocStart.RedirectStandardError=true;pandocStart.RedirectStandardOutput=true;pandocStart.RedirectStandardInput=true;pandocStart.UseShellExecute=false;pandocStart.CreateNoWindow=true;pandocStart.WindowStyle=ProcessWindowStyle.Hidden;using(varpandoc=Process.Start(pandocStart)){varrawText=File.ReadToEnd(markdownFile);stringhtml;using(StreamWriterwriter=pandoc.StandardInput){awaitwriter.WriteAsync(rawText);}using(StreamReaderreader=pandoc.StandardOutput){html=awaitreader.ReadToEndAsync();}using(StreamReaderreader=pandoc.StandardError){varerror=awaitreader.ReadToEndAsync();if(!String.IsNullOrEmpty(error)){thrownewException(error);}}// Do something with the HTML generated by Pandoc}
I think this is better than using M# because it supports all sorts of extensions including tables, fenced code blocks, auto ID generation, and more (documented by Pandoc). Even cooler, it supports Pandoc title blocks or MultiMarkdown title blocks.
The text was updated successfully, but these errors were encountered:
(1) and (2) are entirely sensible. If you want to give it a go, feel free to try and send me a merge request!
(3) is tougher. Classification should match the eventual output, which means that MM needs a parser, and not just a translator as a binary. I see that pandoc has a haskell API and also some ability to spit out document ASTs, but it doesn't look like that information is sufficient to map from AST->original text, or at least it would be a large amount of work.
Ahh, I entirely forgot about the whole syntax parsing :)
Well, in that case, even extending M# to support fenced code blocks might be good. I've done it for my personal blog, so I have the code that adds the regex and adds syntax highlighting.
With a few enhancements, MM could easily be used as a documentation browser for our source code.
The three enhancements I'm thinking of:
test.md
it should tell VS to open that file if it exists. This will make it MM acts as a browser almost within VS. It will open extra tabs, but then you can use VS' built in back/forward to navigate between docs.Markdown# is cool, but I've had better luck packaging Pandoc.exe and executing it against markdown files to generate HTML. Here's a sample in C#:
I think this is better than using M# because it supports all sorts of extensions including tables, fenced code blocks, auto ID generation, and more (documented by Pandoc). Even cooler, it supports Pandoc title blocks or MultiMarkdown title blocks.
The text was updated successfully, but these errors were encountered: