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

BUG: reST section headings do not render #31

Closed
victorlin opened this issue Jan 19, 2023 · 1 comment
Closed

BUG: reST section headings do not render #31

victorlin opened this issue Jan 19, 2023 · 1 comment

Comments

@victorlin
Copy link

Description

reStructuredText headings do not render, and result in a CRITICAL build warning when run in nitpicky (-n) mode.

Steps to reproduce

  1. Create a file sample.py:

    import argparse
    
    
    def main():
        parser = argparse.ArgumentParser(
            description="""
    This is a section title
    -----------------------
    
    `I'm a link <http://www.google.com>`__
    """
        )
        parser.add_argument('cmd', help='execute a `command`')
        return parser
  2. Create a file index.rst:

    .. argparse::
       :filename: sample.py
       :func: main
  3. Create a file conf.py:

    extensions = [
        'sphinx.ext.autodoc',
        'sphinxarg.ext',
    ]
  4. Build it with nitpicky mode (sphinx-build . _build -n).

  5. Note this warning in the output:

    None:3: CRITICAL: Unexpected section title.
    
    This is a section title
    -----------------------
    

Built HTML shows the link but not the section title:

preview

victorlin added a commit to nextstrain/augur that referenced this issue Jan 19, 2023
The section headings resulted in warnings:

    None:8: CRITICAL: Unexpected section title.

    Comparison methods
    ==================
    None:36: CRITICAL: Unexpected section title.

    Distance maps
    =============

They rendered fine in the Development API page¹ but did not render on
the CLI page².

This seems like a bug with sphinx-argparse³. For now, use bold text to
avoid the warnings and allow the text to render on the CLI page.

¹ https://docs.nextstrain.org/projects/augur/en/stable/api/developer/augur.distance.html
² https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/distance.html
³ sphinx-doc/sphinx-argparse#31
victorlin added a commit to nextstrain/augur that referenced this issue Mar 8, 2023
The section headings resulted in warnings:

    None:8: CRITICAL: Unexpected section title.

    Comparison methods
    ==================
    None:36: CRITICAL: Unexpected section title.

    Distance maps
    =============

They rendered fine in the Development API page¹ but did not render on
the CLI page².

This seems like a bug with sphinx-argparse³. For now, use bold text to
avoid the warnings and allow the text to render on the CLI page.

¹ https://docs.nextstrain.org/projects/augur/en/stable/api/developer/augur.distance.html
² https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/distance.html
³ sphinx-doc/sphinx-argparse#31
victorlin added a commit to nextstrain/augur that referenced this issue Mar 9, 2023
The section headings resulted in warnings:

    None:8: CRITICAL: Unexpected section title.

    Comparison methods
    ==================
    None:36: CRITICAL: Unexpected section title.

    Distance maps
    =============

They rendered fine in the Development API page¹ but did not render on
the CLI page².

This seems like a bug with sphinx-argparse³. For now, use bold text to
avoid the warnings and allow the text to render on the CLI page.

¹ https://docs.nextstrain.org/projects/augur/en/stable/api/developer/augur.distance.html
² https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/distance.html
³ sphinx-doc/sphinx-argparse#31
victorlin added a commit to nextstrain/augur that referenced this issue Mar 21, 2023
The section headings resulted in warnings:

    None:8: CRITICAL: Unexpected section title.

    Comparison methods
    ==================
    None:36: CRITICAL: Unexpected section title.

    Distance maps
    =============

They rendered fine in the Development API page¹ but did not render on
the CLI page².

This seems like a bug with sphinx-argparse³. For now, use bold text to
avoid the warnings and allow the text to render on the CLI page.

¹ https://docs.nextstrain.org/projects/augur/en/stable/api/developer/augur.distance.html
² https://docs.nextstrain.org/projects/augur/en/stable/usage/cli/distance.html
³ sphinx-doc/sphinx-argparse#31
@ashb
Copy link
Collaborator

ashb commented May 1, 2024

I don't think this will really be fixable, it's tied in to how the sections get generated, sorry.

If someone can PR to fix this we'll review it, but right now this is a "sorry, wontfix"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants