Closed bhougland18 closed 3 years ago
What also would fix the problem, would be an option for the user to expose custom environment variables to the document. So essentially a more extensive variable support.
This is not the right repository to report issues for the software. This is the website repository.
Even then, Asciidoctor doesn't know anything about git. You could make a preprocessor extension that adds the attribute to the document by reading from the local environment. In fact, you will find a similar extension in the lab. https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/95
All also mention that if you use Antora, then information about the git reference is injected into the document via attributes. See https://gitlab.com/antora/antora/-/issues/578
I would like a new environmental variable created that get the project's current Git commit hash. This would provide the author with the exact version of a document, which would be beneficial once it is printed to a pdf or to paper. This could work in conjunction with the Asciidoctor barcode extension so this information to be easily scannable.
To get the full SHA:
To get the shortened version: