Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Config error when sphinx_gallery_conf["source_suffix"] is set #1493

@echedey-ls

Description

@echedey-ls

https://github.com/sphinx-gallery/sphinx-gallery/blob/77fbb9f6dd3174e58067f15083d01dcd3084baa7/doc/getting_started.rst?plain=1#L110C1-L114C51

Does this statement still hold true? I'm using sphinx-gallery v0.19.0, and I got this ConfigError.

Running Sphinx v8.2.3
loading translations [en]... done

Configuration error!

Versions
========

* Platform:         win32; (Windows-10-10.0.19045-SP0)
* Python version:   3.12.4 (CPython)
* Sphinx version:   8.2.3
* Docutils version: 0.21.2
* Jinja2 version:   3.1.6
* Pygments version: 2.19.2

Last Messages
=============

None.

Loaded Extensions
=================

None.

Traceback
=========

      File "...\root\venv\win\Lib\site-packages\sphinx_gallery\gen_gallery.py", line 204, in _check_extra_config_keys
        raise ConfigError(msg.strip())
    sphinx.errors.ConfigError: Unknown key(s) in sphinx_gallery_conf:
    'source_suffix'

My relevant conf.py sections are:

extensions = [
    "sphinx.ext.mathjax",
    "sphinx.ext.extlinks",
    "sphinx_gallery.gen_gallery",
]

# -- Options for sphinx_gallery -----------------------------------------------
sphinx_gallery_conf = {
    "source_suffix": ".rst",  # source file suffix (GALLERY_HEADER.rst)
    "examples_dirs": "../../examples",  # path examples folder
    "gallery_dirs": "_auto_gallery",  # generated output directory
    "filename_pattern": "/*",  # unset filtering by prefix pattern
    "line_numbers": True,  # add line numbers to code blocks
}

By not specifying it, the documentation gets built correctly - my file is GALLERY_HEADER.rst btw. I think this was just overseen.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions