Git Product home page Git Product logo

Comments (3)

anntzer avatar anntzer commented on September 2, 2024 1

Oops, I realize the requirement for rst is not documented anywhere, indeed (I guess this is implied by the statement "Docstrings can use the standard Sphinx-style ... or Google- and Numpy-style docstrings (see examples/styles.py), which are converted using Napoleon [1]." at the top of features.rst).
I added that information explicitly to the docstring of run().

Adding support for markdown likely means plugging something like myst-parser (as I'll likely not want to get away from using docutils as core), which may require some work.

from defopt.

anntzer avatar anntzer commented on September 2, 2024

I don't mind adding support for definition_lists (or rather taking a PR that does so), but I suspect what you really want to write here is

import defopt

def main(*, arg: int) -> None:
    """Short tool description

    longer description

    Args:
        arg: description

    Output Format 2:

    - detail 1

    - detail 2

        - sub-detail 2.2

    - detail 3
    """
    pass

if __name__ == '__main__':
    defopt.run(main)

which I agree is a lot of whitespace, but that's rst's syntax (AFAICT) and I'm not going to change that here.

Now the above form does run into the error you reported at #123 and #123 (comment) does help, but the output's whitespace is pretty messed up so I'd much prefer a solution that yields better whitespace.

from defopt.

nh13 avatar nh13 commented on September 2, 2024

@anntzer I'll add it my list to make a PR for definition_list. Perhaps we can add to the docs that the description should be in RST. Are there other formats (e.g. github-flavored markdown, others)?

from defopt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.