public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
@ 2019-09-28 17:10 Emmanuel Charpentier
       [not found] ` <5ddf18fd-b35f-4bf2-99d0-03ca657adb28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Emmanuel Charpentier @ 2019-09-28 17:10 UTC (permalink / raw)
  To: pandoc-discuss


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

Pandoc has many options and extensions that can be specified at the command 
line. Similarly, template and (some) template variables can be specified at 
pandoc call.

However, this implies that the result of a the compilation by pandoc of a 
given file is highly dependent of these options.

For various input file formats, a workaround is to put somewhere in your 
source file a comment specifying the command-line options necessary to 
successfilly compile it.

I wondered what part of the options, extensions and template variables can 
be specified in the YAML header of a Markdown file, thus ensuring that the 
"right" set of options is used at compilation. However, I have been unable 
to find a description of what can be specified at command line.

Has anybody done this work ? If so, is it available somewhere ?

-- 
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/5ddf18fd-b35f-4bf2-99d0-03ca657adb28%40googlegroups.com.

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

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

* Re: Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
       [not found] ` <5ddf18fd-b35f-4bf2-99d0-03ca657adb28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-09-28 18:14   ` John MacFarlane
       [not found]     ` <m2o8z4z3sr.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: John MacFarlane @ 2019-09-28 18:14 UTC (permalink / raw)
  To: Emmanuel Charpentier, pandoc-discuss

Emmanuel Charpentier <emanuel.charpentier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I wondered what part of the options, extensions and template variables can 
> be specified in the YAML header of a Markdown file, thus ensuring that the 
> "right" set of options is used at compilation. However, I have been unable 
> to find a description of what can be specified at command line.

It wouldn't make sense to put formats  and extensions in the YAML
header: after all, whether a document can even HAVE a YAML header
is dependent on extensions.  What would you do if the YAML header
said to disable the yaml_metadata extension?  You'd have a
paradoxical document!

All template variables can be set via YAML metadata, because the
writers populate variables from metadata values.

Command-line options can never be set via YAML metadata, in general,
though in some cases it may seem as if they can.  For example,
you can specify `toc: true`; but this only works in formats where
the only thing the `--toc` option has to do is set a `toc`
template variable.

Rather than adding a comment to the source with installation
instructions, I usually use a simple Makefile:

output.html: input.md
             pandoc $< -o $@ --my-options-here...

This way, I don't have to remember what options to use.
I just type 'make' and it's done.


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

* Re: Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
       [not found]     ` <m2o8z4z3sr.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2019-09-28 18:38       ` Emmanuel Charpentier
       [not found]         ` <5e3c4113-1162-41fc-b348-8403976b93cb-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2019-09-29  6:23       ` Axel Kielhorn
  1 sibling, 1 reply; 6+ messages in thread
From: Emmanuel Charpentier @ 2019-09-28 18:38 UTC (permalink / raw)
  To: pandoc-discuss


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

That's what I was afraid of... No way to have the document self-consistent. 
(BTW: A YAML option turning YAML off could result in an error message, 
documenting the problem...).

Thanks anyway ; a quick and precise answer.

Back to the ol' drawing board...

--
Emmanuel Charpentier

Le samedi 28 septembre 2019 20:14:43 UTC+2, John MacFarlane a écrit :
>
> Emmanuel Charpentier <emanuel.c...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > I wondered what part of the options, extensions and template variables 
> can 
> > be specified in the YAML header of a Markdown file, thus ensuring that 
> the 
> > "right" set of options is used at compilation. However, I have been 
> unable 
> > to find a description of what can be specified at command line. 
>
> It wouldn't make sense to put formats  and extensions in the YAML 
> header: after all, whether a document can even HAVE a YAML header 
> is dependent on extensions.  What would you do if the YAML header 
> said to disable the yaml_metadata extension?  You'd have a 
> paradoxical document! 
>
> All template variables can be set via YAML metadata, because the 
> writers populate variables from metadata values. 
>
> Command-line options can never be set via YAML metadata, in general, 
> though in some cases it may seem as if they can.  For example, 
> you can specify `toc: true`; but this only works in formats where 
> the only thing the `--toc` option has to do is set a `toc` 
> template variable. 
>
> Rather than adding a comment to the source with installation 
> instructions, I usually use a simple Makefile: 
>
> output.html: input.md 
>              pandoc $< -o $@ --my-options-here... 
>
> This way, I don't have to remember what options to use. 
> I just type 'make' and it's done. 
>
>

-- 
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/5e3c4113-1162-41fc-b348-8403976b93cb%40googlegroups.com.

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

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

* Re: Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
       [not found]     ` <m2o8z4z3sr.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  2019-09-28 18:38       ` Emmanuel Charpentier
@ 2019-09-29  6:23       ` Axel Kielhorn
       [not found]         ` <F829EA44-5A95-404B-9B05-76FE9ADE965B-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Axel Kielhorn @ 2019-09-29  6:23 UTC (permalink / raw)
  To: Pandoc discuss discuss


> Am 28.09.2019 um 20:14 schrieb John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
> 
> Command-line options can never be set via YAML metadata, in general,
> though in some cases it may seem as if they can.  For example,
> you can specify `toc: true`; but this only works in formats where
> the only thing the `--toc` option has to do is set a `toc`
> template variable.
> 
> Rather than adding a comment to the source with installation
> instructions, I usually use a simple Makefile:
> 
> output.html: input.md
>             pandoc $< -o $@ --my-options-here…

On systems where I don’t have `make` I keep a separate file with the command lines.
Yes, plural, since I usually create HTML for a quick overview and something else for the final version.

Greetings form a Unix guy in Windows land.
Axel

-- 
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/F829EA44-5A95-404B-9B05-76FE9ADE965B%40gmail.com.


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

* Re: Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
       [not found]         ` <F829EA44-5A95-404B-9B05-76FE9ADE965B-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-09-29 18:17           ` BPJ
  0 siblings, 0 replies; 6+ messages in thread
From: BPJ @ 2019-09-29 18:17 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Windows isn't necessarily a system without `make`:

http://gnuwin32.sourceforge.net/packages/make.htm

It's a very long time since I had to use it though, so I don't know how
well it works these days.

Den sön 29 sep. 2019 08:24Axel Kielhorn <a.kielhorn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

>
> > Am 28.09.2019 um 20:14 schrieb John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:
> >
> > Command-line options can never be set via YAML metadata, in general,
> > though in some cases it may seem as if they can.  For example,
> > you can specify `toc: true`; but this only works in formats where
> > the only thing the `--toc` option has to do is set a `toc`
> > template variable.
> >
> > Rather than adding a comment to the source with installation
> > instructions, I usually use a simple Makefile:
> >
> > output.html: input.md
> >             pandoc $< -o $@ --my-options-here…
>
> On systems where I don’t have `make` I keep a separate file with the
> command lines.
> Yes, plural, since I usually create HTML for a quick overview and
> something else for the final version.
>
> Greetings form a Unix guy in Windows land.
> Axel
>
> --
> 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/F829EA44-5A95-404B-9B05-76FE9ADE965B%40gmail.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/CADAJKhBwpB_RY%2B6Jt6dTidJ6xTJ4_ypaN9gFC1BeAx3L3tHpvA%40mail.gmail.com.

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

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

* Re: Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ?
       [not found]         ` <5e3c4113-1162-41fc-b348-8403976b93cb-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-09-29 19:41           ` John MacFarlane
  0 siblings, 0 replies; 6+ messages in thread
From: John MacFarlane @ 2019-09-29 19:41 UTC (permalink / raw)
  To: Emmanuel Charpentier, pandoc-discuss


See also https://github.com/jgm/pandoc/issues/4627
which lists several third-party wrappers that do what you want.

Emmanuel Charpentier <emanuel.charpentier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> That's what I was afraid of... No way to have the document self-consistent. 
> (BTW: A YAML option turning YAML off could result in an error message, 
> documenting the problem...).
>
> Thanks anyway ; a quick and precise answer.
>
> Back to the ol' drawing board...
>
> --
> Emmanuel Charpentier
>
> Le samedi 28 septembre 2019 20:14:43 UTC+2, John MacFarlane a écrit :
>>
>> Emmanuel Charpentier <emanuel.c...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>>
>> > I wondered what part of the options, extensions and template variables 
>> can 
>> > be specified in the YAML header of a Markdown file, thus ensuring that 
>> the 
>> > "right" set of options is used at compilation. However, I have been 
>> unable 
>> > to find a description of what can be specified at command line. 
>>
>> It wouldn't make sense to put formats  and extensions in the YAML 
>> header: after all, whether a document can even HAVE a YAML header 
>> is dependent on extensions.  What would you do if the YAML header 
>> said to disable the yaml_metadata extension?  You'd have a 
>> paradoxical document! 
>>
>> All template variables can be set via YAML metadata, because the 
>> writers populate variables from metadata values. 
>>
>> Command-line options can never be set via YAML metadata, in general, 
>> though in some cases it may seem as if they can.  For example, 
>> you can specify `toc: true`; but this only works in formats where 
>> the only thing the `--toc` option has to do is set a `toc` 
>> template variable. 
>>
>> Rather than adding a comment to the source with installation 
>> instructions, I usually use a simple Makefile: 
>>
>> output.html: input.md 
>>              pandoc $< -o $@ --my-options-here... 
>>
>> This way, I don't have to remember what options to use. 
>> I just type 'make' and it's done. 
>>
>>
>
> -- 
> 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/5e3c4113-1162-41fc-b348-8403976b93cb%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/m2d0fizy86.fsf%40johnmacfarlane.net.


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

end of thread, other threads:[~2019-09-29 19:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-28 17:10 Options, extensions, variables : what can be specified in the YAML header of a Markdown file and what has to be on the command line ? Emmanuel Charpentier
     [not found] ` <5ddf18fd-b35f-4bf2-99d0-03ca657adb28-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-09-28 18:14   ` John MacFarlane
     [not found]     ` <m2o8z4z3sr.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-09-28 18:38       ` Emmanuel Charpentier
     [not found]         ` <5e3c4113-1162-41fc-b348-8403976b93cb-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-09-29 19:41           ` John MacFarlane
2019-09-29  6:23       ` Axel Kielhorn
     [not found]         ` <F829EA44-5A95-404B-9B05-76FE9ADE965B-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-09-29 18:17           ` BPJ

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