Open
Conversation
…of window.location.origin
…t's in the pkgdown dir
Member
|
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 😄 |
thisisnic
added a commit
to apache/arrow
that referenced
this pull request
Dec 1, 2022
…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.  Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
|
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) |
Collaborator
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial PR implementing functionality similar to that mentioned in #1373
Deployed here: https://625ecfe71b4b2d1ec74155ac--rococo-beijinho-f54560.netlify.app/
Overview of changes:
versions.jsonin their package'spkgdown/assetsdirectory, 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.origintests/testthat/assets/version-dropdown/README.mdNot implemented: