[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: source block evaluation in #+DATE line
From: |
Andreas Leha |
Subject: |
Re: source block evaluation in #+DATE line |
Date: |
Wed, 11 May 2022 05:15:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Hi Kaushal and Jeremie,
Thanks for the comments. And sorry for the misleading example. I do not
want to use source blocks to insert a date. In fact I want to include
the current git commit hash on the title slide.
So, something like this:
src_sh[:exports results :results output wrap replace]{git describe --always
--dirty}
But that is not evaluated...
Any hint?
Thanks,
Andreas
Kaushal Modi <kaushal.modi@gmail.com> writes:
> Also check out the {{{time}}} macro if you want complete control on
> the formatting of the date string.
>
> Example Org snippet:
>
> =====
>
> #+date: {{{time(%Y-%m-%d)}}}
> #+options: toc:nil author:nil
>
>
> See the ~{{{time}}}~ macro in [[info:org#Macro Replacement][org#Macro
> Replacement]].
>
> The format passed to the ~time~ macro is same as that understood by
> [[help:format-time-string]].
>
> - Note :: Remember to escape the commas. \\
> Example: ~#+date: {{{time(%b %e %Y\, %a)}}}~.
>
> #+begin_src emacs-lisp
> (org-export-as 'ascii)
> #+end_src
>
> =====
Re: source block evaluation in #+DATE line, Timothy, 2022/05/11