Skip to content

Support plain .rst files as example inputs #1511

@timhoffm

Description

@timhoffm

Summary of the discussion in #1499 (comment) and following posts:

For the given file structure

    └── examples
        ├── script_example.py
        ├── text_example.rst
        └── GALLERY_HEADER.rst

I've envisioned that it just picks up any .rst as it picks up any .py, without the need to explicitly mention them.

Basically, the conf

sphinx_gallery_conf = {
    ...
    'example_extensions': {'.py', '.rst'}
}
  • The special files GALLERY_HEADER.rst / README.rst are always be excluded.
  • This is an opt-in feature, i.e. 'example_extensions': {'.py',} stays as the default. and people have to add '.rst' to enable this.

Note: I'm currently working on this and have some small perparatory refactoring PRs (#1508, #1509, #1510) - just to let you know in which context they have been created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions