Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate label warning from headings in module docstrings #829

Open
anibali opened this issue Nov 21, 2023 · 1 comment
Open

Duplicate label warning from headings in module docstrings #829

anibali opened this issue Nov 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@anibali
Copy link

anibali commented Nov 21, 2023

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

docutils 0.20.1
sphinx 7.2.6

What operating system are you using?

Linux

Describe the Bug

Consider the use case of including headings in top-level module docstrings. For example:

"""The Foo module.

Introduction
============

Fantastic things await you in the Foo module.

More
----
Some more
"""

Now suppose that there are multiple modules with the same headings in their docstrings. If we attempt to document these modules by using automodule from separate markdown files (via eval-rst), we get "WARNING: duplicate label [...]". This seems to only affect "top-level" headings (e.g., "Introduction" in the above snippet, but not "More"). This warning does not occur when using automodule from .rst files instead of .md files.

Expected Behavior

There should be no "duplicate label" warning.

To Reproduce

  1. Install Sphinx and MyST-Parser
  2. Clone https://github.com/anibali/bug-myst-duplicate-label
  3. Run sphinx-build docs build/html

To see how this issue does not affect .rst files, convert both myproj_bar.md and myproj_foo.md to restructured text. For example, rename myproj_bar.md to myproj_bar.rst and change its content to:

myproj.bar module
=================

.. automodule:: myproj.bar
@anibali anibali added the bug Something isn't working label Nov 21, 2023
Copy link

welcome bot commented Nov 21, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant