DocOps/asciidocsy-jekyll-theme

Add version selector feature

Closed this issue · 2 comments

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.

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.

Resolved in #48.