[NTG-context] Markdown to HTML cross-references

2023-11-21 Thread Thangalin
Hi list,

I'm looking to implement a consistent syntax for cross-references in
KeenWrite  and am wondering what you think would
make the most sense for translating into ConTeXt commands.

First, some background (the first two give an overview, the others are
cross-reference references for various syntaxes):

   - https://talk.commonmark.org/t/cross-references-and-citations/4013/7
   - https://thesynack.com/posts/markdown-captions
   - https://quarto.org/docs/authoring/cross-references.html
   - https://mystmd.org/guide/cross-references
   - https://lierdakil.github.io/pandoc-crossref
   - https://github.com/tomduck/pandoc-eqnos

I'm leaning towards the following syntax:

Markdown Item (table, blockquote, TeX block, figure, code, R chunk, etc.)

: caption text {#type:label}

See [@type:label] for details.

There's a unit test that shows what's currently being generated with a
number of examples for images, tables, blockquotes, internationalization,
and so on:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/test/java/com/keenwrite/processors/markdown/extensions/references/CrossReferencesExtensionTest.java#L51

The code is a work-in-progress; so the tests may have changed depending on
if/when you view the Java source code. Presently, the captions produce
anchor references, mostly. The following seems easier to typeset using
ConTeXt:

Meschiya Lake - Lucky Devil 

This diverges from the HTML specification for tables (table/caption) and
figures (figure/figcaption). It would also mean having to write ConTeXt
macros that flip the spans and anchors to produce a caption such as:

*Lyrics 1.1.* Meschiya Lake - Lucky Devil

While there are plenty of ways of presenting captions (e.g., multi-column
images with sub-figure numbers) the majority of cross-references are to a
single "thing" with a single "caption".

What are your thoughts on this proposal? (Keeping in mind I'm the only
person working on KeenWrite and while I'm trying to keep the syntax
compatible with pandoc, implementing the full pandoc-crossref syntax is out
of scope for me.

Thank you!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


Re: [NTG-context] Markdown module in LMTX

2021-03-28 Thread Christoph Reller
Hi all,

In recent versions of ConTeXt LMTX the markdown module seems to work again.
I just copied the files m-markdown.mkiv and m-markdown.loa from a MKVI
version into the directory tex\texmf-modules\m-markdown of the LMTX version.

I don't believe that this is officially supported and I did no extensive
testing, but for my use case it works.

Cheers,
Christoph

On Fri, Jan 29, 2021 at 4:16 PM J Huisman 
wrote:

> Hi all,
>
> I can confirm that this problem has not yet been resolved? Any idea
> when it might happen?
>
> Cheers,
>
> Jelle
>
> On Mon, Jan 11, 2021 at 5:48 AM Christoph Reller
>  wrote:
> > In recent versions of ConTeXt LMTX, the builtin markdown module is
> missing. (Files m-markdown.[lua|mkiv])
> > Just copying this module from an earlier version shows that they don't
> work anymore.
> >
> > MWE:
> >
> > ConTeXt file:
> > -- 8< --
> > \usemodule[markdown]
> > \starttext
> > \processmarkdownfile{file.md}
> > \stoptext
> > -- 8< --
> >
> > file.md:
> > -- 8< --
> > Title
> > =
> >
> > Here comes a paragraph text.
> > -- 8< --
> >
> > Are there plans to add and update this module?
>
>
___
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
___


Re: [NTG-context] Markdown module in LMTX

2021-01-29 Thread J Huisman
Hi all,

I can confirm that this problem has not yet been resolved? Any idea
when it might happen?

Cheers,

Jelle

On Mon, Jan 11, 2021 at 5:48 AM Christoph Reller
 wrote:
>
> Hi,
>
> In recent versions of ConTeXt LMTX, the builtin markdown module is missing. 
> (Files m-markdown.[lua|mkiv])
> Just copying this module from an earlier version shows that they don't work 
> anymore.
>
> MWE:
>
> ConTeXt file:
> -- 8< --
> \usemodule[markdown]
> \starttext
> \processmarkdownfile{file.md}
> \stoptext
> -- 8< --
>
> file.md:
> -- 8< --
> Title
> =
>
> Here comes a paragraph text.
> -- 8< --
>
> Are there plans to add and update this module?
>
> Cheers,
> Christoph
> ___
> 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
> ___
___
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
___


[NTG-context] Markdown module in LMTX

2021-01-10 Thread Christoph Reller
Hi,

In recent versions of ConTeXt LMTX, the builtin markdown module is missing.
(Files m-markdown.[lua|mkiv])
Just copying this module from an earlier version shows that they don't work
anymore.

MWE:

ConTeXt file:
-- 8< --
\usemodule[markdown]
\starttext
\processmarkdownfile{file.md}
\stoptext
-- 8< --

file.md:
-- 8< --
Title
=

Here comes a paragraph text.
-- 8< --

Are there plans to add and update this module?

Cheers,
Christoph
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-24 Thread Saša Janiška
Pablo Rodriguez  writes:

> the code in my private repository is unnecessarily complex for too
> narrow cases.

OK.

>
> I think that the most valuable feature of environment itself (the file
> 'pandoc-xhtml.tex') is the practical introduction to “Dealing with XML
> in ConTeXt” (http://pragma-ade.com/general/manuals/xml-mkiv.pdf).

Thanks a lot for that url!!

> ConTeXt only requires XML source as input to typeset it.

That's great indeed. I have tried to typeset org-mode manual with your
environment and it worked great (~500p). :-)

> The published code is fine for what you want. The latest version would
> be misleading. It is crappy in many aspects (even for myself).

Good, good...

> ConTeXt deals with XML natively.

Yeah, next steps are to learn more ConTeXt and to study that manual.


Sincerely,
Gour

-- 
Not by merely abstaining from work can one achieve freedom
from reaction, nor by renunciation alone can one attain perfection.

___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-22 Thread Pablo Rodriguez
On 2/21/19 9:59 PM, Gour wrote:
> On Thu, 21 Feb 2019 18:50:41 +0100 Pablo Rodriguez wrote:
> 
>> I’m still behind the environment itself, although I realized that
>> these may not be relevant to everybody. I store the new commits in a
>> private repository.
> 
> Aha...I believe I might be interested. :-)

Hi Gour,

the code in my private repository is unnecessarily complex for too
narrow cases.

I think that the most valuable feature of environment itself (the file
'pandoc-xhtml.tex') is the practical introduction to “Dealing with XML
in ConTeXt” (http://pragma-ade.com/general/manuals/xml-mkiv.pdf).

>> I use the XML handling (generating the XHTML with pandoc) in ConTeXt
>> for almost all the documents I compile with ConTeXt. I think this is
>> the way to go.
> 
> I admit it sounds/looks very good. Morever, it could allow me to e.g. use
> org-mode for my original markup which I use anyway with Emacs and then do
> org-mode --> XHTML.

ConTeXt only requires XML source as input to typeset it.

>> My environment is only an example. You may write another one for your
>> own needs, you don’t have to use mine.
> 
> Heh, for that I must learn some things first. :-)

The published code is fine for what you want. The latest version would
be misleading. It is crappy in many aspects (even for myself).

>> There are other options, but LaTeX is a real problem for the
>> development of pandoc, because many times users expect pandoc as a
>> layer that spares them the actual dealing with LaTeX.
> 
> ConTeXt is certainly more appealing..

ConTeXt deals with XML natively.

Cheers,

Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-21 Thread Gour
On Thu, 21 Feb 2019 18:50:41 +0100
Pablo Rodriguez  wrote:

> sorry for my delayed reply.

No problem - there is no rush here. ;)

> I’m still behind the environment itself, although I realized that
> these may not be relevant to everybody. I store the new commits in a
> private repository.

Aha...I believe I might be interested. :-)

> I use the XML handling (generating the XHTML with pandoc) in ConTeXt
> for almost all the documents I compile with ConTeXt. I think this is
> the way to go.

I admit it sounds/looks very good. Morever, it could allow me to e.g. use
org-mode for my original markup which I use anyway with Emacs and then do
org-mode --> XHTML.

> My environment is only an example. You may write another one for your
> own needs, you don’t have to use mine.

Heh, for that I must learn some things first. :-)
 
> There are other options, but LaTeX is a real problem for the
> development of pandoc, because many times users expect pandoc as a
> layer that spares them the actual dealing with LaTeX.

ConTeXt is certainly more appealing..

> But this is only my personal opinion. I hope it might help.

Thanks you very much!


Sincerely,
Gour

-- 
It is far better to discharge one's prescribed duties, even though
faultily, than another's duties perfectly. Destruction in the course
of performing one's own duty is better than engaging in another's
duties, for to follow another's path is dangerous.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-21 Thread Pablo Rodriguez
On 2/19/19 2:22 PM, Gour wrote:
> On Mon, 18 Feb 2019 17:08:44 +0100 Pablo Rodriguez wrote:
> [...] 
>> I convert Markdown to XHTML and then I compile the XML sources with
>> ConTeXt.
> 
> I've tried it and it works nicely. The possibility to have one-source-does-all
> is tempting. ;)
> 
> Now I wonder if you're still behind the tool and/or whether it is still
> actively used by you?

Hi Gour,

sorry for my delayed reply.

I’m still behind the environment itself, although I realized that these
may not be relevant to everybody. I store the new commits in a private
repository.

I use the XML handling (generating the XHTML with pandoc) in ConTeXt for
almost all the documents I compile with ConTeXt. I think this is the way
to go.

My environment is only an example. You may write another one for your
own needs, you don’t have to use mine.

> Another question for both you and Aditya in regard to the point made by Mojca
> (suggesting to use Asciidoc markup) is whether you find that Pandoc's
> (extended) Markdown is semantically rich-enough to cover more complex 
> documents
> or in such cases it would be better to use richer markup like Asciidoc or 
> simpy
> to directly use ConTeXt?

I use extended Markdown even for typesetting a ConTeXt introduction in
Spanish (http://www.aprender-context.tk/).

But there are some basic features that I miss from extended Markdown:

- A lightweight syntax for language (such as [Deutsch]{:de}).
- The ability to place the table of contents.
- The ability to place the footnotes/endnotes.

There may be others, but these are the three ones that first came to my
mind.

> So far, one thing is clear: ConTeXt is the way to go instead of LaTeX and 
> other
> options, but now have to resolve whether to use pandoc's markdown, AsciiDoc or
> just ConTeXt...

There are other options, but LaTeX is a real problem for the development
of pandoc, because many times users expect pandoc as a layer that spares
them the actual dealing with LaTeX.

(La)TeX input sources and XML markup are diverse, this is why I think
that pandoc should generate PDF documents from XML sources (and forget
about (La)TeX support).

But this is only my personal opinion. I hope it might help.

Cheers,

Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-19 Thread Gour
On Mon, 18 Feb 2019 17:08:44 +0100
Pablo Rodriguez  wrote:

Hello Pablo,

> I convert Markdown to XHTML and then I compile the XML sources with
> ConTeXt.

I've tried it and it works nicely. The possibility to have one-source-does-all
is tempting. ;)

Now I wonder if you're still behind the tool and/or whether it is still
actively used by you?

Another question for both you and Aditya in regard to the point made by Mojca
(suggesting to use Asciidoc markup) is whether you find that Pandoc's
(extended) Markdown is semantically rich-enough to cover more complex documents
or in such cases it would be better to use richer markup like Asciidoc or simpy
to directly use ConTeXt?


So far, one thing is clear: ConTeXt is the way to go instead of LaTeX and other
options, but now have to resolve whether to use pandoc's markdown, AsciiDoc or
just ConTeXt...

Sincerely,
Gour


> 
> I describe the method at http://www.from-pandoc-to-context.tk/.
> 
> Just in case it might help,
> 
> Pablo


-- 
As the ignorant perform their duties with attachment to results,
the learned may similarly act, but without attachment, for the
sake of leading people on the right path.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Alan Braslau
On Mon, 18 Feb 2019 18:47:49 +0100
Gour  wrote:

> > I use TikZ when I need some ready-made stuff with possibly some fancy
> > shading patterns (or when I would pass the images to LaTeX users). In
> > those cases you might be able to achive the same in a lot less lines
> > of code, but you usually constantly need the user manual at hand, and
> > doing something low level is more tricky. ConTeXt support might be
> > occasionally broken.  
> 
> Thank you. It seems that metaPost/Fun is a way to go...

MetaPost is native to luatex (MPlib is integrated).

TikZ was designed for latex, although it has always made a great effort to 
remain open to context. Nevertheless, it does calculations in TeX, hardly 
ideal. Furthermore, MP solves (linear) equations which is very, very useful in 
creating drawings.

If MetaPost is "missing" any higher-level functionality, it is only because 
macros and packages have not been written for it, or distributed, for many 
exist. Sure, TikZ can provide lots more eye candy, pfluff I believe is what 
Tufte calls it.

Alan
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Aditya Mahajan

On Sun, 17 Feb 2019, Gour wrote:


On Fri, 15 Feb 2019 12:34:33 -0500 (EST)
Aditya Mahajan  wrote:


For simple documents, I use something like this (untested):


It does not work - maybe I have to install stand-alone version of ConTeXt, but
I got an idea.


Try this:

https://github.com/adityam/filter/wiki/pandoc

Aditya
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Gour
On Mon, 18 Feb 2019 17:40:44 +0100
Mojca Miklavec  wrote:

> If I was you, I would use AsciiDoc, convert it to DocBook and process
> the XML. (There is some simple proof-of-concept docbook processing
> already written.)

Uff, even when considering to just use AsciiDoc, I was always trying to stay
away from DocBook. :-)

Do you personally use that?

> Markdown is super ambiguous, with lots of different flavours, and
> often resorting to HTML for the lack of more expressive syntax.

I'm aware of that and that was the reason why in the past I was exploring
reST/AsciiDoc, but then I thƣnk that maybe I can use markdown just for
simpler/shorter content when publishing on web sites via static-site-generator
and for the rest (study notes, slide presentations, alreger texts and/or books)
to simply write directly in ConTeXt markup?

> There is relatively little syntax you need to learn to achive nearly
> anything,

This is something what I like - simplicity is always a virtue.

> I use TikZ when I need some ready-made stuff with possibly some fancy
> shading patterns (or when I would pass the images to LaTeX users). In
> those cases you might be able to achive the same in a lot less lines
> of code, but you usually constantly need the user manual at hand, and
> doing something low level is more tricky. ConTeXt support might be
> occasionally broken.

Thank you. It seems that metaPost/Fun is a way to go...


Sincerely,
Gour

-- 
As a lamp in a windless place does not waver, so the transcendentalist,
whose mind is controlled, remains always steady in his meditation on the
transcendent self.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Gour
On Mon, 18 Feb 2019 17:08:44 +0100
Pablo Rodriguez  wrote:

> I convert Markdown to XHTML and then I compile the XML sources with
> ConTeXt.
> 
> I describe the method at http://www.from-pandoc-to-context.tk/.
> 
> Just in case it might help,

Thank you, I'll explore that option...


Sincerely,
Gour

-- 
Therefore, without being attached to the fruits of activities,
one should act as a matter of duty, for by working without
attachment one attains the Supreme.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Mojca Miklavec
On Thu, 14 Feb 2019 at 23:01, Gour wrote:
>
> I'm interested for using markdown markup and typeset such documents via
> ConTeXt, but wonder whether it is recommended to use Markdown module or do
> markdown --> ConTeXt via Pandoc?

If I was you, I would use AsciiDoc, convert it to DocBook and process the XML.
(There is some simple proof-of-concept docbook processing already written.)

Markdown is super ambiguous, with lots of different flavours, and
often resorting to HTML for the lack of more expressive syntax.

> btw, for illustrating
> ConText documents and/or slide-presentation, do you recommend learning
> MetaPost/MetaFun over .eg. TikZ if one wants to focus on single
> (probably my learning plate is already quite full to go into something
> else considering the need to learn ConTeXt itself) package?

I use both.

MetaPost/Fun is really cool when you need a lot of control of what you
want to do, the more calculations you need, the better. There is
relatively little syntax you need to learn to achive nearly anything,
but you mostly need to do stuff from scratch (if you reuse that code,
it gives you a lot of power).

I use TikZ when I need some ready-made stuff with possibly some fancy
shading patterns (or when I would pass the images to LaTeX users). In
those cases you might be able to achive the same in a lot less lines
of code, but you usually constantly need the user manual at hand, and
doing something low level is more tricky. ConTeXt support might be
occasionally broken.

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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-18 Thread Pablo Rodriguez
On 2/14/19 11:00 PM, Gour wrote:
> Hello,
> 
> I'm interested for using markdown markup and typeset such documents via
> ConTeXt, but wonder whether it is recommended to use Markdown module or do
> markdown --> ConTeXt via Pandoc?

Hi Gour,

I convert Markdown to XHTML and then I compile the XML sources with ConTeXt.

I describe the method at http://www.from-pandoc-to-context.tk/.

Just in case it might help,

Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-16 Thread Gour
On Fri, 15 Feb 2019 12:34:33 -0500 (EST)
Aditya Mahajan  wrote:

> For simple documents, I use something like this (untested):

It does not work - maybe I have to install stand-alone version of ConTeXt, but
I got an idea.

> For more complicated documents (where I need both TeX and HTML
> output), I pre-process the input: 
> https://adityam.github.io/context-blog/post/markdown-with-gpp/

Thank you for the reference...some nice articles there. ;)

It looks as there is some learning ahead of me...btw, for illustrating
ConText documents and/or slide-presentation, do you recommend learning
MetaPost/MetaFun over .eg. TikZ if one wants to focus on single
(probably my learning plate is already quite full to go into something
else considering the need to learn ConTeXt itself) package?


Sincerely,
Gour

-- 
When your intelligence has passed out of the dense forest
of delusion, you shall become indifferent to all that has
been heard and all that is to be heard.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-15 Thread Aditya Mahajan

On Fri, 15 Feb 2019, Gour wrote:


On Fri, 15 Feb 2019 06:11:32 -0500 (EST)
Aditya Mahajan  wrote:


For obvious reasons, the built in markdown module is faster than
calling pandoc but I prefer using pandoc rather than the markdown
module for two reasons. First, pandoc provides many extensions to the
basic markdown syntax which I use frequently and second pandoc has
better documentation. 


Thank you.


Markdown is a loosely specified standard and sometimes it can be tricky to
figure out how to get a particular behavior.


That's correct - I was using reST in the past, but lack of support for e.g.
nested inline markup leads to strange and ugly workarounds. Then I was
considering AsciiDoc(tor), but consider that for simpler stuff (Pnadoc)
markdown could be enough, but for larger bodies of text ConTeXt is without
comparison.


So, if you are planning to use markdown for simple documents then go
with the markdown module but if you have more complicated document
structure, use pandoc. 


Do I inderstand you correctly: for more complicated documents you use Pandoc'
markdown and then do Pandoc --> ConTeXt conversion to typeset with the
ConTeXt at the end?


For simple documents, I use something like this (untested):

\usemodule[filter]

\defineexternalfilter
   [markdown]
   [filter={pandoc -t context -o \externalfilteroutput},
output=\externalfilterbasefile.tex,
cache=yes,
directory=output, %make sure a sub-dir output exists
readcommand=\ReadFile]

\starttext

\startmarkdown
This is a *test* in **markdown**.
\stopmarkdown

\stoptext

For more complicated documents (where I need both TeX and HTML output), I 
pre-process the input: 
https://adityam.github.io/context-blog/post/markdown-with-gpp/


Aditya
___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-15 Thread Gour
On Fri, 15 Feb 2019 06:11:32 -0500 (EST)
Aditya Mahajan  wrote:

> For obvious reasons, the built in markdown module is faster than
> calling pandoc but I prefer using pandoc rather than the markdown
> module for two reasons. First, pandoc provides many extensions to the
> basic markdown syntax which I use frequently and second pandoc has
> better documentation. 

Thank you.

> Markdown is a loosely specified standard and sometimes it can be tricky to
> figure out how to get a particular behavior.

That's correct - I was using reST in the past, but lack of support for e.g.
nested inline markup leads to strange and ugly workarounds. Then I was
considering AsciiDoc(tor), but consider that for simpler stuff (Pnadoc)
markdown could be enough, but for larger bodies of text ConTeXt is without
comparison.

> So, if you are planning to use markdown for simple documents then go
> with the markdown module but if you have more complicated document
> structure, use pandoc. 

Do I inderstand you correctly: for more complicated documents you use Pandoc'
markdown and then do Pandoc --> ConTeXt conversion to typeset with the
ConTeXt at the end?


Sincerely,
Gour

-- 
Those who are on this path are resolute in purpose,
and their aim is one. O beloved child of the Kurus,
the intelligence of those who are irresolute is many-branched.


___
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
___


Re: [NTG-context] markdown module vs pandoc

2019-02-15 Thread Aditya Mahajan

On Thu, 14 Feb 2019, Gour wrote:


I'm interested for using markdown markup and typeset such documents via
ConTeXt, but wonder whether it is recommended to use Markdown module or do
markdown --> ConTeXt via Pandoc?


For obvious reasons, the built in markdown module is faster than calling 
pandoc but I prefer using pandoc rather than the markdown module for two 
reasons. First, pandoc provides many extensions to the basic markdown 
syntax which I use frequently and second pandoc has better documentation. 
Markdown is a loosely specified standard and sometimes it can be tricky to 
figure out how to get a particular behavior.


So, if you are planning to use markdown for simple documents then go with 
the markdown module but if you have more complicated document structure, 
use pandoc. If you use the filter module then you can easily switch back 
and forth between the two markdown "backends" without changing your 
source.


Aditya

___
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
___


[NTG-context] markdown module vs pandoc

2019-02-14 Thread Gour
Hello,

I'm interested for using markdown markup and typeset such documents via
ConTeXt, but wonder whether it is recommended to use Markdown module or do
markdown --> ConTeXt via Pandoc?


Sincerely,
Gour

-- 
Thus the wise living entity's pure consciousness becomes covered by
his eternal enemy in the form of lust, which is never satisfied and
which burns like fire.


___
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
___


Re: [NTG-context] markdown: referencing tables

2013-04-10 Thread Xenia
On 10.04.2013 15:10, Hans Hagen wrote:
> On 4/10/2013 2:44 PM, Xenia wrote:
>> On 10.04.2013 01:02, Hans Hagen wrote:
>>> On 4/9/2013 9:29 PM, Xenia wrote:
 Dear context list,

 I love simple tables in markdown like this one

 \startmarkdown
 Right Left Center Default
 --- -- --   ---
12 121212
   123 123   123  123
 1 1  1 1

 Table:  Demonstration of simple table syntax.
 \stopmarkdown

 Is there a way to reference this table?
 With \starttabulate (\stoptabulate) tables can be referenced with
 \placetable, but \placetable just creates another (empty) table in case
 of a markdown table.
>>>
>>> Also if you put {} around the code? or use
>>>
>>> \startplacetable{xx}
>>> ...
>>> \stopplacetable
>>
>> No this creates no caption and a second (empty) table with the right
>> caption.
> 
> and what about:
> 
> \startbuffer
> \startmarkdown
> ...
> \stopmarkdown
> \stopbuffer
> 
> \placetable{whatever}{\getbuffer}

Unfortunately not. Marco might be right and this is a markdown issue …

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown: referencing tables

2013-04-10 Thread Marco Patzer
On 2013–04–09 Xenia wrote:

> \startmarkdown
>   Right Left Center Default
> --- -- --   ---
>  12 121212
> 123 123   123  123
>   1 1  1 1
> 
> Table:  Demonstration of simple table syntax.
> \stopmarkdown
> 
> Is there a way to reference this table?

I might get you wrong here, but I think this is a markdown/pandoc
issue. Look at the ConTeXt code generated for section references:

  %%% section.markdown 
  Whatever
  

  See [section](#whatever)
  %

  %%% section.tex %
  \section[whatever]{Whatever}

  See \in{section}{}[whatever]
  %

Now compare this with the code generated for tables on the other
hand:

  %%% table.markdown %%
Right Left Center Default
  --- -- --   ---
   12 121212
  123 123   123  123
1 1  1 1

  Table: Caption

  See [table](#caption)
  %

  %%% table.tex %%%
  \placetable[here]{Caption}
  \starttable[|r|l|c|l|]
  \HL
  \NC Right
  \NC Left
  \NC Center
  \NC Default
  \NC\AR
  \HL
  \NC 12
  \NC 12
  \NC 12
  \NC 12
  \NC\AR
  \NC 123
  \NC 123
  \NC 123
  \NC 123
  \NC\AR
  \NC 1
  \NC 1
  \NC 1
  \NC 1
  \NC\AR
  \HL
  \stoptable

  See \in{table}{}[caption]
  %

As you can see, no reference is created. I don't even know if
references are supported in markdown in the same way section
references are. If this is actually supposed to work, then I assume
a bug in the pandoc context output filter.

Marco


signature.asc
Description: Digital signature
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] markdown: referencing tables

2013-04-10 Thread Hans Hagen

On 4/10/2013 2:44 PM, Xenia wrote:

On 10.04.2013 01:02, Hans Hagen wrote:

On 4/9/2013 9:29 PM, Xenia wrote:

Dear context list,

I love simple tables in markdown like this one

\startmarkdown
Right Left Center Default
--- -- --   ---
   12 121212
  123 123   123  123
1 1  1 1

Table:  Demonstration of simple table syntax.
\stopmarkdown

Is there a way to reference this table?
With \starttabulate (\stoptabulate) tables can be referenced with
\placetable, but \placetable just creates another (empty) table in case
of a markdown table.


Also if you put {} around the code? or use

\startplacetable{xx}
...
\stopplacetable


No this creates no caption and a second (empty) table with the right
caption.


and what about:

\startbuffer
\startmarkdown
...
\stopmarkdown
\stopbuffer

\placetable{whatever}{\getbuffer}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown: referencing tables

2013-04-10 Thread Xenia
On 10.04.2013 01:02, Hans Hagen wrote:
> On 4/9/2013 9:29 PM, Xenia wrote:
>> Dear context list,
>>
>> I love simple tables in markdown like this one
>>
>> \startmarkdown
>>Right Left Center Default
>> --- -- --   ---
>>   12 121212
>>  123 123   123  123
>>1 1  1 1
>>
>> Table:  Demonstration of simple table syntax.
>> \stopmarkdown
>>
>> Is there a way to reference this table?
>> With \starttabulate (\stoptabulate) tables can be referenced with
>> \placetable, but \placetable just creates another (empty) table in case
>> of a markdown table.
> 
> Also if you put {} around the code? or use
> 
> \startplacetable{xx}
> ...
> \stopplacetable

No this creates no caption and a second (empty) table with the right
caption.

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown: referencing tables

2013-04-09 Thread Hans Hagen

On 4/9/2013 9:29 PM, Xenia wrote:

Dear context list,

I love simple tables in markdown like this one

\startmarkdown
   Right Left Center Default
--- -- --   ---
  12 121212
 123 123   123  123
   1 1  1 1

Table:  Demonstration of simple table syntax.
\stopmarkdown

Is there a way to reference this table?
With \starttabulate (\stoptabulate) tables can be referenced with
\placetable, but \placetable just creates another (empty) table in case
of a markdown table.


Also if you put {} around the code? or use

\startplacetable{xx}
...
\stopplacetable

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] markdown: referencing tables

2013-04-09 Thread Xenia
Dear context list,

I love simple tables in markdown like this one

\startmarkdown
  Right Left Center Default
--- -- --   ---
 12 121212
123 123   123  123
  1 1  1 1

Table:  Demonstration of simple table syntax.
\stopmarkdown

Is there a way to reference this table?
With \starttabulate (\stoptabulate) tables can be referenced with
\placetable, but \placetable just creates another (empty) table in case
of a markdown table.

Thanks,
Xenia
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Markdown subitems fail

2012-05-11 Thread Marco
On 2012-05-10 Hans Hagen  wrote:

> > I assume the markdown module uses a custom lua parser
> > internally.
> 
> indeed, and I need to update it (some ay)

There's no need to invest time on that issue. I just discovered the
module and gave it a shot. Anyhow, I use pandoc for the conversion
(and let the pandoc folks fix the parser bugs ;)

Marco


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Markdown subitems fail

2012-05-10 Thread Hans Hagen

On 10-5-2012 20:56, Marco wrote:

Subitems in markdown behave buggy. Example:

\usemodule [markdown]
\starttext
\startmarkdown
- Some item
- Another item
 - Subitem one
 - Subitem two
\stopmarkdown
\stoptext

Result:

• Some item
• Another item
   startmarkdownitemize[packed]
   startitem Subitem one stopitem stopmarkdownitemize

Using pandoc works fine. I assume the markdown module uses a custom
lua parser internally.


indeed, and I need to update it (some ay)

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Markdown subitems fail

2012-05-10 Thread Marco
Subitems in markdown behave buggy. Example:

\usemodule [markdown]
\starttext
\startmarkdown
- Some item
- Another item
- Subitem one
- Subitem two
\stopmarkdown
\stoptext

Result:

• Some item
• Another item
  startmarkdownitemize[packed]
  startitem Subitem one stopitem stopmarkdownitemize

Using pandoc works fine. I assume the markdown module uses a custom
lua parser internally.

Marco


___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] markdown

2011-07-26 Thread Vyatcheslav Yatskovsky

> Some kind of simple ascii tagging.


Markdown is also referred to as a markup language. There is also a
Wikipedia article about Markdown.



Thank you, this makes sense for me now.

Regards,
Vyatcheslav
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-26 Thread Paul Menzel
Am Dienstag, den 26.07.2011, 14:43 +0200 schrieb Hans Hagen:
> On 26-7-2011 2:37, Vyatcheslav Yatskovsky wrote:
> > I'm curious, what is "markdown" and why one ever needs to print it? ;)
> 
> Some kind of simple ascii tagging.

Markdown is also referred to as a markup language. There is also a
Wikipedia article about Markdown [1].

[…]


Thanks,

Paul


[1] https://secure.wikimedia.org/wikipedia/en/wiki/Markdown


signature.asc
Description: This is a digitally signed message part
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] markdown

2011-07-26 Thread Hans Hagen

On 26-7-2011 2:37, Vyatcheslav Yatskovsky wrote:

I'm curious, what is "markdown" and why one ever needs to print it? ;)


Some kind of simple ascii tagging.

As it concerned an api specification I wanted to have something readable 
instead of staring at an text file.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-26 Thread Vyatcheslav Yatskovsky

I'm curious, what is "markdown" and why one ever needs to print it? ;)

--
Best Regards,
Vyatcheslav Yatskovsky
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] markdown

2011-07-26 Thread Hans Hagen

Hi,

As it happened that I needed to print a readme.markdown file, the new 
beta now has a new extra:


  context --extra=markdown readme.markdown

For some options see:

  context --extra=markdown --help

It will never look real good, but it's better than printing verbatim.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-22 Thread Wolfgang Schuster

Am 21.07.2011 um 22:58 schrieb Hans Hagen:

> On 21-7-2011 9:31, Wolfgang Schuster wrote:
> 
>> %\unexpanded\def\markdownrule
>> %  {\hairline\par}
>> 
>> \unexpanded\def\markdownrule
>>   {\markdownparameter\c!rule}
> 
> or maybe better
> 
> \startsetups markdown:rule
>   \hairline
>   \par
> \stopsetups
> 
> \unexpanded\def\markdownrule
>  {\directsetup{markdown:rule}}

\setupmarkdown[rule=\...] would fir better in the normal setup concept of 
ConTeXt
but as this would be the only setting for \setupmarkdown it can wait till John
had more time to play with the module and find missing features.

Wolfgang

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-21 Thread Hans Hagen

On 21-7-2011 9:31, Wolfgang Schuster wrote:


%\unexpanded\def\markdownrule
%  {\hairline\par}

\unexpanded\def\markdownrule
   {\markdownparameter\c!rule}


or maybe better

\startsetups markdown:rule
   \hairline
   \par
\stopsetups

\unexpanded\def\markdownrule
  {\directsetup{markdown:rule}}




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-21 Thread Wolfgang Schuster

Am 20.07.2011 um 14:24 schrieb Hans Hagen:

> On 19-7-2011 7:25, Wolfgang Schuster wrote:
> 
>> Can you then also add a few features:
>> 
>> - Headings use \startstructurelevel
>> - Paragraphs are enclosed in startparagraph/stopparagraph
>> - emphasis and bold styles use \definehiglight command
>> 
>> to make it possible to change the layout of markdown documents
>> where ConTeXt is only used to produce a PDF.
> 
> I uploaded a beta with a markdown module. Not being a user myself I leave it 
> to others to provide documentation and examples.
> 
> \starttext
>\startmarkdown
>% some examples needed
>\stopmarkdown
> \stoptext


m-markdown.mkiv

\definedelimitedtext
  [markdownblockquote]
- [markdownquotation]
+ [quotation] % blockquote

How about a parameter to change the output of the rule:

%\unexpanded\def\markdownrule
%  {\hairline\par}

\unexpanded\def\markdownrule
  {\markdownparameter\c!rule}

Wolfgang

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-20 Thread John Haltiwanger
On Wed, Jul 20, 2011 at 5:24 AM, Hans Hagen  wrote:

> On 19-7-2011 7:25, Wolfgang Schuster wrote:
>
> The code is derived from luamark (but a few 100% faster so I might have
> messed up). And of course, being the markdown evangelist, John will answer
> all questions.
>

With pleasure :)
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] markdown

2011-07-20 Thread Hans Hagen

On 19-7-2011 7:25, Wolfgang Schuster wrote:


Can you then also add a few features:

- Headings use \startstructurelevel
- Paragraphs are enclosed in startparagraph/stopparagraph
- emphasis and bold styles use \definehiglight command

to make it possible to change the layout of markdown documents
where ConTeXt is only used to produce a PDF.


I uploaded a beta with a markdown module. Not being a user myself I 
leave it to others to provide documentation and examples.


\starttext
\startmarkdown
% some examples needed
\stopmarkdown
\stoptext

The code is derived from luamark (but a few 100% faster so I might have 
messed up). And of course, being the markdown evangelist, John will 
answer all questions.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-19 Thread Wolfgang Schuster

Am 19.07.2011 um 19:14 schrieb Hans Hagen:

> On 19-7-2011 7:08, Khaled Hosny wrote:
>> On Tue, Jul 19, 2011 at 04:05:13PM +0200, Hans Hagen wrote:
>>> Hi Khaled,
>>> 
>>> I took a look at the lunamark code, and ran it on some (copied)
>>> sample. As it was much slower than I'd expected from lpeg I messed
>>> around a little and could bring down the runtime on the sample from
>>> 2 sec to 0.1 sec. Anyhow, there is room for improvement so I wonder
>>> If I should take the code, wrap it up a bit, and make a module so
>>> that we can directly process markdown in context. (Of course we then
>>> need to keep an eye on how the original develops, if mkdown develops
>>> at all.)
>> 
>> That would be great! That was my intent when I started hacking lunamrk
>> to include a ConTeXt writer, by due to lack of time I never managed to
>> do the ConTeXt module part.
> 
> Ok, I'll give it a try and you can do the checking.

Can you then also add a few features:

- Headings use \startstructurelevel
- Paragraphs are enclosed in startparagraph/stopparagraph
- emphasis and bold styles use \definehiglight command

to make it possible to change the layout of markdown documents
where ConTeXt is only used to produce a PDF.

Wolfgang

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-19 Thread Hans Hagen

On 19-7-2011 7:08, Khaled Hosny wrote:

On Tue, Jul 19, 2011 at 04:05:13PM +0200, Hans Hagen wrote:

Hi Khaled,

I took a look at the lunamark code, and ran it on some (copied)
sample. As it was much slower than I'd expected from lpeg I messed
around a little and could bring down the runtime on the sample from
2 sec to 0.1 sec. Anyhow, there is room for improvement so I wonder
If I should take the code, wrap it up a bit, and make a module so
that we can directly process markdown in context. (Of course we then
need to keep an eye on how the original develops, if mkdown develops
at all.)


That would be great! That was my intent when I started hacking lunamrk
to include a ConTeXt writer, by due to lack of time I never managed to
do the ConTeXt module part.


Ok, I'll give it a try and you can do the checking.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-19 Thread Khaled Hosny
On Tue, Jul 19, 2011 at 04:05:13PM +0200, Hans Hagen wrote:
> Hi Khaled,
> 
> I took a look at the lunamark code, and ran it on some (copied)
> sample. As it was much slower than I'd expected from lpeg I messed
> around a little and could bring down the runtime on the sample from
> 2 sec to 0.1 sec. Anyhow, there is room for improvement so I wonder
> If I should take the code, wrap it up a bit, and make a module so
> that we can directly process markdown in context. (Of course we then
> need to keep an eye on how the original develops, if mkdown develops
> at all.)

That would be great! That was my intent when I started hacking lunamrk
to include a ConTeXt writer, by due to lack of time I never managed to
do the ConTeXt module part.

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] markdown

2011-07-19 Thread John Haltiwanger
On Tue, Jul 19, 2011 at 7:05 AM, Hans Hagen  wrote:

> Hi Khaled,
>
> I took a look at the lunamark code, and ran it on some (copied) sample. As
> it was much slower than I'd expected from lpeg I messed around a little and
> could bring down the runtime on the sample from 2 sec to 0.1 sec. Anyhow,
> there is room for improvement so I wonder If I should take the code, wrap it
> up a bit, and make a module so that we can directly process markdown in
> context. (Of course we then need to keep an eye on how the original
> develops, if mkdown develops at all.)
>

Markdown, in its official form, does not seem to evolve very much. However,
there are extensions to the original syntax, such as those provided by
Pandoc (including nice new reference functionalities) and also the Python
Markdown processor.

Anyway, this is great news! Can't wait to see it in action :)
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] markdown

2011-07-19 Thread Hans Hagen

Hi Khaled,

I took a look at the lunamark code, and ran it on some (copied) sample. 
As it was much slower than I'd expected from lpeg I messed around a 
little and could bring down the runtime on the sample from 2 sec to 0.1 
sec. Anyhow, there is room for improvement so I wonder If I should take 
the code, wrap it up a bit, and make a module so that we can directly 
process markdown in context. (Of course we then need to keep an eye on 
how the original develops, if mkdown develops at all.)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___