gitit
gitit copied to clipboard
Github Flavoured Markdown
It would be great to be able to use GitHub Flavoured Markdown.
Looking at the Pandoc options you can use markdown_github
, but trying to use this in my config file gives me an error:
gitit: Unknown page type: markdown_github
Searching the code, it seems this happens in Utils.hs, but I don't know enough (read: any) Haskell to figure out where to go from here, and how to go about adding support.
Not only GitHub MD Pandoc can be configured to use all sorts of MD syntax through extensions as stated here http://pandoc.org/MANUAL.html#pandocs-markdown. It would be great if Gitit could be configured to transfer those options to Pandoc.
I'm thinking globally in config file and per page in metadata block.
How about that?
That would be an even better solution :) Avoid all the arbitrary limitations!
Get Outlook for iOS
On Fri, Nov 4, 2016 at 10:46 PM +1100, "Martin Lukeš" [email protected] wrote:
Not only GitHub MD Pandoc can be configured to use all sorts of MD syntax through extensions as stated here http://pandoc.org/MANUAL.html#pandocs-markdown. It would be great if Gitit could be configured to transfer those options to Pandoc.
I'm thinking globally in config file and per page in metadata block.
How about that?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Is it possible to implement this support? I need this too.
I don't know enough Haskell to implement a general solution, but I found that changing these lines in ContentTransformer.hs was enough to get gitit to use GFM.
Before change:
readerExtensions = if lhs
then Set.insert Ext_literate_haskell
$ readerExtensions def
else readerExtensions def
After change:
readerExtensions = if lhs
then Set.insert Ext_literate_haskell
$ githubMarkdownExtensions
else githubMarkdownExtensions
You could also pick your own specific extensions from Text.Pandoc.Options. For example to use pandoc markdown with the extenstion hard_line_breaks
:
readerExtensions = if lhs
then Set.insert Ext_literate_haskell
$ Set.insert Ext_hard_line_breaks
$ readerExtensions def
else Set.insert Ext_hard_line_breaks
$ readerExtensions def
Any update on this?