public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'Saku Laesvuori' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: 'Jan Ulrich Hasecke' via pandoc-discuss
	<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Include Git Hash in PDF
Date: Thu, 20 Jan 2022 17:20:54 +0200	[thread overview]
Message-ID: <20220120152054.bl2xemvivq5zeeqc@X-kone.localdomain> (raw)
In-Reply-To: <98ea588d-45d4-1d50-5d30-c7d676728c23-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>

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

> I tried to evaluate "git rev-parse HEAD" in a build script and hand over the
> result to the build process by setting a custom variable to the hash string
> via --variable hash=${git rev-parse HEAD}. In my template I have $hash$

The syntax for including command output in a shell command line is
$(cmd), not ${cmd}. ${cmd} expands to the value of the shell variable
cmd instead of executing cmd. Your command line should thus look like

$ pandoc ... --variable "hash=$(git rev-parse HEAD)"


> I stored the hash in a file and tried to include it with -B, though this
> would not be a good solution if it worked at all.

Do you have $include-before$ somewhere in your template, if not then
pandoc doesn't know where to include the contents of the file.

      parent reply	other threads:[~2022-01-20 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 14:45 'Jan Ulrich Hasecke' via pandoc-discuss
     [not found] ` <98ea588d-45d4-1d50-5d30-c7d676728c23-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org>
2022-01-20 15:20   ` 'Saku Laesvuori' via pandoc-discuss [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=20220120152054.bl2xemvivq5zeeqc@X-kone.localdomain \
    --to=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).