A simple mkdocs plugin, enable to sort nav by setting "weight" in markdown metadata
Project description
mkdocs-nav-weight
A simple mkdocs plugin, enable to sort nav by setting "weight" in markdown metadata
Not sure if it works (at least it does in my local docs). Only the compatibility ofsection
,index
andpage
has been considered.
mkdocs getnav
first, and then reads markdown resource topage
, so using this plugin means reading markdown source twice, which may introduce performance problems
Install
pip install mkdocs-nav-weight
mkdocs.yml
plugins:
- search
- mkdocs-nav-weight
Intro
Markdown metadata like this:
foo.md
---
title: foo
weight: 4
...
---
In the following, it is simply expressed as:
foo.md // 4
A document tree like this:
│ bar.md // no “weight”
│ foo.md // 4
│
├─have_index_folder
│ │ another.md // 1
│ │ index.md // 3
│ │
│ └─level2
│ another.md // 1
│ bar.md // no “weight”
│ foo.md // 4
│
└─no_index_folder
alone.md // 2
You will get a nav like this:
bar // 0: no 'weight', default 0
No index folder // 0: cann't find a 'index', so it's defalut 0
alone // 2
Have index folder // 3: get from 'index'
index // 0: it's 3 but as 0 in same level
Level2 // 0: no index, default 0
bar // 0
another // 1
foo // 4
another // 1
foo // 4
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mkdocs_nav_weight-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e1a4759b035bd8cf351b31e5549ccdd29d60f8f1f27c75df1cfdd32029c371 |
|
MD5 | 4e19dd772bf0b8a120507f9e81714f1e |
|
BLAKE2b-256 | 27d356e83fd02922ed7b124692ec5dbfab417494abf36cacdf4de7b8490679a8 |