All Projects → jimporter → Mike

jimporter / Mike

Licence: bsd-3-clause
Manage multiple versions of your MkDocs-powered documentation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mike

Jekyll Rtd Theme
Just another documentation theme compatible with GitHub Pages
Stars: ✭ 92 (+4.55%)
Mutual labels:  github-pages, documentation-tool
chappe
🧑‍💻 Developer Docs builder. Write guides in Markdown and references in API Blueprint. Comes with a built-in search engine.
Stars: ✭ 132 (+50%)
Mutual labels:  github-pages, documentation-tool
wowchemy-hugo-themes
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, easily build with blocks! 创建在线课程,学术简历或初创网站。#OpenScience
Stars: ✭ 6,891 (+7730.68%)
Mutual labels:  github-pages, documentation-tool
Docsify
🃏 A magical documentation site generator.
Stars: ✭ 19,310 (+21843.18%)
Mutual labels:  github-pages, documentation-tool
csharp-docs-generator
An action that generates html documentation for C# programs to use for GitHub pages.
Stars: ✭ 21 (-76.14%)
Mutual labels:  github-pages, documentation-tool
Wowchemy Hugo Modules
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets! 创建在线课程,学术简历或初创网站。
Stars: ✭ 6,093 (+6823.86%)
Mutual labels:  github-pages, documentation-tool
Jekyll Katex
Jekyll plugin for easy server-side math rendering via KaTeX
Stars: ✭ 73 (-17.05%)
Mutual labels:  github-pages
Iloveworks
I ❤ working, working makes me happy!
Stars: ✭ 79 (-10.23%)
Mutual labels:  github-pages
Toast Ui.doc
Stars: ✭ 71 (-19.32%)
Mutual labels:  documentation-tool
Peach
Peach is a web server for multi-language, real-time synchronization and searchable documentation.
Stars: ✭ 1,166 (+1225%)
Mutual labels:  documentation-tool
Ignite
Modern markdown documentation generator
Stars: ✭ 83 (-5.68%)
Mutual labels:  documentation-tool
Drf Autodocs
Ultimately automated DRF documentation rendering(UNMAINTAINED)
Stars: ✭ 82 (-6.82%)
Mutual labels:  documentation-tool
Github Pages Gallery
A zero dollar solution to host your photo/video gallery online using Github pages and GitHub Actions. No coding necessary.
Stars: ✭ 77 (-12.5%)
Mutual labels:  github-pages
Grav Skeleton Rtfm Site
Grav RTFM Skeleton
Stars: ✭ 74 (-15.91%)
Mutual labels:  documentation-tool
Graphdoc
Static page generator for documenting GraphQL Schema
Stars: ✭ 1,218 (+1284.09%)
Mutual labels:  documentation-tool
Cstate
🔥 Open source static (serverless) status page. Uses hyperfast Go & Hugo, minimal HTML/CSS/JS, customizable, outstanding browser support (IE8+), preloaded CMS, read-only API, badges & more.
Stars: ✭ 1,186 (+1247.73%)
Mutual labels:  github-pages
Showdoc
ShowDoc is a tool greatly applicable for an IT team to share documents online一个非常适合IT团队的在线API文档、技术文档工具
Stars: ✭ 10,099 (+11376.14%)
Mutual labels:  documentation-tool
Ghpages Ghcomments
Let GitHub host the comments for your GitHub Pages
Stars: ✭ 70 (-20.45%)
Mutual labels:  github-pages
Github Pages
🚀 Ejemplos de uso de GitHub Pages
Stars: ✭ 77 (-12.5%)
Mutual labels:  github-pages
Explain
Explain commands using ASCII art
Stars: ✭ 80 (-9.09%)
Mutual labels:  documentation-tool

mike

PyPi version Build status Coverage status

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. To see an example of this in action, take a look at the documentation for bfg9000.

Why Use mike?

mike is built around the idea that once you've generated your docs for a particular version, you should never need to touch that version again. This means you never have to worry about breaking changes in MkDocs, since your old docs (built with an old version of MkDocs) are already generated and sitting in your gh-pages branch.

While mike is flexible, it's optimized around putting your docs in a <major>.<minor> directory, with optional aliases (e.g. latest or dev) to particularly notable versions. This makes it easy to make permalinks to whatever version of the documentation you want to direct people to.

Installation

Like most Python projects, mike uses setuptools, so installation is what you might expect:

pip install mike

Usage

Initialization

Before using mike for the first time, you may want to add the mike plugin to your mkdocs.yml file. This plugin is added by default when building your documentation with mike, but by adding it explicitly, you can configure how it works. The plugin adds a version selector to supported themes as well as updating the site_url (if you set it) to point to the version of the docs that are being built:

plugins:
  - mike:
      # these fields are all optional; the defaults are as below...
      version_selector: true   # set to false to leave out the version selector
      css_dir: css             # the directory to put the version selector's CSS
      javascript_dir: js       # the directory to put the version selector's JS
      canonical_version: null  # the version for <link rel="canonical">; `null`
                               # uses the version specified via `mike deploy`

Note: If you have existing documentation on your gh-pages branch, you may also want to delete the old documentation before building your new versioned docs via mike delete --all.)

Building Your Docs

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]...

By default, aliases create a simple HTML redirect to the real version of the docs; to create a copy of the docs for each alias, you can pass --no-redirect. If you're using redirects, you can customize the redirect template with -T/--template; this takes a path to a Jinja template that accepts an {{href}} variable.

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. If version already exists, this command will also update all of the pre-existing aliases for it. If you want to move an alias from a previous version to this version (e.g. when releasing a new version and updating a latest alias), you can pass -u/--update-aliases to allow this.

In addition, you can specify where to deploy your docs via -b/--branch, -r/--remote, and --prefix, specifying the branch, remote, and directory prefix within the branch, respectively. Finally, to push your docs to a remote branch, simply add -p/--push to your command.

Viewing Your Docs

To test that your docs have been built as expected, you can serve them locally from a dev server:

mike serve

By default, this serves the docs on http://localhost:8000, but you can change this with -a/--dev-addr. Remember though, this is for testing only. To host your docs for real, you should use a real web server.

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 version-or-alias is a version, this will delete the version and all its aliases from the branch; if it's an alias, it will only delete that 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 --branch, --push, etc to control how the commit is handled.

Listing Docs

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

mike list

To list the info for a particular version, you can just pass the version or alias:

mike list [version-or-alias]

Sometimes, you need this information to be consumed by another tool. In that case, pass -j/--json to return the list of doc versions as JSON.

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]

If you want to use a different template from the default, you can pass -T/--template; this takes a path to a Jinja template that accepts an {{href}} variable.

Like deploy and delete above, you can specify --branch, --push, etc to control how the commit is handled.

Changing a Version's Title

As you update your docs, you may want to change 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 retitle command:

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

As with other commands that change your docs, you can specify --branch, --push, etc to control how the commit is handled.

Adding a New Version Alias

Sometimes, you might need to add a new alias for a version without rebuilding your documentation. You can use the alias command for this:

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

Once again, you can specify --branch, --push, etc to control how the commit is handled.

More Details

For more details on the available options, consult the --help command for mike.

Staying in Sync

mike will do its best to stay in-sync with your remote repository and will automatically update your local branch to match the remote's if possible (note that mike won't automatically git fetch anything). If your local branch has diverged from your remote, mike will leave it as-is and ask you what to do. To ignore the remote's state, just pass --ignore; to update to the remote's state, pass --rebase.

CNAME (and Other Special Files)

Some special files that you'd like to deploy along with your documentation (such as CNAME) aren't related to a particular version of the docs, and instead need to go in the root directory of your site. There's no special handling for this in mike, but since your built docs live on a git branch, it's still easy to manage: check out your gh-pages branch (or wherever your built docs live), and commit the necessary files to the root directory.

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": []}
]

If you're creating a third-party extension to an existing theme, you add a setuptools entry point for mike.themes pointing to a Python submodule that contains css/ and js/ subdirectories containing the extra code to be installed into the user's documentation. This will then automatically be included via the mike plugin in the user's mkdocs.yml file.

To see some examples of how to work with this, check the mike/themes/mkdocs directory.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].