public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Dmitriy Krasilnikov <dmitriy.krasilnikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Need help writing a LUA filter: merge all Para from a Div to a single Para.Str
Date: Sat, 10 Aug 2019 07:31:57 -0700 (PDT)	[thread overview]
Message-ID: <15c2e38f-139c-41a6-932a-3ca06263781d@googlegroups.com> (raw)


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

Greetings!

I'm trying to convert RST admonitions to one-liner strings.

Here's the JSON output for a «Note» admonition:
{
  "t": "Div",
  "c": [
    [
      "",
      [
        "note"
      ],
      []
    ],
    [
      {
        "t": "Div",
        "c": [
          [
            "",
            [
              "admonition-title"
            ],
            []
          ],
          [
            {
              "t": "Para",
              "c": [
                {
                  "t": "Strong",
                  "c": [
                    {
                      "t": "Str",
                      "c": "Note"
                    }
                  ]
                }
              ]
            }
          ]
        ]
      },
      {
        "t": "Para",
        "c": [
          {
            "t": "Str",
            "c": "Причина"
          },
          {
            "t": "Space"
          },
          {
            "t": "Str",
            "c": "необходимости"
          },
          {
            "t": "Space"
          },
          {
            "t": "Str",
            "c": "закрепления"
          },
          {
            "t": "Space"
          },
          {
            "t": "Str",
            "c": "понятия?"
          }
        ]
      }
    ]
  ]
}

How can I convert this top-level Div to a string like: Note: <text from the 
next Para>? I'm new to LUA, been googling all day but no hints.

-- 
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/15c2e38f-139c-41a6-932a-3ca06263781d%40googlegroups.com.

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

             reply	other threads:[~2019-08-10 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-10 14:31 Dmitriy Krasilnikov [this message]
     [not found] ` <15c2e38f-139c-41a6-932a-3ca06263781d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-08-10 16:46   ` Albert Krewinkel
     [not found]     ` <871rxtq87v.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2019-08-11 10:30       ` Dmitriy Krasilnikov

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=15c2e38f-139c-41a6-932a-3ca06263781d@googlegroups.com \
    --to=dmitriy.krasilnikov-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).