-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\today
in date metadata
#2865
Comments
@ickc: Can't you confirm (or disprove) that it breaks by just constructing a minimal Markdown file and include your YAML, and then let Pandoc create an EPUB (and all the other output formats you're interested in)? (My bet is on the side that "This is not working for other output formats".) |
It will only work in LaTeX/PDF. Your best bet is to set the date on the command line,
on linux/unix. +++ ickc [Apr 20 16 02:27 ]:
|
Good idea. May be it can be put in the documentation as a trick worth nothing? I am used to MultiMarkdown that if I don't specify a date, it will auto added today there. That's why I have such question. Thanks and I'm closing it now. |
Just to document it: to replicated the -M date="`date "+%B%e, %Y"`" should be used with pandoc. |
Correction: -M date="`date "+%B %e, %Y"`" Do you mind if I add this in the MANUAL as an example? |
I'd rather not have it in the manual, since it's unix specific. |
Why don't we put in the MANUAL something that is NOT unix specific? First off, it is not unix specific, but rather POSIX specific, including much more than unix. Then we can also write down what works for Windows users. I assume POSIX+Windows covers 99.99% of the users of pandoc. |
Interesting statement: would pandoc even work if it's not "POSIX+Windows"? I think what @jgm means is this is not something pandoc "officially" covered. e.g. nothing within pandoc really can help you to create today in date. So what that did is "a hack" that's outside the scope of pandoc. I guess the manual is already very long, so he don't want to add more unnecessary stuffs there. Some tricks like this is added in Pandoc Tricks · jgm/pandoc Wiki. Perhaps I should put this there as well. |
FWIW: lua filters will allow to set the date like this in a fully portable manner: function Meta(m)
m.date = os.date("%B %e, %Y")
return m
end Note to self: Might be a good example to add to the docs. |
To set the date in YYYY-MM-DD UTC ISO standard format, this syntax works on macOS for me:
|
I found that if I do this in the YAML metadata:
In latex output it will leaves it as is, so latex will then be able to substitute today there. But I'm not sure if it will break anything in other output formats. e.g. ePub.
Can someone confirm if this is good or not? And if not, what's the way to let pandoc set date to the date of compilation automatically?
Thanks!
The text was updated successfully, but these errors were encountered: