Skip to main content

mike is a Python utility to easily deploy multiple versions of your MkDocs-powered docs to a Git branch, suitable for deploying to Github via gh-pages.

Installation

Like most Python projects, mike uses setuptools, so you can install it like most any other Python package:

pip install mike

Usage

Building Your Docs

Before your first build, you’ll probably want to add the version selector to your MkDocs config. Simply run the following command in the directory with your mkdocs.yml file to install the extra CSS and JS files to your docs:

mike install-extras

mike is designed to produce one version of your docs at a time. That way, you can easily deploy a new version without touching any older versions of your docs; this can be especially important if your old docs are no longer buildable with the newest version of MkDocs (or if they weren’t built with MkDocs at all!). To deploy the current version of your docs, simply run:

mike deploy [version]

Where [version] is the current version of your project, represented however you like (I recommend using [major].[minor] and excluding the patch number). You can also pass aliases to the deploy command to host a particularly-relevant version of your docs somewhere special (e.g. latest):

mike deploy [version] [alias]...

If you’d like to specify a title for this version that doesn’t match the version string, you can pass -t TITLE/--title=TITLE as well.

Finally, to push your docs to a remote branch, simply add -p/--push to your command. (Note: this will likely become the default eventually.)

Deleting Docs

Sometimes you need to delete an old version of your docs, either because you made a mistake or you’re pruning unsupported versions. You can do this via the delete subcommand:

mike delete [version-or-alias]...

If you’d like to completely wipe the contents of your docs branch, just run mike delete --all. Like deploy above, you can specify -p/--push to push this commit as well.

Listing Docs

If you ever need to see the list of all currently-deployed doc versions, you can run:

mike list

Setting the Default Version

With all the versions of docs you have, you may want to set a default version so that people going to the root of your site are redirected to the latest version of the docs:

mike set-default [version-or-alias]

Like deploy and delete above, you can specify -p/--push to` push this commit as well.

Renaming a Version

As you update your docs, you may want to rename the title of a particular version. For example, your 1.0 docs might have the title 1.0.0, and when you release a new patch, you want to update the title to 1.0.1. You can do this with the rename command:

mike rename [version-or-alias] [title]

More Details

For more details on the available options (e.g. specifying which branch to push to), consult the --help command for mike.

For Theme Authors

If you’d like to provide support for mike in your theme, you just need to fetch versions.json and build a version selector. versions.json looks like this:

[
  {"version": "1.0", "title": "1.0.1", "aliases": ["latest"]},
  {"version": "0.9", "title": "0.9", "aliases": []}
]

To see an example of how to work with this, check the `mike/themes/mkdocs <mike/themes/mkdocs>`__ directory.

License

This project is licensed under the BSD 3-clause license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mike-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mike-0.1.1-py2.py3-none-any.whl (16.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mike-0.1.1.tar.gz.

File metadata

  • Download URL: mike-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mike-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc51b0d9ec5de108f11bd69e74735550211a5dc13714cab565250d208226f980
MD5 f56f5473b7811427d36cd95f3c8d840c
BLAKE2b-256 226be03ae2a679a7c85d411d22b2b70a6ec5fc52603e06c9bca747b78c5c07f5

See more details on using hashes here.

File details

Details for the file mike-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mike-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bb88121ef6563d4975bea803255bb3f54f364a1adee0e461ebef42ccd3cdff1f
MD5 ab767145d98cf319d6189008861496ac
BLAKE2b-256 1270861b1fe65bcec7aeff152d37b6da283c4e9ca1ccd9bf4a26e9c2c5f3015e

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.0

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.6.0

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page