-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-14338: [Docs] Add version dropdown to the pkgdown (R) docs #12172
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
ARROW-14338: [Docs] Add version dropdown to the pkgdown (R) docs #12172
Conversation
|
|
82f5c77 to
e219f6d
Compare
|
Cool! The screenshot looks good. I don't have time to test it right now, but if it is working for you locally, I trust that, and I would merge it and then we can still see how it works in the hosted dev docs
Well, thanks to the person that implemented it in the pydata-sphinx-theme, as I just copied it from there :) |
|
Including to 7.0. |
|
One question though: where does this versions.json asset get included? (where does it get copied on the actual website) |
r/pkgdown/extra.js
Outdated
| } | ||
|
|
||
| // Load the versions JSON and construct the select items | ||
| $.getJSON("./versions.json", function( data ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "./versions.json", is that a relative path to the current location? Because that might not work if you have sub-directories in the docs (like for the articles)
Or does that point to a "root" file? (in which case it would always be arrow.apache.org/versions.json once deployed, which might also not be correct?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch; I guess it'd make the most sense to hard code it to point to the published version like this?
| $.getJSON("./versions.json", function( data ) { | |
| $.getJSON("https://arrow.apache.org/docs/r/versions.json", function( data ) { |
Or perhaps not if the docs are published somewhere else though. I guess I need to construct the URL...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this part is annoying to test with an absolute url before it's actually deployed .. :)
But, I think an absolute url is probably the easiest for now. I would maybe not put it in /docs/r/versions.json, as that is the stable docs location (it would get overwritten when doing a release and recreating the stable docs). Unless the file is not included in the actual arrow repo, and only in the arrow-site repo. Although I see now that I actually did the same for the sphinx site ... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added another commit where I did it a little differently to construct a relative URL based on the fact that the only thing we know for sure is the structure that pkgdown has means that the final instance of /r/in the path will be where versions.json is hosted. I think it makes sense now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does that mean that if you are on a page like https://arrow.apache.org/docs/5.0/r/articles/developing.html, that would point to https://arrow.apache.org/docs/5.0/r/versions.json? (taking the last /r, and appending versions.json)
Because then it still points to the versions.json of that version, and not the latest one (which can be updated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, of course! Reverting to absolute URL...
kszucs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @thisisnic! Merging on green.
|
Benchmark runs are scheduled for baseline = ff4b9be and contender = 9938f70. 9938f70 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Implemented:
arrow/r/pkgdown/assets/versions.jsonSuggestion for testing without putting together a complex Docker script:
extra.jsversions.jsonfile is not deployed yet, replace./versions.jsonin line$.getJSON("./versions.json", function( data ) {withhttps://raw.githubusercontent.com/thisisnic/arrow/ARROW-14338_pkgdown_versioning/r/pkgdown/assets/versions.json