-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
docgen: replace doc generation timestamp with version number #15708
Comments
please.
too restrictive, a commit hash should be acceptable too ideally it'd be:
and it would display on top (or bottom). This should work for all packages, not just with -d:boot inferring the git hash or release tag we're at is easy, and nim sources already do that. see also this thread kaushalmodi/std_vector#6 (comment) |
I meant "version number" to be a free-form string so that it can contain, for example, a version number, version number + commitish, just the commitish, commitish and branch name... and independent from the VCS in use. |
you can start with just getting the commit hash and we can more later; By default |
const NimblePkgVersion* {.strdefine.} = "" Should give you the project version number from the nimble file, this is nimble magic. |
that will be out of date unless no commits were added after last release bump, but we can use both hash + NimblePkgVersion; but note that we can already get latest git tag from git cmdline. This seems the best: |
As long as I don't have to use Nimble to invoke the compiler to generate my documentation, I'm happy. |
Ok, accepted. |
nim doc inserts a footer in documentation pages e.g. "Made with Nim. Generated: 2020-10-16 08:08:14 UTC "
I suggest replacing it with the (optional) version number for the project the documentation belongs to. The version can be specified as a string using a command line argument.
If nothing is passed, nim doc could adds only "Made with Nim."
This solves 2 problems:
The documentation can be generate before / during / after a project is released. For users reading the documentation it is difficult to connect the timestamp with the project version or it can be misleading.
The timestamp makes the build non-reproducible, leading to different artifacts (e.g. tarballs) for the same commit/release, and frequent commits when the documentation is stored in git. See Use SOURCE_DATE_EPOCH instead of current time in docgen #3113
(I'd be happy to send a PR)
The text was updated successfully, but these errors were encountered: