public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: pandoc.write in Lua and simple tables in JSON (filters) (was: Force use of attributes in jats writer)
Date: Thu, 13 Jan 2022 18:18:06 +0100	[thread overview]
Message-ID: <CADAJKhBfgeEPm7jGd34-jqpKuniqwRTR7+epft3hWchcAGiX5w@mail.gmail.com> (raw)
In-Reply-To: <Yd/vtdosfda4eefI@localhost>

[-- Attachment #1: Type: text/plain, Size: 5561 bytes --]

Den tors 13 jan. 2022 10:27Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> skrev:

> I guess that it is can now be achieved using pandoc.write:
>
>   * Create a new Pandoc object containing your Div;
>   * Pass it to pandoc.write;
>

AFAIK there is no pandoc.write available in Lua filters. Might that change?
I for one could find use for it, e.g. to have content other than just
tags/commands be different between HTML and LaTeX one might produce a
Markdown version with some content converted to each format in two raw
elements and do some manual editing of each.

In Perl JSON filters it used to be pretty easy to shell out to pandoc to do
such things but sadly Pandoc::Elements hasn't been updated for the new
table model. I'm not whining since I could and should have contributed to
do something about it. Still a pandoc extension which would write/read
simple tables in JSON would be welcome, assuming that the code used in the
Lua module to convert between table models could be reused. I really have
problems conceptualizing the new table module, *especially* as represented
in JSON, sadly.

Would it be worth the while to file two issues for this, i.e. is there
realistic hope that either of them will be implemented?


  * Modify the returned string;
>   * Return it as the content of a RawBlock.
>
> By the way, this could also solve the problem discuss here, but I would
> like to test it before closing the issue:
> https://github.com/jgm/pandoc/issues/7262
>
> Le Thursday 13 January 2022 à 05:37:04AM, denis.maier-NSENcxR/0n0@public.gmane.org a écrit :
> > Well, the invalid file will only be temporary.
> > Let's say I a div with content-type="parallel" for parallel texts. In
> some cases the one column or both will have righttoleft text, so I need for
> multiple attributes:
> >
> > content-type="parallel-left-rtl"
> > content-type="parallel-right-rtl"
> > content-type="parallel-both-rtl"
> >
> > But this will cause redundant rules in the xslt for post-processing:
> >
> > I could do this:
> >
> > content-type="parallel right-rtl"
> > content-type="parallel left-rtl"
> > content-type="parallel both-rtl"
> >
> > Also not ideal (because processing such lists is ugly in XSLT). I
> thought about this:
> >
> >
> > content-type="parallel" right-dir="rtl"
> > content-type="parallel" left-dir="rtl"
> > content-type="parallel" left-dir="rtl" right-dir="rtl"
> >
> > I would then pick this up via xslt and construct valid colgroups based
> on the values of right-dir and left-dir. But maybe there's an easier way?
> >
> > Denis
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
> > > Gesendet: Donnerstag, 13. Januar 2022 01:50
> > > An: Maier, Denis Christian (UB) <denis.maier-NSENcxR/0n0@public.gmane.org>; pandoc-
> > > discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > Betreff: Re: Force use of attributes in jats writer
> > >
> > >
> > > I don't understand.  You want to create an invalid JATS document, with
> an
> > > attribute that is not supported for that element?
> > >
> > > <denis.maier-NSENcxR/0n0@public.gmane.org> writes:
> > >
> > > > Hi
> > > >
> > > > Is there a way to < convince > pandoc to use an attribute on a div
> that is not
> > > in the list for boxed-text in the list of allowed attributes in the
> jats writer?
> > > > Background: I want to use some non-standard attributes and pick them
> up
> > > later during post-processing. (The intermediary jats file will not be
> valid, the
> > > final result will be.) I can add that stuff to one of the allowed
> attributes, but
> > > that will make post-processing with xslt more complex.
> > > >
> > > > Best,
> > > > Denis
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > Groups "pandoc-discuss" group.
> > > > To unsubscribe from this group and stop receiving emails from it,
> send an
> > > email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > > > To view this discussion on the web visit
> > > https://groups.google.com/d/msgid/pandoc-
> > > discuss/b4b8786382dd497bb7bb231edcc5f93a%40unibe.ch.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "pandoc-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/b68835526c9e4d45afb6d3d122b7da91%40unibe.ch
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/Yd/vtdosfda4eefI%40localhost
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBfgeEPm7jGd34-jqpKuniqwRTR7%2Bepft3hWchcAGiX5w%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 8419 bytes --]

  reply	other threads:[~2022-01-13 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 11:04 Force use of attributes in jats writer denis.maier-NSENcxR/0n0
     [not found] ` <b4b8786382dd497bb7bb231edcc5f93a-NSENcxR/0n0@public.gmane.org>
2022-01-12  7:56   ` AW: " denis.maier-NSENcxR/0n0
2022-01-13  0:50   ` John MacFarlane
     [not found]     ` <yh480kfspsjw77.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-01-13  5:37       ` AW: " denis.maier-NSENcxR/0n0
     [not found]         ` <b68835526c9e4d45afb6d3d122b7da91-NSENcxR/0n0@public.gmane.org>
2022-01-13  9:24           ` Bastien DUMONT
2022-01-13 17:18             ` BPJ [this message]
     [not found]               ` <CADAJKhBfgeEPm7jGd34-jqpKuniqwRTR7+epft3hWchcAGiX5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-01-13 17:32                 ` pandoc.write in Lua and simple tables in JSON (filters) (was: Force use of attributes in jats writer) BPJ

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=CADAJKhBfgeEPm7jGd34-jqpKuniqwRTR7+epft3hWchcAGiX5w@mail.gmail.com \
    --to=melroch-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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).