public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Printing conditional parts - looking for suggestions
@ 2016-05-16 23:02 Adam Wood
       [not found] ` <d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Wood @ 2016-05-16 23:02 UTC (permalink / raw)
  To: pandoc-discuss


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

I'm a church musician and liturgist. I print a lot of worship bulletins, as 
well as "full scripts" for ministers.
The congregational books don't need everything that the altar books need, 
and the organist or music director might need other things.
I'd like to be able to sync all of this in a single source document, and 
then use some kind of conditional formatting for printing out three (or 
more) different versions.

I imagine there are other use cases (lecturer who wants a script plus 
slides plus handouts from single source) where this sort of conditional 
multi-version printing would be helpful.


I'm just starting to think about how I would tackle this --- especially how 
the source file (Markdown) would look. Any thoughts, ideas, or pointers to 
existing projects would be really appreciated. 
(Maybe this exact thing exists already?)

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-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/d79563cb-25d7-40e1-9d20-777eeaeb7189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found] ` <d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-05-17  4:10   ` John MacFarlane
       [not found]     ` <20160517041033.GE34153-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
  2016-05-17 14:24   ` John Muccigrosso
  2016-05-18 21:45   ` D L
  2 siblings, 1 reply; 11+ messages in thread
From: John MacFarlane @ 2016-05-17  4:10 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You might find this useful:

https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/


+++ Adam Wood [May 16 16 16:02 ]:
>   I'm a church musician and liturgist. I print a lot of worship
>   bulletins, as well as "full scripts" for ministers.
>   The congregational books don't need everything that the altar books
>   need, and the organist or music director might need other things.
>   I'd like to be able to sync all of this in a single source document,
>   and then use some kind of conditional formatting for printing out three
>   (or more) different versions.
>   I imagine there are other use cases (lecturer who wants a script plus
>   slides plus handouts from single source) where this sort of conditional
>   multi-version printing would be helpful.
>   I'm just starting to think about how I would tackle this --- especially
>   how the source file (Markdown) would look. Any thoughts, ideas, or
>   pointers to existing projects would be really appreciated.
>   (Maybe this exact thing exists already?)
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-
>   9d20-777eeaeb7189%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found]     ` <20160517041033.GE34153-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
@ 2016-05-17  9:11       ` BP Jonsson
       [not found]         ` <CAFC_yuQVdqUUVVWxFxXmjN1dsw=i+4O8r2yEJBDv7aKD5RB5_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: BP Jonsson @ 2016-05-17  9:11 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

A filter which removes divs and/or spans with certain classes would be more
robust. Ideally the classes to remove could be specified on the command
line/in metadata. If the OP is interested I can write such a filter.

/bpj
Den 17 maj 2016 06:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> You might find this useful:
>
>
> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>
>
> +++ Adam Wood [May 16 16 16:02 ]:
>
>>   I'm a church musician and liturgist. I print a lot of worship
>>   bulletins, as well as "full scripts" for ministers.
>>   The congregational books don't need everything that the altar books
>>   need, and the organist or music director might need other things.
>>   I'd like to be able to sync all of this in a single source document,
>>   and then use some kind of conditional formatting for printing out three
>>   (or more) different versions.
>>   I imagine there are other use cases (lecturer who wants a script plus
>>   slides plus handouts from single source) where this sort of conditional
>>   multi-version printing would be helpful.
>>   I'm just starting to think about how I would tackle this --- especially
>>   how the source file (Markdown) would look. Any thoughts, ideas, or
>>   pointers to existing projects would be really appreciated.
>>   (Maybe this exact thing exists already?)
>>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>   To post to this group, send email to
>>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>   To view this discussion on the web visit
>>   [3]https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-
>>   9d20-777eeaeb7189%40googlegroups.com.
>>   For more options, visit [4]https://groups.google.com/d/optout.
>>
>> References
>>
>>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>>   3.
>> https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>>   4. 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/20160517041033.GE34153%40MacBook-Air-2.local
> .
> 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/CAFC_yuQVdqUUVVWxFxXmjN1dsw%3Di%2B4O8r2yEJBDv7aKD5RB5_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found]         ` <CAFC_yuQVdqUUVVWxFxXmjN1dsw=i+4O8r2yEJBDv7aKD5RB5_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-05-17 13:49           ` Simon Michael
  2016-05-17 14:00             ` Simon Michael
  2016-05-18 17:04           ` Adam Wood
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Michael @ 2016-05-17 13:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I was using pandoc filters for conditional content, which worked quite 
well. Here's the filter that strips out <div class=web>...</div> blocks, 
you could probably write it more easily in python:
https://github.com/simonmichael/hledger/blob/master/doc/pandoc-drop-web-blocks.hs
https://raw.githubusercontent.com/simonmichael/hledger/6a97a246dd757e9821650deae54b3a4ee49bd5b9/hledger-api/doc/hledger-api.1.m4.md

I wanted a little more, so right now I'm using m4 for conditional 
content, file including and formatting macros.
https://github.com/simonmichael/hledger/blob/master/doc/lib.m4
https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-api/doc/hledger-api.1.m4.md



On 5/17/16 2:11 AM, BP Jonsson wrote:
> A filter which removes divs and/or spans with certain classes would be more
> robust. Ideally the classes to remove could be specified on the command
> line/in metadata. If the OP is interested I can write such a filter.
>
> Den 17 maj 2016 06:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
>> You might find this useful:
>> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
  2016-05-17 13:49           ` Simon Michael
@ 2016-05-17 14:00             ` Simon Michael
  2016-05-17 17:08               ` John MACFARLANE
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Michael @ 2016-05-17 14:00 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

PS since I've linked it, I want to add that in the hledger project, 
pandoc (now with help from m4, but that's not strictly required) is 
helping me to generate, from the markdown source:

- man pages
- info manuals
- plain text manuals
- web manuals
- combined one-page web manual

which is awesome. Thank you John & all!

https://github.com/simonmichael/hledger/blob/master/Shake.hs#L138


On 5/17/16 6:49 AM, Simon Michael wrote:
> I was using pandoc filters for conditional content, which worked quite
> well. Here's the filter that strips out <div class=web>...</div> blocks,
> you could probably write it more easily in python:
> https://github.com/simonmichael/hledger/blob/master/doc/pandoc-drop-web-blocks.hs
> https://raw.githubusercontent.com/simonmichael/hledger/6a97a246dd757e9821650deae54b3a4ee49bd5b9/hledger-api/doc/hledger-api.1.m4.md
>
> I wanted a little more, so right now I'm using m4 for conditional
> content, file including and formatting macros.
> https://github.com/simonmichael/hledger/blob/master/doc/lib.m4
> https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-api/doc/hledger-api.1.m4.md
>
>
>
> On 5/17/16 2:11 AM, BP Jonsson wrote:
>> A filter which removes divs and/or spans with certain classes would be more
>> robust. Ideally the classes to remove could be specified on the command
>> line/in metadata. If the OP is interested I can write such a filter.
>>
>> Den 17 maj 2016 06:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
>>> You might find this useful:
>>> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>
>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found] ` <d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-05-17  4:10   ` John MacFarlane
@ 2016-05-17 14:24   ` John Muccigrosso
  2016-05-18 21:45   ` D L
  2 siblings, 0 replies; 11+ messages in thread
From: John Muccigrosso @ 2016-05-17 14:24 UTC (permalink / raw)
  To: pandoc-discuss


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

If you're generating web pages (html), you can also create multiple css 
files that make different div and span invisible.

-- 
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/3443a74c-491b-4690-8937-d4813320dfe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
  2016-05-17 14:00             ` Simon Michael
@ 2016-05-17 17:08               ` John MACFARLANE
       [not found]                 ` <20160517170804.GB6158-4kKid1p5UN5kRMcaKpzQXBvRwXAb8BAkh13vi7wywA4@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: John MACFARLANE @ 2016-05-17 17:08 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I use a series of filters to build the pandoc man page from the README.
See https://github.com/jgm/pandoc/tree/master/man


+++ Simon Michael [May 17 16 07:00 ]:
>PS since I've linked it, I want to add that in the hledger project, 
>pandoc (now with help from m4, but that's not strictly required) is 
>helping me to generate, from the markdown source:
>
>- man pages
>- info manuals
>- plain text manuals
>- web manuals
>- combined one-page web manual
>
>which is awesome. Thank you John & all!
>
>https://github.com/simonmichael/hledger/blob/master/Shake.hs#L138
>
>
>On 5/17/16 6:49 AM, Simon Michael wrote:
>>I was using pandoc filters for conditional content, which worked quite
>>well. Here's the filter that strips out <div class=web>...</div> blocks,
>>you could probably write it more easily in python:
>>https://github.com/simonmichael/hledger/blob/master/doc/pandoc-drop-web-blocks.hs
>>https://raw.githubusercontent.com/simonmichael/hledger/6a97a246dd757e9821650deae54b3a4ee49bd5b9/hledger-api/doc/hledger-api.1.m4.md
>>
>>I wanted a little more, so right now I'm using m4 for conditional
>>content, file including and formatting macros.
>>https://github.com/simonmichael/hledger/blob/master/doc/lib.m4
>>https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-api/doc/hledger-api.1.m4.md
>>
>>
>>
>>On 5/17/16 2:11 AM, BP Jonsson wrote:
>>>A filter which removes divs and/or spans with certain classes would be more
>>>robust. Ideally the classes to remove could be specified on the command
>>>line/in metadata. If the OP is interested I can write such a filter.
>>>
>>>Den 17 maj 2016 06:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
>>>>You might find this useful:
>>>>https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>>
>>
>
>
>-- 
>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/nhf85b%24lq2%241%40ger.gmane.org.
>For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found]                 ` <20160517170804.GB6158-4kKid1p5UN5kRMcaKpzQXBvRwXAb8BAkh13vi7wywA4@public.gmane.org>
@ 2016-05-18 12:19                   ` BP Jonsson
  0 siblings, 0 replies; 11+ messages in thread
From: BP Jonsson @ 2016-05-18 12:19 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I sometimes use the Perl Template::Toolkit as a preprocessor when I need to
embed variables and the like, but it would probably be overkill for the
OP's stated needs.

https://metacpan.org/release/Template-Toolkit

tisdag 17 maj 2016 skrev John MACFARLANE <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

> I use a series of filters to build the pandoc man page from the README.
> See https://github.com/jgm/pandoc/tree/master/man
>
>
> +++ Simon Michael [May 17 16 07:00 ]:
>
>> PS since I've linked it, I want to add that in the hledger project,
>> pandoc (now with help from m4, but that's not strictly required) is helping
>> me to generate, from the markdown source:
>>
>> - man pages
>> - info manuals
>> - plain text manuals
>> - web manuals
>> - combined one-page web manual
>>
>> which is awesome. Thank you John & all!
>>
>> https://github.com/simonmichael/hledger/blob/master/Shake.hs#L138
>>
>>
>> On 5/17/16 6:49 AM, Simon Michael wrote:
>>
>>> I was using pandoc filters for conditional content, which worked quite
>>> well. Here's the filter that strips out <div class=web>...</div> blocks,
>>> you could probably write it more easily in python:
>>>
>>> https://github.com/simonmichael/hledger/blob/master/doc/pandoc-drop-web-blocks.hs
>>>
>>> https://raw.githubusercontent.com/simonmichael/hledger/6a97a246dd757e9821650deae54b3a4ee49bd5b9/hledger-api/doc/hledger-api.1.m4.md
>>>
>>> I wanted a little more, so right now I'm using m4 for conditional
>>> content, file including and formatting macros.
>>> https://github.com/simonmichael/hledger/blob/master/doc/lib.m4
>>>
>>> https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-api/doc/hledger-api.1.m4.md
>>>
>>>
>>>
>>> On 5/17/16 2:11 AM, BP Jonsson wrote:
>>>
>>>> A filter which removes divs and/or spans with certain classes would be
>>>> more
>>>> robust. Ideally the classes to remove could be specified on the command
>>>> line/in metadata. If the OP is interested I can write such a filter.
>>>>
>>>> Den 17 maj 2016 06:10 skrev "John MacFarlane" <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
>>>>
>>>>> You might find this useful:
>>>>>
>>>>> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>>>>>
>>>>
>>>
>>>
>>
>> --
>> 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/nhf85b%24lq2%241%40ger.gmane.org
>> .
>> 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/20160517170804.GB6158%40D25Q40BGFY13.berkeley.edu
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

------------------------------
SavedURI :Show URLShow URLSavedURI :
SavedURI :Hide URLHide URLSavedURI :
https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvwhttps://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw
<https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw>
<https://mail.google.com/_/scs/mail-static/_/js/k=gmail.main.sv.G3GZFwvcniQ.O/m=m_i,t,it/am=fUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=h/d=1/rs=AItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw>
------------------------------

-- 
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/CAFC_yuSgiRVFtLKD34%3DE0777WFOkgP%3DpvC1yjX0VctWo7si%3Dng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found]         ` <CAFC_yuQVdqUUVVWxFxXmjN1dsw=i+4O8r2yEJBDv7aKD5RB5_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2016-05-17 13:49           ` Simon Michael
@ 2016-05-18 17:04           ` Adam Wood
       [not found]             ` <17d1ffd2-b289-45e3-a5aa-885ad3b59e9f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: Adam Wood @ 2016-05-18 17:04 UTC (permalink / raw)
  To: pandoc-discuss


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

HTML divs would work, I assume. (Yes? Even with output to PDF or otherwise 
a generalized solution?)
I imagine a panflute or pandocfilters filter that accomplishes this would 
be used by more people than just me. I Python slowly (And am about to have 
a baby) so if you are interested in doing this before I ever get to it, 
that would be amazing and appreciated.

Incidentally, it makes more sense to me to _include_ classes as specified 
on command line. I imagine two classes for all the conditional sections - 
one marking them all as "conditional" and then one marking each's specific 
condition (which might be multiple, I suppose).


I also do like the gpp solution JMacF and might use that at least for now.


On Tuesday, May 17, 2016 at 2:11:59 AM UTC-7, BP Jonsson wrote:
>
> A filter which removes divs and/or spans with certain classes would be 
> more robust. Ideally the classes to remove could be specified on the 
> command line/in metadata. If the OP is interested I can write such a filter.
>
> /bpj
> Den 17 maj 2016 06:10 skrev "John MacFarlane" <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 
> <javascript:>>:
>
>> You might find this useful:
>>
>>
>> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>>
>>
>> +++ Adam Wood [May 16 16 16:02 ]:
>>
>>>   I'm a church musician and liturgist. I print a lot of worship
>>>   bulletins, as well as "full scripts" for ministers.
>>>   The congregational books don't need everything that the altar books
>>>   need, and the organist or music director might need other things.
>>>   I'd like to be able to sync all of this in a single source document,
>>>   and then use some kind of conditional formatting for printing out three
>>>   (or more) different versions.
>>>   I imagine there are other use cases (lecturer who wants a script plus
>>>   slides plus handouts from single source) where this sort of conditional
>>>   multi-version printing would be helpful.
>>>   I'm just starting to think about how I would tackle this --- especially
>>>   how the source file (Markdown) would look. Any thoughts, ideas, or
>>>   pointers to existing projects would be really appreciated.
>>>   (Maybe this exact thing exists already?)
>>>   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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>>   To post to this group, send email to
>>>   [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>>   To view this discussion on the web visit
>>>   [3]
>>> https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-
>>>   9d20-777eeaeb7189%40googlegroups.com.
>>>   For more options, visit [4]https://groups.google.com/d/optout.
>>>
>>> References
>>>
>>>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
>>>   2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
>>>   3. 
>>> https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>>>   4. 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-discus...-/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/20160517041033.GE34153%40MacBook-Air-2.local
>> .
>> 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/17d1ffd2-b289-45e3-a5aa-885ad3b59e9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found]             ` <17d1ffd2-b289-45e3-a5aa-885ad3b59e9f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-05-18 20:45               ` BP Jonsson
  0 siblings, 0 replies; 11+ messages in thread
From: BP Jonsson @ 2016-05-18 20:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Den 2016-05-18 kl. 19:04, skrev Adam Wood:
> HTML divs would work, I assume. (Yes? Even with output to PDF or otherwise
> a generalized solution?)

Sure. Pandoc just (ab)uses the HTML syntax for its own element type.

> I imagine a panflute or pandocfilters filter that accomplishes this would
> be used by more people than just me. I Python slowly (And am about to have
> a baby) so if you are interested in doing this before I ever get to it,
> that would be amazing and appreciated.

Try the one here:

<https://gist.github.com/bpj/f53b80cf993d40555c11421d12b78d01>

I haven't tested it very much but it's very simple.  You can 
either include only divs or spans with certain classes, or exclude 
only divs or spans with certain classes.  Not both at the same time.

>
> Incidentally, it makes more sense to me to _include_ classes as specified
> on command line. I imagine two classes for all the conditional sections -
> one marking them all as "conditional" and then one marking each's specific
> condition (which might be multiple, I suppose).
>
>
> I also do like the gpp solution JMacF and might use that at least for now.

I got frustrated with that approach because you have to 
double-escape your backslashes, which makes the markdown broken 
even if you remove the macros.

/bpj

>
>
> On Tuesday, May 17, 2016 at 2:11:59 AM UTC-7, BP Jonsson wrote:
>>
>> A filter which removes divs and/or spans with certain classes would be
>> more robust. Ideally the classes to remove could be specified on the
>> command line/in metadata. If the OP is interested I can write such a filter.
>>
>> /bpj
>> Den 17 maj 2016 06:10 skrev "John MacFarlane" <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org
>> <javascript:>>:
>>
>>> You might find this useful:
>>>
>>>
>>> https://randomdeterminism.wordpress.com/2012/06/01/how-i-stopped-worring-and-started-using-markdown-like-tex/
>>>
>>>
>>> +++ Adam Wood [May 16 16 16:02 ]:
>>>
>>>>    I'm a church musician and liturgist. I print a lot of worship
>>>>    bulletins, as well as "full scripts" for ministers.
>>>>    The congregational books don't need everything that the altar books
>>>>    need, and the organist or music director might need other things.
>>>>    I'd like to be able to sync all of this in a single source document,
>>>>    and then use some kind of conditional formatting for printing out three
>>>>    (or more) different versions.
>>>>    I imagine there are other use cases (lecturer who wants a script plus
>>>>    slides plus handouts from single source) where this sort of conditional
>>>>    multi-version printing would be helpful.
>>>>    I'm just starting to think about how I would tackle this --- especially
>>>>    how the source file (Markdown) would look. Any thoughts, ideas, or
>>>>    pointers to existing projects would be really appreciated.
>>>>    (Maybe this exact thing exists already?)
>>>>    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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>>>    To post to this group, send email to
>>>>    [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>>>>    To view this discussion on the web visit
>>>>    [3]
>>>> https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-
>>>>    9d20-777eeaeb7189%40googlegroups.com.
>>>>    For more options, visit [4]https://groups.google.com/d/optout.
>>>>
>>>> References
>>>>
>>>>    1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
>>>>    2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>
>>>>    3.
>>>> https://groups.google.com/d/msgid/pandoc-discuss/d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>>>>    4. 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-discus...-/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/20160517041033.GE34153%40MacBook-Air-2.local
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Printing conditional parts - looking for suggestions
       [not found] ` <d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-05-17  4:10   ` John MacFarlane
  2016-05-17 14:24   ` John Muccigrosso
@ 2016-05-18 21:45   ` D L
  2 siblings, 0 replies; 11+ messages in thread
From: D L @ 2016-05-18 21:45 UTC (permalink / raw)
  To: pandoc-discuss


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

I'm a recent newcomer to pandoc but I'll add this idea to the discussion. 
I followed this thread (and others) since I have an interest in 
pre-processing and post-processing so that different streams of 
documents/presentations can be produced. 
For example producing a batch of personalised documents or slidedecks. 

My current experiment in building a pandoc chain is to use php variables at 
beginning and end of command chain.
As far as I can see from my initial reading filters do not seem to meet 
this "personalisation" requirement.
For example using a php template for reveal.js output where php vars are 
embedded for presentation to individual readers.

In fact I have created a custom mime type in /etc/mime.types for markdown 
where a file with extension .pmd can be executed as php script.

text/x-markdown md pmd

The extension md is for normal markdown
The extension pmd is for markdown with embedded php variables.

This is working on my localhost apache server.   pmd has to be added to 
apaxhe conf file.  AddType.

I can expand further if there s interest. It is an early stage experiment.
In fact the same principle can apply to yaml, svg, css, js.   (php types: 
pyaml, psvg, pcss, pjs)
I see that there is a php yaml package from Symfony.

-- 
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/902c5529-b3a3-441c-8108-1e1e74d58c93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-05-18 21:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16 23:02 Printing conditional parts - looking for suggestions Adam Wood
     [not found] ` <d79563cb-25d7-40e1-9d20-777eeaeb7189-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-17  4:10   ` John MacFarlane
     [not found]     ` <20160517041033.GE34153-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-05-17  9:11       ` BP Jonsson
     [not found]         ` <CAFC_yuQVdqUUVVWxFxXmjN1dsw=i+4O8r2yEJBDv7aKD5RB5_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-17 13:49           ` Simon Michael
2016-05-17 14:00             ` Simon Michael
2016-05-17 17:08               ` John MACFARLANE
     [not found]                 ` <20160517170804.GB6158-4kKid1p5UN5kRMcaKpzQXBvRwXAb8BAkh13vi7wywA4@public.gmane.org>
2016-05-18 12:19                   ` BP Jonsson
2016-05-18 17:04           ` Adam Wood
     [not found]             ` <17d1ffd2-b289-45e3-a5aa-885ad3b59e9f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-05-18 20:45               ` BP Jonsson
2016-05-17 14:24   ` John Muccigrosso
2016-05-18 21:45   ` D L

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).