public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Apply filter to beamer blocks
Date: Mon, 13 Mar 2023 14:01:29 +0100	[thread overview]
Message-ID: <87cz5c7qfj.fsf@zeitkraut.de> (raw)
In-Reply-To: <22f6d608-baef-aa60-6fea-e3fb2d44d0c8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


bruno.grenet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org writes:

> Thanks for your reply. Ideally, I'd like something which is not based on the
> command line options, but that's already a working solution.

We've added a `pandoc.structure.slide_level` Lua function in a recent
release, Bastien's elegant solution can be made to work even when pandoc
auto-detects the slide level:

    function Pandoc (doc)
      local SLIDE_LEVEL =
        PANDOC_WRITER_OPTIONS.slide_level or
        pandoc.structure.slide_level(doc)
      return doc:walk {
        Header = function (header)
          if header.level == SLIDE_LEVEL then
            print(pandoc.utils.stringify(header))
          end
        end
      }
    end



-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


  parent reply	other threads:[~2023-03-13 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:24 Bruno Grenet
     [not found] ` <e9bfa616-059a-4df7-9d92-d462ea6f3ed0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-03-10 11:00   ` Bastien DUMONT
2023-03-13 12:00     ` bruno.grenet-Re5JQEeQqe8AvxtiuMwx3w
     [not found]       ` <22f6d608-baef-aa60-6fea-e3fb2d44d0c8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-03-13 13:01         ` Albert Krewinkel [this message]
     [not found]           ` <87cz5c7qfj.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2023-03-13 13:06             ` bruno.grenet-Re5JQEeQqe8AvxtiuMwx3w

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=87cz5c7qfj.fsf@zeitkraut.de \
    --to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@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).