JSPM

gitbook-plugin-versions-select

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q47412F
  • License Apache-2.0

Fork of versions plugin with selected status based on url.

Package Exports

  • gitbook-plugin-versions-select

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gitbook-plugin-versions-select) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gitbook-plugin-versions-select

NPM version NPM downloads License Code Style

This is a modified version of Versions

Display a <select> with other versions of your gitbook that you have specified in your book.json file.

Usage with gitbook.com

When your book is hosted on GitBook.com, the plugin can access a listing of versions using the GitBook API.

Put this in your book.json:

{
  "plugins": [ "versions-select" ],
  "pluginsConfig": {
    "versions": {
      "gitbookConfigURL": "https://raw.githubusercontent.com/prescottprue/react-redux-firebase/v2.0.0/book.json",
      "options": [
        {
          "value": "http://react-redux-firebase.com/history/v1.4.0/",
          "text": "Version v1.4.0"
        },
        {
          "value": "http://react-redux-firebase.com/history/v1.4.0/",
          "text": "Version v2.0.0"
        }
      ]
    }
  }
}

A <select> element will be created with the given options and placed at the top of the book summary. When the user selects one of the options, they are taken to that URL.

The gitbookConfigURL variable is a publicly accessible URL to your book.json. If this is present, the plugin will fetch the latest config when the page loads, so even older versions of your book will have updated options.

FAQ

  1. How is this different than gitbook-plugin-versions

The active version selected in the <select> is based location.

  1. How is this different than gitbook-plugin-feathers-versions?

Versions on the same domain under different folders are supported

Credits

Original work by @mjackson.

License

Apache 2