From: iandol <iandol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Defaults Files and header-includes
Date: Tue, 10 Oct 2023 19:24:38 -0700 (PDT) [thread overview]
Message-ID: <d355fe31-9bd9-4590-bb30-4d9ea07468can@googlegroups.com> (raw)
In-Reply-To: <6FE0832A-2D38-447D-8044-CDAC6991A55F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4159 bytes --]
Thanks as always John, see https://github.com/jgm/pandoc/issues/9128
Best, Ian
On Wednesday, 11 October 2023 at 01:06:42 UTC+8 John MacFarlane wrote:
> Hm, this is maybe something that could be improved, if you want to put up
> a bug report.
>
> > On Oct 10, 2023, at 8:58 AM, iandol <ian...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > OK, I realised the YAML needs a trailing newline after the string
> scalar, this works fine:
> >
> > header-includes: |
> > ```{=typst}
> > #set heading(numbering: "I.")
> > #set text(font: "Alegreya Sans", size: 14pt, discretionary-ligatures:
> true, number-type: "old-style")
> > ```
> >
> >
> > ...note the trailing blank line...
> >
> > On Tuesday, 10 October 2023 at 23:50:47 UTC+8 iandol wrote:
> > So reading the docs on --metadata-file I assumed I could use this
> instead, so I make a new yaml file saved to the data dir metadata folder
> and call it from the defaults file. In the metadata.yaml file I put:
> >
> > header-includes: |
> > `#set heading(numbering: "(I)")`{=typst}
> >
> > and this gives me #set heading(numbering: "(I)") -- good, pandoc parsed
> the markdown and didn't escape the # .However I then tried a block:
> >
> > header-includes: |
> > ```{=typst}
> > #set heading(numbering: "(I)")
> > ```
> >
> >
> > And the output is `{=typst} #set heading(numbering: "(I)")` — hm not so
> clear why the block generates this unesscaped but transformed markdown?
> >
> > Ian
> > On Tuesday, 10 October 2023 at 20:44:41 UTC+8 iandol wrote:
> > Thanks John, so there is no way to stop the escaping as even if I remove
> the raw attribute, the # of the typst set command also gets escaped
> stopping it from working...?
> >
> > Best, Ian
> >
> > On Tuesday, 10 October 2023 at 12:03:44 UTC+8 John MacFarlane wrote:
> > metadata in a defaults file is parsed as plain text not markdown
> (remember, default files are basically equivalent to specifying something
> on the command line, and this is how --metadata behaves). So the raw
> attribute won't be recognized.
> >
> >
> > > On Oct 9, 2023, at 6:06 PM, iandol <ian...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > >
> > > I want to use header-includes: in a defaults file, so assuming it is
> metadata (i.e. converted to variables for the template) do this in my
> typst.yaml defaults file:
> > >
> > > metadata:
> > > header-includes: |
> > > ```{=typst}
> > > #set heading(numbering: "(I)")
> > > ```
> > > mainfont: "Alegreya Sans"
> > >
> > > But the output is escaped. The same header-includes text works when
> added to the document metadata header directly. I'm probably doing
> something stupid but didn't yet grok what that is... Any help appreciated!
> > >
> > > Best, Ian
> > >
> > > --
> > > 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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/cd6c5731-19c7-4189-9b45-ab783decfdb4n%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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/2e8f4aa6-79e4-4bf0-808a-764da284133dn%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/d355fe31-9bd9-4590-bb30-4d9ea07468can%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 6074 bytes --]
prev parent reply other threads:[~2023-10-11 2:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 1:06 iandol
[not found] ` <cd6c5731-19c7-4189-9b45-ab783decfdb4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-10-10 4:03 ` John MacFarlane
[not found] ` <BE9346D3-73A6-47AD-8EEB-BC94E6EA601D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-10-10 12:44 ` iandol
[not found] ` <8f5ccade-4695-4bc4-a61d-e7c9cf24db50n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-10-10 15:50 ` iandol
[not found] ` <69a8684d-d7db-421f-9a8c-3454ca012511n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-10-10 15:58 ` iandol
[not found] ` <2e8f4aa6-79e4-4bf0-808a-764da284133dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-10-10 17:06 ` John MacFarlane
[not found] ` <6FE0832A-2D38-447D-8044-CDAC6991A55F-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-10-11 2:24 ` iandol [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=d355fe31-9bd9-4590-bb30-4d9ea07468can@googlegroups.com \
--to=iandol-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).