ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Thangalin via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Thangalin <thangalin@gmail.com>
Subject: Re: Improving pandoc's ConTeXt output
Date: Sun, 5 Jun 2022 16:52:52 -0700	[thread overview]
Message-ID: <CAANrE7oG-r7ya35MZa3Xu6txrb2fjpLxYw0KS3VTvO8Va3__Bw@mail.gmail.com> (raw)
In-Reply-To: <aa920c8b-19d2-0111-cbe2-290caa8f4392@mailbox.org>


[-- Attachment #1.1: Type: text/plain, Size: 3061 bytes --]

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!

[-- Attachment #1.2: Type: text/html, Size: 5865 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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	other threads:[~2022-06-05 23:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  7:07 Albert Krewinkel via ntg-context
2022-06-05  8:20 ` juh via ntg-context
2022-06-05  9:39   ` Denis Maier via ntg-context
2022-06-05 14:15   ` Albert Krewinkel via ntg-context
2022-06-05 16:38     ` juh+ntg-context--- via ntg-context
2022-06-05 23:52       ` Thangalin via ntg-context [this message]
2022-06-06  5:21         ` Problem with SVG an conversion mp (was: Improving pandoc's ConTeXt output) Jan U. Hasecke via ntg-context
2022-06-06  5:51         ` Improving pandoc's ConTeXt output juh+ntg-context--- via ntg-context
2022-06-05  9:46 ` Denis Maier via ntg-context
2022-06-05 10:01 ` Hans Hagen via ntg-context
2022-06-05 11:08   ` Wolfgang Schuster via ntg-context
2022-06-05 14:30     ` Albert Krewinkel via ntg-context
2022-06-06 20:47       ` Henning Hraban Ramm via ntg-context
2022-06-08 13:43 ` Albert Krewinkel via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAANrE7oG-r7ya35MZa3Xu6txrb2fjpLxYw0KS3VTvO8Va3__Bw@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=thangalin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).