All Projects → lukasgeiter → Mkdocs Awesome Pages Plugin

lukasgeiter / Mkdocs Awesome Pages Plugin

Licence: mit
An MkDocs plugin that simplifies configuring page titles and their order

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mkdocs Awesome Pages Plugin

Cattaz
Realtime collaborative tool which can run custom applications in a Wiki page
Stars: ✭ 191 (+40.44%)
Mutual labels:  wiki, markdown
Redpen
RedPen is an open source proofreading tool to check if your technical documents meet the writing standard. RedPen supports various markup text formats (Markdown, Textile, AsciiDoc, Re:VIEW, reStructuredText and LaTeX).
Stars: ✭ 466 (+242.65%)
Mutual labels:  wiki, markdown
Tms
基于频道模式的团队沟通协作+轻量级任务看板,支持mardown、富文本、在线表格和思维导图的团队博文wiki,i18n国际化翻译管理的响应式web开源团队协作系统。
Stars: ✭ 232 (+70.59%)
Mutual labels:  wiki, markdown
Wiki
Wiki.js | A modern and powerful wiki app built on Node.js
Stars: ✭ 14,985 (+10918.38%)
Mutual labels:  wiki, markdown
Seafile
High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
Stars: ✭ 9,201 (+6665.44%)
Mutual labels:  wiki, markdown
Mininote
📔 A simple Markdown note-taking editor
Stars: ✭ 171 (+25.74%)
Mutual labels:  wiki, markdown
Gitit Bigger
Gitit Bigger: 超棒的个人、团队Wiki/文档方案(Git、Markdown、Bootstrap、Ace、Docker)
Stars: ✭ 279 (+105.15%)
Mutual labels:  wiki, markdown
Osu Wiki
home of the osu! wiki
Stars: ✭ 246 (+80.88%)
Mutual labels:  wiki, markdown
Mrdoc
online document system developed based on python. It is suitable for individuals and small teams to manage documents, wiki, knowledge and notes. like gitbook.
Stars: ✭ 1,129 (+730.15%)
Mutual labels:  wiki, markdown
Trackdown
TrackDown - Issue Tracking with plain Markdown. If you are missing the "git clone" for your tickets from github.com or bitbucket.org, then this is for you. A lightweight Ticketing System for distributed and unconnected small Teams.
Stars: ✭ 10 (-92.65%)
Mutual labels:  wiki, markdown
Sublimeless zk
A note taking app, Markdown editor, and text browser, featuring ID based wiki style links, and #tags, intended for zettelkasten method users. Loaded with tons of features like sophisticated tag search, note transclusion, support for note templates, bibliography support, etc. to make working in your Zettelkasten a joy 😄
Stars: ✭ 153 (+12.5%)
Mutual labels:  wiki, markdown
Wiki
Awesome way to learn together! 🤣
Stars: ✭ 119 (-12.5%)
Mutual labels:  wiki, markdown
Hads
📚 Markdown superpowered documentation for Node.js
Stars: ✭ 147 (+8.09%)
Mutual labels:  wiki, markdown
Deepwiki
A lightweight Markdown wiki system in PHP
Stars: ✭ 188 (+38.24%)
Mutual labels:  wiki, markdown
Boostnote.next
Boost Note is a powerful, lightspeed collaborative workspace for developer teams. Forum (New!): https://github.com/BoostIO/BoostNote-App/discussions
Stars: ✭ 2,682 (+1872.06%)
Mutual labels:  markdown, wiki
Amwiki
amWiki 是一款由 JS 开发、依赖 Atom 或 Nodejs-Npm 的 Markdown 轻量级前端化开源文库系统
Stars: ✭ 814 (+498.53%)
Mutual labels:  wiki, markdown
Viki
A simple Wiki page in Markdown from notebook of VNote.
Stars: ✭ 103 (-24.26%)
Mutual labels:  wiki, markdown
Githubdocs
Easily build a searchable documentation app using markdown files in your Github Repo or local Markdown files.
Stars: ✭ 122 (-10.29%)
Mutual labels:  wiki, markdown
I18n React
React (JS) text internationalization and externalizing
Stars: ✭ 129 (-5.15%)
Mutual labels:  markdown
Pinp
Pinp Is Not PNAS -- Two-Column PDF Template
Stars: ✭ 134 (-1.47%)
Mutual labels:  markdown

MkDocs Awesome Pages Plugin Build Status

An MkDocs plugin that simplifies configuring page titles and their order

The awesome-pages plugin allows you to customize how your pages show up the navigation of your MkDocs without having to configure the full structure in your mkdocs.yml. It gives you detailed control using a small configuration file directly placed in the relevant directory of your documentation.

Note: This plugin won't do anything if your mkdocs.yml defines a nav or pages entry. To make use of the features listed below, you'll either have to remove the entry completely or add a ... entry to it.


Installation

Note: This package requires Python >=3.5 and MkDocs version 1.0 or higher.
If you're still on MkDocs 0.17 use version 1 of this plugin.

Install the package with pip:

pip install mkdocs-awesome-pages-plugin

Enable the plugin in your mkdocs.yml:

plugins:
    - search
    - awesome-pages

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


Features

Customize Navigation

Create a YAML file named .pages in a directory and use the nav attribute to customize the navigation on that level. List the files and subdirectories in the order that they should appear in the navigation.

nav:
    - subdirectory
    - page1.md
    - page2.md

Rest

Pages or sections that are not mentioned in the list will not appear in the navigation. However, you may include a ... entry to specify where all remaining items should be inserted.

nav:
    - introduction.md
    - ...
    - summary.md

Furthermore, it is possible to filter the remaining items using glob patterns or regular expressions. For example to match only the Markdown files starting with introduction-.

nav:
    - ... | introduction-*.md
    - ...
    - summary.md

Note: The pattern is checked against the basename (folder- / filename) of remaining items - not their whole path.

For more details refer to the Rest Filter Patterns section below.

Titles

You can optionally specify a title for the navigation entry.

nav:
    - ...
    - First page: page1.md

Note: Specifying a title for a directory containing a .pages file that defines a title has no effect.

Links

You can also use the nav attribute to add additional links to the navigation.

nav:
    - ...
    - Link Title: https://lukasgeiter.com

Change Sort Order

Create a YAML file named .pages in a directory and set the order attribute to asc or desc to change the order of navigation items.

order: desc

Note: Unlike the default order, this does not distinguish between files and directories. Therefore pages and sections might get mixed.

Collapse Single Nested Pages

Note: This feature is disabled by default. More on how to use it below

If you have directories that only contain a single page, awesome-pages can "collapse" them, so the folder doesn't show up in the navigation.

For example if you have the following file structure:

docs/
├─ section1/
│  ├─ img/
│  │  ├─ image1.png
│  │  └─ image2.png
│  └─ index.md # Section 1
└─ section2/
   └─ index.md # Section 2

The pages will appear in your navigation at the root level:

  • Section 1
  • Section 2

Instead of how MkDocs would display them by default:

  • Section 1
    • Index
  • Section 2
    • Index

For all pages

Collapsing can be enabled globally using the collapse_single_pages option in mkdocs.yml

For a sub-section

If you only want to collapse certain pages, create a YAML file called .pages in the directory and set collapse_single_pages to true:

collapse_single_pages: true

You may also enable collapsing globally using the plugin option and then use the .pages file to prevent certain sub-sections from being collapsed by setting collapse_single_pages to false.

Note: This feature works recursively. That means it will also collapse multiple levels of single pages.

For a single page

If you want to enable or disable collapsing of a single page, without applying the setting recursively, create a YAML file called .pages in the directory and set collapse to true or false:

collapse: true

Hide Directory

Create a YAML file named .pages in a directory and set the hide attribute to true to hide the directory, including all sub-pages and sub-sections, from the navigation:

hide: true

Note: This option only hides the section from the navigation. It will still be included in the build and can be accessed under its URL.

Set Directory Title

Create a YAML file named .pages in a directory and set the title to override the title of that directory in the navigation:

title: Page Title

Arrange Pages

Deprecated: arrange will be removed in the next major release - Use nav instead.

Create a YAML file named .pages in a directory and set the arrange attribute to change the order of how child pages appear in the navigation. This works for actual pages as well as subdirectories.

title: Page Title
arrange:
    - page1.md
    - page2.md
    - subdirectory

If you only specify some pages, they will be positioned at the beginning, followed by the other pages in their original order.

You may also include a ... entry at some position to specify where the rest of the pages should be inserted:

arrange:
    - introduction.md
    - ...
    - summary.md

In this example introduction.md is positioned at the beginning, summary.md at the end, and any other pages in between.

Combine Custom Navigation & File Structure

MkDocs gives you two ways to define the structure of your navigation. Either create a custom navigation manually in mkdocs.yml or use the file structure to generate the navigation. This feature makes it possible to combine both methods. Allowing you to manually define parts of your navigation without having to list all files.

Note: You can freely combine this with all the other features of this plugin. However they will only affect the part of the navigation that is not defined manually.

Use the nav entry in mkdocs.yml to define the custom part of your navigation. Include a ... entry where you want the navigation tree of all remaining pages to be inserted.

The following examples are based on this file structure:

docs/
├─ introduction.md
├─ page1.md
├─ page2.md
└─ folder/
   ├─ introduction.md
   ├─ page3.md
   └─ page4.md

If you wanted introduction.md, page1.md and page2.md to appear under their own section you could do this:

nav:
    - Start:
        - page1.md
        - page2.md
        - summary.md
    - ...

Which would result in the following navigation:

  • Start
    • Introduction
    • Page 1
    • Page 2
  • Folder
    • Introduction
    • Page 3
    • Page 4

The ... entry can also be placed at a deeper level:

nav:
    - page1.md
    - Rest:
        - ...

Which would result in the following navigation:

  • Page 1
  • Rest
    • Introduction
    • Page 2
    • Folder
      • Introduction
      • Page 3
      • Page 4

Furthermore, it is possible to filter the remaining items using glob patterns or regular expressions. For example to match only files named introduction.md.

nav:
    - Introductions:
        - ... | **/introduction.md
    - ...

With the following result:

  • Introductions
    • Introduction
    • Introduction
  • Page 1
  • Page 2
  • Folder
    • Page 3
    • Page 4

Note: The pattern is checked against the path relative to the docs directory.

For more details refer to the Rest Filter Patterns section below.


Rest Filter Patterns

In all places where the rest entry (...) is allowed, you can also include a glob pattern or regular expression to filter the items to be displayed.

nav:
    - ... | page-*.md
    - ... | regex=page-[0-9]+.md

The filter only operates on remaining items. This means it will not include items that are explicitly listed in the navigation or items that are matched by another filter that appears earlier in the configuration.

You may also include a rest entry without filter to act as a catch-all, inserting everything that is not matched by a filter.

Syntax Details

Unless the filter starts with regex= it is interpreted as glob pattern, however you may also explicitly say so using glob=. The spaces around ... are optional but recommended for readability.

Note: Depending on the characters in your filter, you might also need to use quotes around the whole entry.

nav:
    # equivalent glob entries
    - ... | page-*.md
    - ... | glob=page-*.md
    - ...|page-*.md
    - '... | page-*.md'

    # equivalent regex entries
    - ... | regex=page-[0-9]+.md
    - ...|regex=page-[0-9]+.md
    - '... | regex=page-[0-9]+.md'

Options

You may customize the plugin by passing options in mkdocs.yml:

plugins:
    - awesome-pages:
        filename: .index
        collapse_single_pages: true
        strict: false

filename

Name of the file used to configure pages of a directory. Default is .pages

collapse_single_pages

Enable the collapsing of single nested pages. Default is false

strict

Raise errors instead of warnings when:

  • arrange entries cannot be found
  • nav entries cannot be found

Default is true


Contributing

From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.

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