-
Notifications
You must be signed in to change notification settings - Fork 337
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
Version selector #2072
base: main
Are you sure you want to change the base?
Version selector #2072
Conversation
…of window.location.origin
…t's in the pkgdown dir
Thanks for working on this! It'll probably be a while before I get a chance to understand this thoroughly, but the overall approach looks super simple, which is great 😄 |
…14800) For context, this overrides the default navbar HTML with a custom version which makes a single change - adding a span called "version" which the JS will override. An identically-named span existed in the template used with Bootstrap 3, which is why no JavaScript changes were needed. This approach is almost identical to that in this PR to the pkgdown package which implements the same thing: r-lib/pkgdown#2072 I built this locally, and it appears to have successfully added the dropdown back in. ![image](https://user-images.githubusercontent.com/13715823/205083695-e718c7e5-1dc1-4742-9ce8-f773611b8ab7.png) Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
Arrow ended up removing this: apache/arrow#35103 (But having developed a new Python package recently, I must say that the packaging ecosystem in Python is terribly painful compared to R) |
I think a simpler approach would be to add version information into the main _pkgdown.yml as a separate section rather than use a separate json file. |
Initial PR implementing functionality similar to that mentioned in #1373
Deployed here: https://625ecfe71b4b2d1ec74155ac--rococo-beijinho-f54560.netlify.app/
Overview of changes:
versions.json
in their package'spkgdown/assets
directory, when the site it built, some JS will be included which overrides the "version" span in the navbar and replaces it with a dropdown where they can choose which version of the documentation to browseversions.json
, the user can specify an array of JSON objects containing 3 fields: "label" (the label to display in the dropdown), "version" (the package version"), and "path" (the path at which the docs for this version are displayed, relative towindow.location.origin
tests/testthat/assets/version-dropdown/README.md
Not implemented: