From 172dfa3cc7f0243cac203371872f59235c8b51c2 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 21 Jun 2021 18:58:01 +0200 Subject: [PATCH] Display Documenter version in document build info. --- CHANGELOG.md | 5 +++++ src/Writers/HTMLWriter.jl | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd66ee349..becd54487c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Documenter.jl changelog +## Version `v0.27.3` + +* ![Enhancement][badge-enhancement] The version of Documenter used for generating a document is now displayed in the build information. ([#1609][github-1609]) + ## Version `v0.27.2` * ![Enhancement][badge-enhancement] The default font has been changed to `Lato Medium` so that the look of the text would be closer to the old Google Fonts version of Lato. ([#1602][github-1602], [#1604][github-1604]) @@ -829,6 +833,7 @@ [github-1596]: https://github.com/JuliaDocs/Documenter.jl/pull/1596 [github-1602]: https://github.com/JuliaDocs/Documenter.jl/issues/1602 [github-1604]: https://github.com/JuliaDocs/Documenter.jl/pull/1604 +[github-1609]: https://github.com/JuliaDocs/Documenter.jl/pull/1609 [julia-38079]: https://github.com/JuliaLang/julia/issues/38079 [julia-39841]: https://github.com/JuliaLang/julia/pull/39841 diff --git a/src/Writers/HTMLWriter.jl b/src/Writers/HTMLWriter.jl index 60bf94c8a6..1aac5b5a09 100644 --- a/src/Writers/HTMLWriter.jl +++ b/src/Writers/HTMLWriter.jl @@ -796,6 +796,13 @@ function render_html(ctx, navnode, head, sidebar, navbar, article, footer, scrip ) end +function documenter_version() + project = joinpath(dirname(dirname(pathof(Documenter))), "Project.toml") + toml = read(project, String) + m = match(r"^version\s*=\s\"(.*)\"$"m, toml) + return VersionNumber(m[1]) +end + """ Renders the modal settings dialog. """ @@ -813,6 +820,7 @@ function render_settings(ctx) buildinfo = p( "This document was generated with ", a[:href => "https://github.com/JuliaDocs/Documenter.jl"]("Documenter.jl"), + " version $(documenter_version())", " on ", span[".colophon-date", :title => now_full](now_short), ". ",