How to use third-party python plugins\extensions?

643 views Asked by At

I've read on the docs that only few plugins are pre-installed in the virtualenv where the build happens. How can I use the read the docs service with custom plugins then?

I am using mkdocs to build a little documentation, in the mkdocs.yml configuration file I've added the following extensions:

markdown_extensions:
    - smarty

    - admonition

    #https://pythonhosted.org/Markdown/extensions/abbreviations.html
    - abbr

    #https://pythonhosted.org/Markdown/extensions/definition_lists.html
    - def_list

    #https://pythonhosted.org/Markdown/extensions/footnotes.html
    - footnotes

    #https://facelessuser.github.io/pymdown-extensions/
    - pymdownx.emoji:
        emoji_generator: !!python/name:pymdownx.emoji.to_png

    - pymdownx.details
    - pymdownx.superfences
    - pymdownx.caret
    - pymdownx.mark

In the local environment the preview served with mkdocs serve is working fine, when deploying to read the docs (via a connected github repo) the build fails because it can't find the pymdownx plugins but I thought that they would have been automatically fetched by RTD apart from the default plugins present in the build env.

1

There are 1 answers

0
Waylan On

AFAIK, Read the Docs (RTD) does not support using third-party extensions. In fact, RTD only supports MkDocs version 0.14. However, MkDocs has had multiple additional releases since (currently up to 0.16), each of which has fixed multiple bugs and added various features.

RTD is unique among hosts for MkDocs. For all other hosts, you need to build the site locally before pushing to the host. This allows you to ensure you have an environment suited for your build. However, RTD builds the site on there servers, which means you are stuck with their environment, which may or may not fit your needs.