Skip to content
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

ENH: add optional per version url in version-switcher #575

Merged
merged 3 commits into from Feb 8, 2022

Conversation

tupui
Copy link
Contributor

@tupui tupui commented Jan 20, 2022

Closes #573

Allow to specify url in switcher.json. It would directly link a given version to the specified url and not use url_template.

Copy link
Collaborator

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test (no computer access, only phone) but the code changes look correct to me


- ``version``: a version string. This will be inserted into
``switcher['url_template']`` to create the links to other docs versions, and
also checked against ``switcher['version_match']`` to provide styling to the
switcher.
- ``name``: an optional name to display in the switcher dropdown instead of the
version string (e.g., "latest", "stable", "dev", etc).
- ``url``: an optional URL. If provided, it links the version to ``url``
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an example of this usage in one of the entries in the example below, with a comment like "Note that because url is specified for entry XXX, this URL will be used instead of the automatically-generated one."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it in an example. But since it's a JSON file I cannot really add a comment no??

@tupui tupui requested a review from choldgraf January 26, 2022 23:06
Copy link
Collaborator

@damianavila damianavila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (modulo @choldgraf is OK with the added example on his comment).

@tupui
Copy link
Contributor Author

tupui commented Feb 7, 2022

@choldgraf can you please take another look? 😃

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick comment about wording but this looks good to me as well!

docs/user_guide/configuring.rst Outdated Show resolved Hide resolved
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
@choldgraf choldgraf merged commit 052a7fa into pydata:master Feb 8, 2022
@tupui tupui deleted the version_switcher_url branch February 8, 2022 21:15
@tupui
Copy link
Contributor Author

tupui commented Feb 8, 2022

Thanks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple url_template in version switcher
4 participants