Skip to content
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

Display Documenter version in document build info. #1609

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 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. ([#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])
Expand Down Expand Up @@ -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
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")
mortenpi marked this conversation as resolved.
Show resolved Hide resolved
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