public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Discussion needed—How should pandoc handle when meatada in YAML collide with command line option
@ 2016-10-29  3:18 Kolen Cheung
       [not found] ` <836ca2d4-6e39-4f7e-b227-69dc06be6f15-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Kolen Cheung @ 2016-10-29  3:18 UTC (permalink / raw)
  To: pandoc-discuss


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



This originally started from issue #3138 
<https://github.com/jgm/pandoc/issues/3138#issuecomment-253699552>. It 
concerns how pandoc should handle the case when YAML metadata collides with 
the command line options.
<#>An Example 

The example here concerns --include-in-header= in command line and 
header-include in YAML, but the issue itself is more general, e.g. 
--include-after-body=, etc.

From the manual (emphasis is mine):

-H *FILE*, --include-in-header=*FILE*

: Include contents of *FILE*, verbatim, at the end of the header. This can 
be used, for example, to include special CSS or javascript in HTML 
documents. This option *can be used repeatedly* to include multiple files 
in the header. They will be included in the order specified. Implies 
--standalone.

<#>Current behavior 

Whenever command line option is specified, it will override the YAML 
metadata defined. Example used in the issue is:

Command line: pandoc ... -H <file> ..., and in the md file’s yaml:

header-includes:
    - \usepackage{siunitx}

\usepackage{siunitx} will be ignored.
<#>“Expected” Behavior 

Since the manual said, “This option can be used repeatedly”, it seems 
natural to assume the same metadata can be defined through both the YAML 
and command line.

However, it can be imagined people might use command line option to 
override the YAML option. I agree the command line option should have 
priority: on option that cannot be repeated, command line option should 
override. But when an option is repeatable, priority could means command 
line metadata comes first and YAML comes second, not necessarily means 
ignoring the later.
<#>Related Discussion: Should Templates Be Recursively Resolved Into? 

This is the original purpose of issue #3138 
<https://github.com/jgm/pandoc/issues/3138#issuecomment-253699552>: should 
templates be recursively resolved into? An example is, if I wrote a 
template snippet, currently -H/--include-in-header=*SNIPPET* would not 
resolve it as a template but include it as is. (There’s a work around 
mentioned in Pandoc Tricks · jgm/pandoc Wiki 
<https://github.com/jgm/pandoc/wiki/Pandoc-Tricks>.)
​

-- 
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/836ca2d4-6e39-4f7e-b227-69dc06be6f15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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

end of thread, other threads:[~2018-02-01  7:17 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-29  3:18 Discussion needed—How should pandoc handle when meatada in YAML collide with command line option Kolen Cheung
     [not found] ` <836ca2d4-6e39-4f7e-b227-69dc06be6f15-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-10-29 17:24   ` BP Jonsson
     [not found]     ` <CAFC_yuQZfyYuP6LzVtv02pVkr92Vx6zATosAdXbm+BCbxeTMMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-31  4:13       ` Kolen Cheung
     [not found]         ` <bd8aea27-38c3-4ace-af2e-6603a64fb977-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-10-31 18:14           ` Melroch
2016-12-01 11:55   ` Kolen Cheung
     [not found]     ` <CADAJKhBWjp7-7-JCrqZXnkaOw8xRtDDv-tCUos29=T1JOTOWkg@mail.gmail.com>
     [not found]       ` <CADAJKhA7miFDtn5dOxtFw5VF7TwQMDiXs=8pnrKoOUuVhjoRgQ@mail.gmail.com>
     [not found]         ` <CADAJKhA7miFDtn5dOxtFw5VF7TwQMDiXs=8pnrKoOUuVhjoRgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-02 15:36           ` Melroch
     [not found]             ` <CADAJKhCfDzDaQYSn=iNzM0XXEpisontg=LxrOadmHD6_6aNriw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-02 22:42               ` BP Jonsson
2016-12-03  0:28               ` Kolen Cheung
     [not found]                 ` <089593aa-75c3-42fb-9b94-1cf0c01643cd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-03  0:38                   ` Melroch
     [not found]                     ` <CADAJKhCkSC80BR8NDbFKArmRR=80DxxRXQYeEVcBVhiCgxWgYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-03  1:21                       ` Kolen Cheung
     [not found]                         ` <f57e9537-1701-4e48-8d1f-c3d9c43af24f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-12-04 22:32                           ` Melroch
     [not found]                             ` <CADAJKhDHskio7KYbEo0yXMvLQL+WYYWyh_gO3HNqwCTVRTJB8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-05  1:13                               ` Kolen Cheung
     [not found]                                 ` <8d8167cf-894c-4dd4-8b1b-1fe8b49b3258-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-17 17:54                                   ` mb21
     [not found]                                     ` <aed26351-9296-42f2-9711-94f029fb8b0d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-17 18:24                                       ` Kolen Cheung
     [not found]                                         ` <7bcf5965-a2fa-41d5-817e-bc27aeba7c7d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-18 11:03                                           ` John MacFarlane
2017-01-18 11:25                                           ` John MacFarlane
     [not found]                                             ` <20170118112524.GB44054-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2017-01-23 10:13                                               ` mb21
     [not found]                                                 ` <679bf64d-3de1-48e3-b738-0e9059c69a98-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-23 10:23                                                   ` John MacFarlane
     [not found]                                                     ` <20170123102338.GL1889-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2017-01-23 10:38                                                       ` mb21
     [not found]                                                         ` <5038f42b-77c9-4e63-a1ed-fbea1342828c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-23 10:50                                                           ` Kolen Cheung
2017-01-17 18:47                                       ` Albert Krewinkel
2017-01-18 11:23                                       ` John MacFarlane
2018-02-01  7:17                           ` tolot27

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