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

Github Flavoured Markdown #580

Open
0xdevalias opened this Issue Nov 4, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@0xdevalias

0xdevalias commented Nov 4, 2016

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.

@meridius

This comment has been minimized.

Show comment
Hide comment
@meridius

meridius Nov 4, 2016

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?

meridius commented Nov 4, 2016

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?

@0xdevalias

This comment has been minimized.

Show comment
Hide comment
@0xdevalias

0xdevalias Nov 4, 2016

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š" notifications@github.com 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.

0xdevalias commented Nov 4, 2016

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š" notifications@github.com 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.

@hying-caritas

This comment has been minimized.

Show comment
Hide comment
@hying-caritas

hying-caritas Apr 6, 2017

Is it possible to implement this support? I need this too.

hying-caritas commented Apr 6, 2017

Is it possible to implement this support? I need this too.

@ernstwi

This comment has been minimized.

Show comment
Hide comment
@ernstwi

ernstwi Sep 10, 2017

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

ernstwi commented Sep 10, 2017

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
@fzumstein

This comment has been minimized.

Show comment
Hide comment
@fzumstein

fzumstein Jul 9, 2018

Any update on this?

fzumstein commented Jul 9, 2018

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment