Hi John,

thanks, this should solve the --number-offset problem. Hence, I could close this thread, if I would know how :)

Nevertheless, now I am getting hooked on writing my own custom writer, or at least to understand how it would work. This brings me back to my questions in my previous post in this thread. Can I find some more documentation, should I open another thread for these questions or how should I procceed?

Thanks again in advance!
Karl

John MacFarlane schrieb am Montag, 28. September 2020 um 21:02:48 UTC+2:

I wouldn't use a custom writer for this.

An easier approach would be to use a wrapper shell script.
The script would peek into the markdown file, find the
setting for --number-offset, and call pandoc with the
same arguments as the shell script PLUS the relevant
--number-offset.


"'Karl Weber' via pandoc-discuss"
<pandoc-...@googlegroups.com> writes:

> Hi John,
>
> thank you for your answer. I would think it should be possible to do that
> with my own custom writer (in Lua). Is that right?
>
> If so, how much work would it be? My starting point would be the sample.lua
> obtained though the command
>
> pandoc --print-default-data-file sampla.lua
>
> Is there an easier way to do this? How close is this sample.lua to what
> pandoc is doing for output format html5? I.e. how much would I have to add
> to sample.lua? Is it only my desired functionality or are there more
> differences? (I am using, for instance, --toc and --sections-div, which
> does not seem to be part of the sample.lua...) I did't find
> template-processing as well, but I am just starting to learn how to build
> my own custom writer...
>
> Im am using pandoc 2.10.1
>
> This solution (if feasible) would have the advantage, that I could add more
> functionality I am currently missing (there may indeed be one or two
> things), but it would also have the disadvantage, that I would have to
> adapt my own custom writer, whenever pandoc evolves. However, this should
> only be necessary if the datamodel of pandoc is changing, or isn't it? I am
> still undecided.
>
> Thanks in advance
> Karl
>
> John MacFarlane schrieb am Montag, 28. September 2020 um 01:02:41 UTC+2:
>
>>
>> No, you can't specify it in YAML metadata.
>>
>> "'Karl Weber' via pandoc-discuss"
>> <pandoc-...@googlegroups.com> writes:
>>
>> > Hi,
>> >
>> > I do want to specify number-offset neither on the commandline of pandoc
>> nor
>> > in the defaults yaml file. The reason is, that I have a project
>> consisting
>> > of a number of documents in markdown format, that I want to convert to
>> > html5 using make. Hence I need to specify number-offset for each file
>> > individually.
>> >
>> > Is there some way to do this?
>> >
>> > I tried to specify it in a yaml block at the beginning of each file,
>> > something like the following:
>> >
>> > ---
>> > output:
>> > html_document:
>> > pandoc_args: [
>> > "--number-offset=4,0"
>> > ]
>> > ---
>> >
>> > I tried different variations of this example, but none worked. Note,
>> that
>> > my input format ist pandoc markdown.
>> >
>> > It would be great, if something like that would work. I would appreciate
>> > any help.
>> >
>> > Thanks in advance,
>> > Karl
>> >
>> >
>> > --
>> > 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.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/200b15bc-f323-487e-b39d-e6be8845eacan%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-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1c0310ae-6348-4ba6-8d9d-746aab5e0c09n%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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c8b8ecf4-1f85-497d-ad85-aedeb96a4f2an%40googlegroups.com.