On Fri, May 05, 2017 at 11:12:41PM +0200, Mojca Miklavec wrote:
> On 5 May 2017 at 21:54, Aditya Mahajan wrote:
> > On Thu, 4 May 2017, Mojca Miklavec wrote:
> >
> >> There's a really nice module for processing markdown:
> >>     https://github.com/Witiko/markdown
> >> that has been presented during the TUG meeting and is included in TeX
> >> Live.
> >
> > This is a fork of luamark (by the author of pandoc). Wouldn't it be better
> > to provide an interface around that? Is it simply providing a tex interface
> > around luamark or are there any changes in the parser as well.
> >
> > Any idea how it compares with the markdown parser in m-markdown already
> > included in ConTeXt?

Hello,

some of the major differences between jgm/lunamark and Witiko/markdown
include:

 - Witiko/markdown supports syntax extensions that are currently not
   implemented in jgm/lunamark (iA Writer Content Blocks).

 - The output of Witiko/markdown consists of structural
   `\markdownRenderer...` macros that can be easily redefined by a user
   to produce arbitrary results. Example input:

        - _item 1_
        - [item 2](url)
        - `item 3`

   Example output:

        \markdownRendererUlBeginTight
        \markdownRendererUlItem\markdownRendererEmphasis{item 
1}\markdownRendererUlItemEnd 
        \markdownRendererUlItem\markdownRendererLink{item 
2}{url}{url}{}\markdownRendererUlItemEnd 
        \markdownRendererUlItem\markdownRendererCodeSpan{item 
3}\markdownRendererUlItemEnd 
        \markdownRendererUlEndTight

   In contrast, jgm/lunamark directly produces ConTeXt-specific markup.

 - Witiko/markdown does caching; processed documents and verbatim code
   blocks are stored in auxiliary files and these files are referenced
   from the conversion output. This is highly useful for debugging and
   for postprocessing the auxiliary files using external tools.
 
 - Witiko/markdown is stripped-down compared to jgm/lunamark, so that
   external dependencies such as Cosmo and Alt-getopt are unnecessary.

The `m-markdown.lua` seems like a heavily stripped-down version of
lunamark. Most importantly, the parser seems to recognize no syntax
extensions, so only Gruber's vanilla Markdown is supported.

P.S.: Witiko/markdown already has a ConTeXt interface (see `texdoc
markdown`, section 2.4). However, Mojca and I agreed that it would
likely benefit from additional syntactic sugar. Example document:

    \usemodule[t][markdown]
    \def\markdownOptionSomething{true}
    \def\markdownRendererSomethingElse#1#2#3{\foo{#1}}
    \starttext
    \markdownInput{bar.md}
    \startmarkdown
    Some _Markdown_ text.
    \stopmarkdown
    \stoptext

The example document was taken from the slides introducing the package [1].

  [1]: https://github.com/Witiko/markdown/blob/slides-tug07/light.pdf

Best Regards,
Vít Novotný

> I'm CC-ing the author since I don't know answers to these questions,
> but it would indeed be nice to end up with one single good module
> rather than having two slightly different incompatible ones with the
> same name.
> 
> Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to