Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Initial support for supporting School of Haskell Markdown #832
Add some support for a School of Haskell markdown extensions. My primary use case is to down-convert pandoc markdown documents to school of haskell compatible documents.
School of Haskell markdown is mostly strict markdown with two extensions.
The current github code block parser only supports a single atttribute like:
But School of Haskell (http://www.fpcomplete.org) allows multiple attributes like: ``` haskell active web This patch adds a new extension Ext_backtick_code_multi which could probably be better named. Or, perhaps the normal github parser should be extended to always allow this? The Markdown Reader has been extended with: <|> (guardEnabled Ext_backtick_code_multi >> ((\xs -> ("", xs, )) <$> (identifier `sepBy1` (many1 (char ' '))))) Which could possibly be improved. The writer has been extended as well.
I wish they'd taken my suggestion to use a single class,
It would be easy to write a program that auto-converted existing
I passed on the suggestion. They would need to support haskell, haskellactive, and haskellactiveweb. And possibly other variations in the future.
The most obvious is the @@@ fences which allow you to hide content until the user clicks on 'show more'. Useful for hiding punch lines, solutions, etc.
But, they also have a bunch of extensions to what can go in an source code block, such as hoogle links, the ability to hide/show/highlight stuff within the code block and more.
Obviously, not all these features can be supported by all output formats. And, supporting them would requiring modifying the internal representation of a code block to be more sophisticated. It is not yet clear that SoH is going to be popular enough to warrant adding explicit support for their extensions.
But, if it does become popular, I expect that they only way to support whatever other extensions they provide will be to create a markdown_soh format.
Anyway, I can understand not wanting to support yet another markdown dialect that may not even stick around.
It's too bad that we can't just add new formats and dialects as 3rd party plugins. Like, pandoc-markdown-soh. Then it could be its own separate thing maintained by fpcomplete.
+++ stepcut [Apr 23 13 11:28 ]:
If they changed to single-word classes, then with current pandoc you
It would actually not be hard for me to allow multiple classes
Ah neat. The json filter thing sounds interesting. Also, I forgot to mention something that seemed important.
The downside of doing
In my patch if you read something as markdown_soh and outputted it as markdown_github, it would use just he first parameter, which is usually ``` haskell. So at least highlighting would still work?
But, perhaps the json filter could rewrite that as well? I need to look more into this I guess.
+++ stepcut [Apr 23 13 20:40 ]:
Yes, my thought is that the json filter would do some serious rewriting.
But really, you're going to want to do something more interesting
For example, for "hidden" bits you might want to provide some
Anyway, my thought is that "school of Haskell markdown" might be a bit
Thanks! I'll look into that. THEM is mostly ME at the moment. I am trying to convert the Happstack Crash Course from a horrible mess of Makefile, sed, markdown.pl and HsColour, to using pandoc. And I want to be able to target HTML, PDF, ePub, kindle, and SoH. Obviously, I have to make some compromises to do that. But, I think the solution is that I have my own markdown variant that supports things like ``` activehaskell, and then outputs things the way I want them using the json filter stuff.