* prevent pandoc from inserting vertical bars in metadata block? @ 2021-04-18 18:52 Nathan [not found] ` <9728d1f4-040e-4392-aa04-148f648a8dfdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Nathan @ 2021-04-18 18:52 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1363 bytes --] I'm using another application that outputs MultiMarkdown with a metadata block in the following format: Title: Blah blah blah Author: Doo de Doo Base Header Level: 1 Bibliography: Pubs.bib Lang: en-GB Converting this using pandoc -f markdown_mmd -t markdown --standalone we get a metadata block in the following format: --- author: | Doo de Doo baseheaderlevel: | 1 bibliography: | Pubs.bib lang: | en-GB title: | Blah blah blah --- Is there any way within pandoc to get rid of the vertical bar and newline in the metadata fields so that each metadata field is on a single line like in the input file? I know I can pipe the file to something like perl (which has been my workaround) but was wondering if there is a way to do it only with pandoc? (The vertical bar, or whatever it corresponds to in pandoc's AST, causes trouble in epub output by inserting an unwanted p element within title and author elements in the title page.) -- 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/9728d1f4-040e-4392-aa04-148f648a8dfdn%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1738 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <9728d1f4-040e-4392-aa04-148f648a8dfdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: prevent pandoc from inserting vertical bars in metadata block? [not found] ` <9728d1f4-040e-4392-aa04-148f648a8dfdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2021-04-19 5:02 ` John MacFarlane [not found] ` <m25z0ieuiq.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: John MacFarlane @ 2021-04-19 5:02 UTC (permalink / raw) To: Nathan, pandoc-discuss I just pushed a fix for this. In the mean time you could work around this by using a Lua filter that converts MetaBlocks elements to MetaInlines. Nathan <nathan.artist-s8PdfxpoPdHk1uMJSBkQmQ@public.gmane.org> writes: > I'm using another application that outputs MultiMarkdown with a metadata > block in the following format: > > Title: Blah blah blah > Author: Doo de Doo > Base Header Level: 1 > Bibliography: Pubs.bib > Lang: en-GB > > Converting this using pandoc -f markdown_mmd -t markdown --standalone we > get a metadata block in the following format: > > --- > author: | > Doo de Doo > baseheaderlevel: | > 1 > bibliography: | > Pubs.bib > lang: | > en-GB > title: | > Blah blah blah > --- > > Is there any way within pandoc to get rid of the vertical bar and newline > in the metadata fields so that each metadata field is on a single line like > in the input file? I know I can pipe the file to something like perl (which > has been my workaround) but was wondering if there is a way to do it only > with pandoc? (The vertical bar, or whatever it corresponds to in pandoc's > AST, causes trouble in epub output by inserting an unwanted p element > within title and author elements in the title page.) > > -- > 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/9728d1f4-040e-4392-aa04-148f648a8dfdn%40googlegroups.com. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <m25z0ieuiq.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>]
* Re: prevent pandoc from inserting vertical bars in metadata block? [not found] ` <m25z0ieuiq.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org> @ 2021-04-19 5:46 ` BPJ [not found] ` <CADAJKhB52GyVgab2CzJ_HYCvA+24pS5pvgf4DbvF2YKT-socew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: BPJ @ 2021-04-19 5:46 UTC (permalink / raw) To: pandoc-discuss; +Cc: Nathan [-- Attachment #1: Type: text/plain, Size: 2928 bytes --] Den mån 19 apr. 2021 07:03John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev: > > I just pushed a fix for this. > > In the mean time you could work around this by using > a Lua filter that converts MetaBlocks elements to MetaInlines. > Wouldn't one then have to check that the MetaBlock element contains only a Para or Plain element and unpack that element into the MetaInlines element? > > Nathan <nathan.artist-s8PdfxpoPdHk1uMJSBkQmQ@public.gmane.org> writes: > > > I'm using another application that outputs MultiMarkdown with a metadata > > block in the following format: > > > > Title: Blah blah blah > > Author: Doo de Doo > > Base Header Level: 1 > > Bibliography: Pubs.bib > > Lang: en-GB > > > > Converting this using pandoc -f markdown_mmd -t markdown --standalone we > > get a metadata block in the following format: > > > > --- > > author: | > > Doo de Doo > > baseheaderlevel: | > > 1 > > bibliography: | > > Pubs.bib > > lang: | > > en-GB > > title: | > > Blah blah blah > > --- > > > > Is there any way within pandoc to get rid of the vertical bar and > newline > > in the metadata fields so that each metadata field is on a single line > like > > in the input file? I know I can pipe the file to something like perl > (which > > has been my workaround) but was wondering if there is a way to do it > only > > with pandoc? (The vertical bar, or whatever it corresponds to in > pandoc's > > AST, causes trouble in epub output by inserting an unwanted p element > > within title and author elements in the title page.) > > > > -- > > 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/9728d1f4-040e-4392-aa04-148f648a8dfdn%40googlegroups.com > . > > -- > 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/m25z0ieuiq.fsf%40MacBook-Pro.hsd1.ca.comcast.net > . > -- 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/CADAJKhB52GyVgab2CzJ_HYCvA%2B24pS5pvgf4DbvF2YKT-socew%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 4614 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CADAJKhB52GyVgab2CzJ_HYCvA+24pS5pvgf4DbvF2YKT-socew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: prevent pandoc from inserting vertical bars in metadata block? [not found] ` <CADAJKhB52GyVgab2CzJ_HYCvA+24pS5pvgf4DbvF2YKT-socew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2021-04-19 20:01 ` John MacFarlane 0 siblings, 0 replies; 4+ messages in thread From: John MacFarlane @ 2021-04-19 20:01 UTC (permalink / raw) To: BPJ, pandoc-discuss; +Cc: Nathan BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org> writes: > Den mån 19 apr. 2021 07:03John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev: > >> >> I just pushed a fix for this. >> >> In the mean time you could work around this by using >> a Lua filter that converts MetaBlocks elements to MetaInlines. >> > > Wouldn't one then have to check that the MetaBlock element contains only a > Para or Plain element and unpack that element into the MetaInlines element? I didn't go into the details, but yes, exactly. -- 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/m2tuo2cacf.fsf%40MacBook-Pro.hsd1.ca.comcast.net. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-19 20:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-04-18 18:52 prevent pandoc from inserting vertical bars in metadata block? Nathan [not found] ` <9728d1f4-040e-4392-aa04-148f648a8dfdn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-04-19 5:02 ` John MacFarlane [not found] ` <m25z0ieuiq.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org> 2021-04-19 5:46 ` BPJ [not found] ` <CADAJKhB52GyVgab2CzJ_HYCvA+24pS5pvgf4DbvF2YKT-socew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-04-19 20:01 ` John MacFarlane
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).