hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
311 stars 60 forks source link

Feature suggestion: Option to include git hash in document #90

Open KGHustad opened 7 years ago

KGHustad commented 7 years ago

Description of idea

Since I always work on DocOnce documents inside a git repository, I had the idea of adding an option to include the short version of the git hash (e. g. 87b8b7f), so that this information can be included if an error is found in the document. The author will then be able to check with his git repository (which may very well be private) and determine if the error has already been corrected, which versions were affected, etc.

Implementation

This could be implemented by DocOnce capturing the output of the following command and embedding the hash somewhere in the document.

$ git rev-parse --short HEAD
87b8b7f

Aesthetical considerations

It seems logical to me to place the hash together with the date, but I don't that looks good. A more subtle placement would be in the footer.