-
Notifications
You must be signed in to change notification settings - Fork 482
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
The version
argument for makedocs
#2385
Comments
It looks to me like the intent of Documenter.jl/src/html/HTMLWriter.jl Lines 1133 to 1137 in d9865b4
is to actively select the version from the version menu. In that case, the line
is definitely a bug because of how it interacts with the js later on. I'm also not sure the rest of the code makes much sense. Assuming |
Oh, it turns out
This description seems obsolete, and not what is actually happening (like, the version selector being hidden by default). Incidentally, P.S.: I'd even like the |
Sorry for the delay here!
I think the bug here is actually in the JS.. the intent of Documenter.jl/assets/html/js/versions.js Lines 61 to 64 in d9865b4
is to make the version selector visible, but it doesn't take into account that the element might already be visible. We should use But the bigger question is indeed whether we want Documenter.jl/assets/html/js/versions.js Lines 25 to 36 in d9865b4
So my current feeling is that we should just fully deprecate For automated tooling, it might be better to post-process |
That sounds right, although I'm still confused about what this would be used for. Is it to force showing a version selection menu when building locally? Wouldn't it conflict with the general logic of what the selector shows? What would happen if I set
So I guess what you're telling me is that setting
Yes, I agree. At least in its current form. |
No, I don't think so. For one, the inventory should be be completely determined in Actually, I think this goes to an important point: The current
I would consider the "version" that I would need for the inventory to be conceptually different from anything to do with the versions-selection-menu. It is much more like the separate One detail is that the Sphinx inventory specification specifies that the "version" should not have a "v" prefix. But beyond that, the "version" field can really be used in any way that is most helpful to the user. I'd consider appending a git hash if available, for Oh, and just to expand a little for what the So maybe the best thing to do would be to add a
I think these serve different purposes, one for setting up the versions-selection-menu, and one as metadata to be shown somewhere in the rendered output (which includes the inventory), for human consumption. In For the
into their
So at this point, I would propose the following:
Maybe in the future:
|
I think I'm on board with this plan, if we just keep #2424 (comment) in mind. |
The
makedocs
function currently takes an undocumentedversion
argument (which the HTML writer can access asctx.doc.user.version
).I was hoping to start encouraging the use of that argument to pass the version of the package being documented. The inventory files I'm currently prototyping preferably should write this version information into the inventory.
Alas, it turns out that setting the
version
parameter actually disables the version selection menu entirely (it gets set to "visible", which the javascript then toggles to "invisible").Is this intentional? The way this happens is pretty round-about, so it may not be intentional. What was the idea behind the
version
argument when it was originally implemented? Is this being used anywhere in the wild?Since
version
is completely undocumented, is there any chance that we can removeDocumenter.jl/src/html/HTMLWriter.jl
Lines 1133 to 1137 in d9865b4
without this being a "breaking change"?
Would it be possible to officially make the
version
argument tomakedocs
be for "you can (should) pass the version of the package being documented" and document it as such?The text was updated successfully, but these errors were encountered: