DownmarkerWPF icon indicating copy to clipboard operation
DownmarkerWPF copied to clipboard

Allow switching on Github Flavoured Markdown

Open Aethylred opened this issue 11 years ago • 5 comments

It would be nice to be able to toggle on Github Flavoured Markdown for editing README.md and CONTRIBUTING.md for GitHub.

:sparkles not required.

Aethylred avatar Mar 01 '13 00:03 Aethylred

The easiest way to do this is to make a call to github to render the md file. That means every refresh of the preview would be an API call, which not sure that would work.

Otherwise the underlying markdown library we use will need to support github flavored markdown

JakeGinnivan avatar Mar 01 '13 00:03 JakeGinnivan

According to that link, Github uses the Ruby RedCarpet library to call the Sundown Markdown processor which is written in C. It so happens there's a .NET interface, Sundown.net. However, to support the Github Flavored Markdown, various options are set and a custom Ruby method is called to get the behavior Github wants.

It would be really nice to support a user-specified external Markdown processor. For instance, I'm using the kramdown processor which supports an extension to assign CSS classes to blocks that is critical for my application. Others will have reasons to use some other processor.

bburton avatar Mar 06 '13 18:03 bburton

Interesting! I don't have time at the moment to give this a go, but if you wanted to spike it and put in a pull request I can have a look

JakeGinnivan avatar Mar 07 '13 07:03 JakeGinnivan

@bburton it's hard to consume libraries that aren't .NET-specific

shiftkey avatar Mar 12 '13 03:03 shiftkey

@shiftkey Although I didn't mention it, what I had in mind is a generic command line interface so that almost any external Markdown processor could be specified. However, in this case, the realtime updating may be disabled so there would need to be a refresh button. The refresh button could change color to indicate the preview pane in out of date with the source or maybe when the preview is up-to-date, the button could be greyed out to indicate no action is needed. Some users may prefer to disable realtime updating even with the built-in Markdown processor so it may be worth making a generic setting to enable/disable realtime updating.

bburton avatar Mar 12 '13 05:03 bburton