public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: pbeltran <pabelpe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Conditional compilation - How to?
Date: Sat, 6 Apr 2019 11:36:01 -0700 (PDT)	[thread overview]
Message-ID: <44645f9a-1670-4f4e-93cc-e24394fa10f4@googlegroups.com> (raw)
In-Reply-To: <CADAJKhBNWpmcKAAaNw_xo_EeT-JWKVPcnFo9EdDfzyA0+Fpydw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


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

Thanks. Using your script, what I can't do is to include a heading inside 
the fenced div, can't I? The reason is that I need solution to be presented 
in a different slide. I had just found a kind of solution, using heading 
identifiers (although when compiling to beamer it spits a warning (as 
several sections share the same identifier):

local looking_at_section = false
local lvl = 0
local remove = {}  -- delete line if 'remove' array not needed

function Block (elem)
  if elem.t == "Header" then
    -- if elem.classes:includes('remove',1) then

    if elem.identifier == 'answer' then
      looking_at_section = true
      lvl = elem.
level
    else

      looking_at_section = looking_at_section and elem.level >
lvl
    end
  end
  if looking_at_section then
    remove[#remove + 1] = elem  -- delete line if 'remove' array not needed
    return {}
  end
end





El sábado, 6 de abril de 2019, 20:17:02 (UTC+2), BP escribió:
>
> I use a div with a class and a filter which removes divs with that class 
> like this:
>
> ````markdown
> :::answer
> **Answer:** 42.
> :::
> ````
>
> ````lua
> function Div (elem)
>   if elem.classes:includes('answer') then
>     return {} -- delete it
>   else
>     return elem
>   end
> end
> ````
>
> HTH,
>
> /bpj
>
> Den lör 6 apr. 2019 18:44pbeltran <pab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> skrev:
>
>> My purpose is to generate two versions from the same markdown file. Think 
>> in a worksheet or a set of reveal slides with and without solutions.
>>
>> If I use gpp, like suggested here,  
>> <https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/>the 
>> math expressions in my .md (mathjax) get messed, since \ are escaped.
>>
>> Is there a way out of the box? For instance, by using custom fenced_divs 
>> and them telling pandoc to remove that specific div? I've taken a look at 
>> custom filters but I don't know haskell...
>>
>> Thanks
>>
>> -- 
>> 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/61bdaf46-d88a-4ef1-b145-71ad5900fed8%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/61bdaf46-d88a-4ef1-b145-71ad5900fed8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/44645f9a-1670-4f4e-93cc-e24394fa10f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

  parent reply	other threads:[~2019-04-06 18:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-06 16:43 pbeltran
     [not found] ` <61bdaf46-d88a-4ef1-b145-71ad5900fed8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-06 18:16   ` BPJ
     [not found]     ` <CADAJKhBNWpmcKAAaNw_xo_EeT-JWKVPcnFo9EdDfzyA0+Fpydw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-06 18:36       ` pbeltran [this message]
     [not found]         ` <44645f9a-1670-4f4e-93cc-e24394fa10f4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-07  5:49           ` BPJ
     [not found]             ` <CADAJKhAL7JGQyMS7A8eYhN7vQLdk7ccVm8=VEwz1keeuY_LVBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-07  6:46               ` pbeltran
     [not found]                 ` <5fc2de0f-82db-4d02-9dc9-ff5db8a8b9b4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-07 12:03                   ` BPJ
     [not found]                     ` <5a4d26a3-b9b7-dda1-d437-6e7cdd519dba-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-26  0:56                       ` Hans Kunkell
     [not found]                         ` <1375b479-60d6-4514-8c72-db60f3355ab8-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-06-26  8:25                           ` pbeltran
     [not found]                             ` <9ab5d37d-74c0-4793-81fe-c6cdab9e253d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-06-26  8:31                               ` Hans Kunkell
     [not found]                                 ` <4f0d389c-c21c-4069-a344-ef6ce1efb113-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-06-26  8:40                                   ` pbeltran

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=44645f9a-1670-4f4e-93cc-e24394fa10f4@googlegroups.com \
    --to=pabelpe-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).