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

Add version selector feature #10

Closed
briandominick opened this issue May 19, 2021 · 2 comments
Closed

Add version selector feature #10

briandominick opened this issue May 19, 2021 · 2 comments
Labels
enhancement New feature or request JavaScript Involves some JS struggles

Comments

@briandominick
Copy link
Contributor

This feature is really just a URL selector. You feed it options, and it browses to the parallel subpath of a new version path.

So if you're at <docs.domain.com>/superproduct/v2.1/getting-started, the switcher will send you to the same URL but with v2.1 swapped out for another version.

Any number of these can exist on a page, each effectively targeting a different part of the URL.

The only complicated aspect of this is how to build it into the theme's own docs, which are currently unversioned. So this may not get a proper demo until after it is released. Keeping track of your versioned content is far more complicated than providing the front-end switcher for it.

@briandominick briandominick added enhancement New feature or request JavaScript Involves some JS struggles labels May 19, 2021
@briandominick briandominick changed the title Add version switcher selectbox Add version selector feature May 21, 2021
@briandominick
Copy link
Contributor Author

briandominick commented May 21, 2021

I think in light of the changes planned in #11 it would make some sense to let the selectbox change either part of the URL (location) or let it act just like a content switcher. This way it could be used to alter superficial content the same way the switcher (formerly/currently "toggler") does. For instance, rather than "radio" style buttons for a multiple choice, a selectbox can be generated to handle the class show/hide effect.

Imagine this for patch versions on your installation page. Everywhere you have a version number, you cold flag it:

[source,shell.selector.patch-versions]
 wget https://example.com/our-software.v{vrsn}.tar.gz

We set {vrsn} AsciiDoc attribute to a unique token that the selector JS looks for to replace inside blocks with the classes .selector.patch-versions, where patch-versions is an object established in site.features.actions.versioning.selectors.

@briandominick
Copy link
Contributor Author

Resolved in #48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request JavaScript Involves some JS struggles
Projects
None yet
Development

No branches or pull requests

1 participant