sphinxnotes-mock

Documentation Status Open Source License PyPI Package PyPI Package Downloads GitHub Repository

Introduction

Sphinx extension for masking unsupported directives and roles without modifying documents.

Note

For now, only directive is supported

It is especially useful when a certain directive/role is provided by an incompatible extension, or the directive/roles is incompatible with your current buidler or theme.

Getting Started

Note

We assume you already have a Sphinx documentation, if not, see Getting Started with Sphinx.

First, downloading extension from PyPI:

$ pip install sphinxnotes-mock

Then, add the extension name to extensions configuration item in your conf.py:

extensions = [
          # …
          'sphinxnotes.mock',
          # …
          ]

The current theme (furo) supports secondary sidebar for showing local table of contents, the contents directive is no longer needed.

So we can hide it with this extension, added directive name “contents” to the mock_directives Configuration item:

mock_directives = [
    'contents',
    'foo',
    ('bar', 'literal'),
]

You can see there is a contents directive in the source code of this pages,

reStructuredText
.. contents::
Result

Contents

The Sphinx Notes Project

The project is developed by Shengyu Zhang, as part of The Sphinx Notes Project.

The Sphinx Notes Project