Skip to main content

A mkdocs plugin that lets you include subfolder of a top level tree.

Project description

Folder include plugin for mkdocs

mkdocs-include-folders is a mkdocs plugin that allows you to include and prioritize folders from your input.

Quick start

  1. Install the module using pip: pip3 install mkdocs-include-folders

  2. If your document folders look like this:

documents
   project1
      mkdocs.yml
      specifications.md
   project2
      mkdocs.yml
      specfications.md
   shared-docs
      introduction.md
      contact.md
      .....

you may want to create a document including pages from the project1 and shared-docs and present them in the same folder, this plugin will take documents from project1 and shared-docs and place the im the same folder and also proritize files in project1 over files in shered-docs if they have the same name.

  1. In your project, add a plugin configuration to mkdocs.yml:
    docs_dir: ..
    plugins:
       - include-folders
    
    or
    docs_dir: ..
    plugins:
      - include-folders:
          priority_path:
            - 'project1/*'
            - 'shared-docs/*'
    

You can provide one or more patterns. (If you don't provide any patterns, then nothing will happen!)

Note! Because of peculiarity of yaml syntax, the glob: and regex: lines must not start with a dash, but the lines under them must start with a dash.

Also because of yaml, patterns that start with a punctuation mark must be quoted.

When writing regexes, it's best to use single quotes rather than double quotes, so that your regex backslash escapes are preserved correctly without having to be doubled up.

Project details


Download files

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

Source Distribution

mkdocs-include-folders-0.1.2.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_include_folders-0.1.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page