public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: "R (Chandra) Chandrasekhar"
	<chyavana-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Is there a YAML metadata option for `--shift-heading-level-by` on the command line?
Date: Tue, 07 Jun 2022 06:58:28 -0700	[thread overview]
Message-ID: <m2v8tcfud7.fsf@johnmacfarlane.net> (raw)
In-Reply-To: <884ca060-dab6-8730-fe09-a46d66238883-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

"R (Chandra) Chandrasekhar" <chyavana-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> So far, I have succeeded in getting the desired numbering by:
>
> 1. Adding
>
> shift-heading-level-by: -1
>
> after the line specifying the reader in my defaults file.
>
> 2. Adding
>
> numbersections: true

This works, because of the way it is implemented for your
output format, but this is not the documented way to set
this option, and it won't work for all output formats.  Instead, use

number-sections: true

in your defaults files.

> However, if I move the line
>
> shift-heading-level-by: -1
>
> from the defaults file to the YAML metadata block in my source file, the 
> numbering starts at 0.1 rather than 1 for the first level-2 heading.

You can't, in general, set command line options from YAML
metadata.  Options are one thing, metadata is another.
Defaults files are where you set options.

> Finally, I have found that there are three ways to turn numbering on or off:
>
> (a) to turn section numbering on in the
>
> command line, I need to use
>
> `--number-sections`
>
> (b) to turn it on in the defaults file I need to specify
>
> `number-sections: true`
>
> (c) but to turn it on in the YAML metadata block, I need to specify
>
> `numbersections: true` without an intervening hyphen.
>
> Is this deliberate or an artefact of history?

The last method works because of an implementation detail,
but this is not a documented or supported way of doing it.


      parent reply	other threads:[~2022-06-07 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 17:58 R (Chandra) Chandrasekhar
     [not found] ` <c8075c7b-cddd-10ba-f2da-32089bfd62ae-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-06-07  8:01   ` R (Chandra) Chandrasekhar
     [not found]     ` <884ca060-dab6-8730-fe09-a46d66238883-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-06-07 13:58       ` John MacFarlane [this message]

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=m2v8tcfud7.fsf@johnmacfarlane.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=chyavana-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).