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

Refactor the extension to use a Sphinx Domain #34

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mikemckiernan
Copy link

@mikemckiernan mikemckiernan commented Feb 8, 2023

  • Add optional command index and optional commands-by-group index.
  • Optionally, print fully-qualified subcommand name in title.
  • Support commands:command role for intersphinx.
  • Prefer fully-qualified HREF targets:
    • Use targets like "#blah-sub-commands" as the primary target and move historic targets like "#Sub-commands" to secondary targets.
    • Preserve the older HREF, "#sub-commands", as a secondary target. In the HTML, this becomes a span just below the section element so that bookmarks continue to work even after adopting the update from this commit.

@mikemckiernan
Copy link
Author

Optimistically addresses the rest of #32. Might also address #11.

I stared at breaking this into smaller PRs, but the only separation that made sense was the full_subcommand_name and that seemed too small to bother with. Though, I am willing to revisit the idea if it helps.

@mikemckiernan
Copy link
Author

The majority of the doc updates are visible at https://sphinx-argparse--34.org.readthedocs.build/en/34/usage.html#printing-fully-qualified-sub-command-headings.

PLMK if you spot some uglies.

@mikemckiernan
Copy link
Author

@ashb , just checking if if there's anything I can answer or do to ease the review. PLMK and thanks.

@peeksake
Copy link

Bumping this.

mikemckiernan and others added 2 commits July 15, 2024 16:59
- Print fully-qualified subcommand name in title

- Support commands:command role for intersphinx

- Prefer fully-qualified HREF targets

  Use targets like "#blah-sub-commands" as
  the primary target and move historic targets
  like "#Sub-commands" to secondary targets.

  Preserve the older HREF, `sub-commands`, as a
  secondary target. In the HTML, this becomes a span
  just below the section element so that bookmarks continue
  to work even after adopting the update from this commit.
@AA-Turner AA-Turner changed the title Updates for 0.5.0 Refactor the extension to use a Sphinx Domain Jul 15, 2024
@AA-Turner
Copy link
Member

Remaining is to resolve sphinx_argparse_conf -- ideally we would add the permitted keys as config values rather than the indirection of a dict.

@mikemckiernan
Copy link
Author

mikemckiernan commented Aug 20, 2024

Thanks very, very much @AA-Turner for dusting off this PR and improving it. For your comment about confvals rather than the dictionary, is the idea that the conf.py would look like this?

sphinxarg_commands_index = True
sphinxarg_commands_index_in_toctree = True
sphinxarg_full_subcommand_names = True
sphinxarg_commands_by_group_index = True
sphinxarg_commands_by_group_index_in_toctree = True
sphinxarg_commands_by_group_index_file_suffix = "by-service"
sphinxarg_commands_by_group_index_title = "Commands by Service"

I don't have any strong feelings and I trust your judgement. PLMK what you have in mind and I'll see what I can do. Thanks again!

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

Successfully merging this pull request may close these issues.

3 participants