Skip to content

Commit

Permalink
Display Documenter version in document build info.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jun 21, 2021
1 parent a6f21b9 commit 4084050
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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. ([#1602][github-1602])

## 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])
Expand Down
8 changes: 8 additions & 0 deletions src/Writers/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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),
". ",
Expand Down

0 comments on commit 4084050

Please sign in to comment.