Skip to content

A MkDocs plugin that lets you copy (and maybe transform) arbitrary doc files to the build.

License

Notifications You must be signed in to change notification settings

chikamichi/mkdocs-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy files in your MkDocs build

mkdocs-copy is a plugin for MkDocs which allows you to copy verbatim arbitrary files in your build.

Why?

This plugin was created to solve mkdocs/mkdocs#2139 (at least some use-cases affected by it). Basically it's a work-around for the following (willingly) hard-coded chunk in MkDocs' sources:

# mkdocs/structure/files.py used by 
def get_files(config):
    """ Walk the `docs_dir` and return a Files collection. """
    files = []
    exclude = ['.*', '/templates']

    # ...

Note: one could achieve the same result using something like mkdocs-gen-files or mkdcos-simple-hooks, only with some more effort. The benefit of using mkdocs-copy dedicated plugin lies in its declarative API. It is also easily reusable.

Quick start

Say you want to add .htaccess files (if defined for a given folder/path):

# mkdocs.yml config file
plugins:
  - mkdocs-copy:
    add_per_path:
      - .htaccess

About

A MkDocs plugin that lets you copy (and maybe transform) arbitrary doc files to the build.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages