GithubHelp home page GithubHelp logo

isabella232 / mkdocs-versions-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redislabs/mkdocs-versions-menu

0.0 0.0 0.0 20 KB

An MkDocs plugin that generates a versions menu for the mkdocs-material theme.

License: MIT License

Shell 1.04% Python 65.74% CSS 3.79% JavaScript 29.43%

mkdocs-versions-menu's Introduction

mkdocs-versions-menu

This MkDocs plugin generates a versions menu from the branches of a git repository. It is intended to be used with the mkdocs-material theme.

It does the following when enabled in a docs repo:

  • It injects the required theme files, but allows customization if these are provided by the docs
  • For the latest branch, it copies the docs to site/x.y
  • For other branches, it moves the docs to site/x.y
  • It generates supporting Javascript glue for tying it all together

Inspired by: https://github.com/containous/structor

Requirements

Setup

Install the plugin using pip:

pip install git+https://github.com/RedisLabs/mkdocs-versions-menu.git

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - versions-menu:
      exclude-regexes:
        - '(?!.*)'
      include-regex: '([0-9]+)\.([0-9]+)'
      require-release-tag: yes
      release-tag-regex: v([0-9]+)\\.([0-9]+)\\.([0-9]+)'
      master-branch: 'master'
      master-text: 'Master'
      css-path: 'css'
      javascript-path: 'javascript'

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation.

Config

  • exclude-regexes - a list of branch regexes to exclude (default: ['(?!.*)'], i.e. nothing)
  • include-regexes - a string regex of branches to include, where \$1 is the major version and \$2 is the minor (default: '([0-9]+).([0-9]+)')
  • require-release-tag - a boolean controlling whether included branches should have at least one tag (default: True)
  • release-tag-regex - a string regex for release tags (default: 'v([0-9]+)\.([0-9]+)\.([0-9]+)')
  • master-branch - a string name of the master branch, if set to '' then no master (default: 'master')
  • master-text - a string text to display for master branch (defaults to capitalized form of master-branch)
  • css-path - the site's css relative path (default: 'css')
  • javascript-path - the site's Javascript relative path (default: 'javascript')

Usage

mkdocs-versions-menu's People

Contributors

itamarhaber avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.