From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115192 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thangalin via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Improving pandoc's ConTeXt output Date: Sun, 5 Jun 2022 16:52:52 -0700 Message-ID: References: <87o7z7pnrm.fsf@zeitkraut.de> <87czfnp55x.fsf@zeitkraut.de> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6359042104613708498==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25883"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thangalin To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 06 01:54:02 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ny04I-0006Ti-5c for gctc-ntg-context-518@m.gmane-mx.org; Mon, 06 Jun 2022 01:54:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AE0E82A1B25; Mon, 6 Jun 2022 01:53:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6hBeGjOZKOPC; Mon, 6 Jun 2022 01:53:12 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BF8C22A1B34; Mon, 6 Jun 2022 01:53:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 243912A1B34 for ; Mon, 6 Jun 2022 01:53:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RKxQu6QjLDZQ for ; Mon, 6 Jun 2022 01:53:08 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.170; helo=mail-pf1-f170.google.com; envelope-from=thangalin@gmail.com; receiver= Original-Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 8CD032A1B25 for ; Mon, 6 Jun 2022 01:53:08 +0200 (CEST) Original-Received: by mail-pf1-f170.google.com with SMTP id y196so11444232pfb.6 for ; Sun, 05 Jun 2022 16:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e2QJEBvgqvME88FTvUsU/Z3OMSe8aeQugZmc39a6Dlg=; b=l/Vo/LK2FhM//yhiioNi4+QDjyz/TGogh5ZDHbLhKwH4Azi+360SsdTxzCAgpJ5Ydh j+5/9a3sBcbDKHc9Oe6PbfgojGbkIWnso9iQKoGAxdslH8vxdeBXnWfOXje6tUH1eCyI 9EZmznYJ5zjeaPJf8GxA959quGYz7ij//coWFGt9J68Yg//8CFcPdtVux/m8DbgIAWoj 6IEBXd43JKDrWsfjsF+lvmWrgstHqkHFiK4G9W/JmWDD6Joh24NJUFevdluhmjvOelJt EN/FCPbAN5aHDsQ6mgORCY5XRn2VKWh2xw4xpMuY89cWdaXsMOfBn42pa9M3f8OvC8xg vJtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e2QJEBvgqvME88FTvUsU/Z3OMSe8aeQugZmc39a6Dlg=; b=YMYi1z0XLiOTzdhdIMUGMvCi3pOiDCPFroO9cTmsKnXp4qSCOAIlSeu6e6XIOS3vgq 8mwZEhVZA5R+8d2E9oQYQSfyuqaA6njieizLosdL0TOTKX94/QBBBF7j/wIVrX0mL/R6 wiPXQI0/xC0CWgZGnolQmHsobeTN3lkAf0Rp5nczVRXUACrDBAuKNs7E80d4Cp9wLnhF V4WtZ44LmDNjrkEt9Pjp4nkSudRlk7fr5FWHk2Vj8iADYsGxSbnE9pAN2W5XHUjar5le ew7cKaP3BKrgqJQSeG6Emm66siRMKRicAmaxPAhS39v6jPUszyC1oT0vPCjcsb716+J/ zn2g== X-Gm-Message-State: AOAM530YOZ3ozwS0UZPGVt3G5VKIoxCyN0EF49/J/fazBCGn4JnMDMcy N3SjdasEdemjWOzG1pVpgPa+Gma/mykfDPGmmjXWZa7M78Y= X-Google-Smtp-Source: ABdhPJzpDCicWptKwq3NU2nfRGkXJslAiKfIYqsQG0TViOuCdpnNBUi+f7uIOKxBz8xZYKtxQDpEWxe2FOzb3uvePQE= X-Received: by 2002:a63:6a43:0:b0:3fd:913e:9b02 with SMTP id f64-20020a636a43000000b003fd913e9b02mr5280630pgc.540.1654473183416; Sun, 05 Jun 2022 16:53:03 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:115192 Archived-At: --===============6359042104613708498== Content-Type: multipart/alternative; boundary="0000000000006356ff05e0bc0ee0" --0000000000006356ff05e0bc0ee0 Content-Type: text/plain; charset="UTF-8" Hi folks, I would like to blog about it, but we are still tweaking the process. > I put together a multipart series about the process of going from Markdown to Pandoc to ConTeXt: https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/ To speed up the "write > typeset > review" process, I developed KeenWrite: https://github.com/DaveJarvis/keenwrite Behind the scenes, KeenWrite uses a Java library similar to pandoc with some additions, such as the ability to use pandoc's annotation syntax. The biggest issue for rolling this out is providing users a way to easily install ConTeXt in a cross-platform manner. At the moment, trying to export from KeenWrite without a local ConTeXt install simply directs the user to download and install the most appropriate version for their system. We make use of the yaml preface in the markdown files especially for > offers. The sales consultant only has to fill out the yaml part and > KeenWrite goes a bit beyond this to completely separate YAML variables from the Markdown files. The text editor also provides a hierarchical editor for YAML trees along with the ability to reference those YAML variables when building. This can be accomplished from the user preferences or the command-line: https://github.com/DaveJarvis/keenwrite/blob/master/docs/cmd.md What's more is that the variables can be inserted into documents, isolating duplicated information to a single location: the externalized YAML data. Great for templating. One of the reasons I wrote KeenWrite was so that I could simplify the use of variables within documents. In the Typesetting Markdown series, the build script essentially performs: 1. pandoc document-vars.md + vars.yaml > document-final.md 2. pandoc document-final.md > document.tex 3. context document.tex > document.pdf Using KeenWrite, this process becomes: keenwrite --input document-vars.md --theme=boschet --variables vars.yaml --output document.pdf This ends up converting an annotated Markdown file into XML then uses ConTeXt to typeset the XML using a particular theme.KeenWrite has a number of themes, some basic, some advanced: https://github.com/DaveJarvis/keenwrite-themes/ This allows me to eliminate the dependency on both Pandoc and Inkscape. I've also encountered some problems with SVG to MP, but Hans is usually quick to fix the bugs given a minimal working example that pinpoints the problem. Either way, it's possible to retain the Inkscape step by telling ConTeXt not to use the MP conversion, as you alluded to, Juh. There are other handy features built into KeenWrite. For example, it's possible to separate chapters into individual files. As long as they are named something natural (ch1.md, ch2.md, a_chap.md, b_chap.md), they'll get collated in the correct order. From there, Control+P will export to PDF for the current file and Control+Shift+P will combine all chapters into a single PDF. Then there's the F12 button that captures errors and output from ConTeXt. If you check it out, let me know what you think! Cheers! --0000000000006356ff05e0bc0ee0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi = folks,

I would like to blog about it, but we are still tweaking the process.

I put together a multipart series about the process of going fro= m Markdown to Pandoc to ConTeXt:


To speed up the "write > typeset > = review" process, I developed KeenWrite:


Behind the scenes, KeenWrite uses a Java library similar to= pandoc with some additions, such as the ability to use pandoc's annota= tion syntax.

The biggest issue for rolling this out is provi= ding users a way to easily install ConTeXt in a cross-platform manner. At t= he moment, trying to export from KeenWrite without a local ConTeXt install = simply directs the user to download and install the most appropriate versio= n for their system.

We make use of the yaml preface in the markdown files especially for
offers. The sales consultant only has to fill out the yaml part and

KeenWrite goes a bit beyond this to completely separate YAML vari= ables from the Markdown files. The text editor also provides a hierarchical= editor for YAML trees along with the ability to reference those YAML varia= bles when building. This can be accomplished from the user preferences or t= he command-line:


What's more is that the variables can be inserted into documents, isol= ating duplicated information to a single location: the externalized YAML da= ta. Great for templating.

One of the reasons I wrote KeenWrite was so t= hat I could simplify the use of variables within documents. In the Typesett= ing Markdown series, the build script essentially performs:
  1. pandoc document-vars.m= d + vars.yaml > document-final.md
  2. pandoc document-final.md &= gt; document.tex
  3. context document.tex > document.pdf
Using Ke= enWrite, this process becomes:

keenwrite --input document-vars.md --theme=3Dboschet --variables = vars.yaml --output document.pdf

This ends up converting an annotated Markdown file into XML then u= ses ConTeXt to typeset the XML using a particular theme.KeenWrite has a num= ber of themes, some basic, some advanced:

<= /div>

This allows me to eliminate the dependency on both Pandoc and Inkscape= . I've also encountered some problems with SVG to MP, but Hans is usual= ly quick to fix the bugs given a minimal working example that pinpoints the= problem. Either way, it's possible to retain the Inkscape step by tell= ing ConTeXt not to use the MP conversion, as you alluded to, Juh.
=

There are other handy features= built into KeenWrite. For example, it's possible to separate chapters = into individual files. As long as they are named something natural (ch1.md,= ch2.md, a_chap.md, b_chap.md), they'll get collated in the correct ord= er. From there, Control+P will export to PDF for the current file and Contr= ol+Shift+P will combine all chapters into a single PDF.

Then there's the F12 button that capture= s errors and output from ConTeXt.

If you check it out, let me know what you think!

=
Cheers!
<= br>
--0000000000006356ff05e0bc0ee0-- --===============6359042104613708498== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6359042104613708498==--