Skip to content

Compiling an exercise with solution results in WARNING: undefined label: on sphinx 7 and latest sphinx-exercise release #64

Open
@goekce

Description

@goekce

Describe the bug

context
When I compile a simple example, I get WARNING: undefined label: using sphinx 7.2.6

expectation
I expected no errors.

bug
Here's an error message I ran into...

$ make html
...
writing output... [100%] test
/home/u/projects/rt-systems/test/source/index.rst: WARNING: undefined label: ex1
generating indices... genindex done
...
.

Reproduce the bug

  1. create a virtualenv and install sphinx-exercise, sphinx-book-theme and myst-parser.
  2. use sphinx-quickstart with default settings.
  3. conf.py:
    • Add myst_parser and sphinx_exercise as extensions
    • change html_theme to sphinx_book_theme
    • source_suffix = { ".md": "markdown", }
  4. rename index.rst to index.md and add test.md to the index
  5. Use the following example:
# test                                                                                                                                                                                                                                       
    
```{exercise-start}    
:label: ex1    
```    
and maybe you wish to add a figure    
```{exercise-end}    
```    
    
```{solution-start} ex1    
```    
test    
    
```{solution-end}    
```

List your environment

Package                       Version
----------------------------- ----------
accessible-pygments           0.0.4
alabaster                     0.7.13
Babel                         2.14.0
beautifulsoup4                4.12.2
certifi                       2023.11.17
charset-normalizer            3.3.2
docutils                      0.20.1
idna                          3.6
imagesize                     1.4.1
Jinja2                        3.1.2
markdown-it-py                3.0.0
MarkupSafe                    2.1.3
mdit-py-plugins               0.4.0
mdurl                         0.1.2
myst-parser                   2.0.0
packaging                     23.2
pip                           23.3.2
pydata-sphinx-theme           0.15.1
Pygments                      2.17.2
PyYAML                        6.0.1
requests                      2.31.0
setuptools                    69.0.3
snowballstemmer               2.2.0
soupsieve                     2.5
Sphinx                        7.2.6
sphinx-book-theme             1.1.0
sphinx-exercise               0.4.1
sphinxcontrib-applehelp       1.0.7
sphinxcontrib-devhelp         1.0.5
sphinxcontrib-htmlhelp        2.0.4
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.6
sphinxcontrib-serializinghtml 1.1.9
typing_extensions             4.9.0
urllib3                       2.1.0
wheel                         0.42.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions