Hello,
I like to have the version number of the package included in the documentation, so that you can immediately tell if you’re reading the right version of the documentation. To do this, I’ve put the following near the top of my docs/src/index.md
(not checked in to github yet):
```@eval
using Markdown
using Pkg
m = Pkg.Operations.Context().env.manifest
v = string(m[findfirst(v->v.name == "MultiGridBarrier", m)].version)
md"# MultiGridBarrier $v"
```
A couple of questions.
- Is this really the right way to get the version number? If I had something like
Pkg.getversion(MultiGridBarrier)
, I would be slightly more confident that it got the right package, as opposed to my hand-codedfindfirst
search. Also, is this part of thePkg
API really public? - The
Documenter
documentation says that@eval
is a sin in the eyes of the lord and that I should feel guilty for using it. Is this so?
Thanks,
S