sphinx-contrib / spelling

A spelling checker for Sphinx-based documentation
https://sphinxcontrib-spelling.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
82 stars 41 forks source link

spellcheck without building `html` leads to `Unknown directive type: ...` #225

Open goekce opened 4 months ago

goekce commented 4 months ago

To recreate:

cd $(mktemp -d)
virtualenv venv
. ./venv/bin/activate
pip install myst-parser sphinx_book_theme git+https://github.com/sphinx-contrib/spelling
sphinx-quickstart
rm index.rst

Then edit conf.py as follows:

project = 'p'
copyright = '2024, a'
author = 'a'
extensions = [
    "myst_parser",
    "sphinxcontrib.spelling",
        ]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'venv']

html_theme = 'sphinx_book_theme'
html_static_path = ['_static']

source_suffix = {
    ".md": "markdown",
}

Create index.md as follows:

```{margin}
test

Note that `margin` is a valid directive in `sphinx_book_theme`.

Then spellcheck **without** building `html`:

```sh
sphinx-build -b spelling . _build

Leads to:

...
index.md:1: WARNING: Unknown directive type: 'margin' [myst.directive_unknown]
...

If I build html first, then I get no warning related to this directive. Can someone reproduce this issue?