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.
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
On Fri, 15 Feb 2019 06:11:32 -0500 (EST)
Aditya Mahajan
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.
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
On Fri, 15 Feb 2019 12:34:33 -0500 (EST)
Aditya Mahajan
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.
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
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
On Mon, 18 Feb 2019 17:08:44 +0100
Pablo Rodriguez
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.
On Mon, 18 Feb 2019 17:08:44 +0100
Pablo Rodriguez
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.
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
On Thu, 21 Feb 2019 18:50:41 +0100
Pablo Rodriguez
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.
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
Pablo Rodriguez
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.
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
On Mon, 18 Feb 2019 17:40:44 +0100
Mojca Miklavec
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.
On Mon, 18 Feb 2019 18:47:49 +0100
Gour
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
participants (6)
-
Aditya Mahajan
-
Alan Braslau
-
Gour
-
Mojca Miklavec
-
Pablo Rodriguez
-
Saša Janiška