praiskup / argparse-manpage

Automatically build man-pages for your Python project
Apache License 2.0
41 stars 22 forks source link

Something like `argparse.build_manpages` dict #7

Open praiskup opened 6 years ago

praiskup commented 6 years ago

It could look like

argparse.build_manpages = {
    'ENVIRONMENT' = {
        'description': """ The description... """,
        'vars': {
            'CONFIG_FOO': "Description for CONFIG_FOO",
        }
    },
}

Each item could mean new section?

praiskup commented 1 year ago

I think I would prefer something like this:

class ManpageMetadata:
    description = None
    section = None

    def __init__(self, parser):
        parser._some_private_pointer = self

The ManpageMetadata could have any continuously growing API, in a "declarative" manner. The Manpage then could on its own identify the parser._some_private_pointer and use the provided data.

rrthomas commented 1 year ago

Does --include replace this?

praiskup commented 1 year ago

This RFE still seems appealing to me, even if we have --include. My plan was to migrate the https://github.com/fedora-copr/copr utilities to argparse-manpage generator, and see if this is or isn't needed.