sphinx-contrib / sphinx-contrib/autoprogram

No way to avoid sorting of program's sub-commands

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
48
Forks
24
Avg merge
2h 15m
Merged PRs (30d)
1

Description

Sub-commands of argument parser always get sorted in the Sphinx documentation page generated with 'autoprogram'. There's no good way to turn alphabet sorting off (except maybe tricking with OrderedDict class, which breaks other functionality).

In my use case sorting of sub-commands produces misleading documentation, and I want to avoid sorting.

In autoprogram.py:

choices = sorted(choices, key=lambda pair: pair[0])

I suggest adding an option for 'autoprogram', for example: ":no_sorting:".

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in autoprogram.py at the choices sorting line and trace how autoprogram options are parsed and applied. Define how a no-sorting option should affect generated Sphinx documentation, then verify that sub-command order is preserved when the option is used and remains sorted by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.