Giter Club home page Giter Club logo

Comments (6)

florimondmanca avatar florimondmanca commented on August 20, 2024 1

@yudai-nkt You're welcome! I just realized there had been some contributor activity on this repo :-) Will be taking a look soon!

from mkdocs-click.

yudai-nkt avatar yudai-nkt commented on August 20, 2024

Thanks for creating mkdocs-click anyway! This package and mkdocstrings leave me no choice but to use Click as an argument parser and makes it possible to make a beautiful documentation for both CLI and Python API.

from mkdocs-click.

florimondmanca avatar florimondmanca commented on August 20, 2024

@yudai-nkt So I've taken a quick look at #12, and that's looking great.

What I'm thinking though is that we might want to let users decide which style they'd like, or at least introduce a table style in a backwards-compatible manner.

I guess what could be feasible would be a new :style: option on the mkdocs-click block, that would toggle which style should be used:

::: mkdocs-click
    :module: example.cli
    :command: main
    :style: table

If we do that, I'd expect the implementation to be purely additive, i.e. the current _make_options() should remain basically untouched, but we'd add a _make_table_options() function and switch between the two in _recursively_make_command_docs().

Makes sense?

from mkdocs-click.

yudai-nkt avatar yudai-nkt commented on August 20, 2024

I need to dig into your codebase to find out how the :option: notation works, but your suggestion totally makes sence.

I want to ask two questions before working on this feature:

  1. what should the default (i.e., current style) be named? plain came to my mind but I appreciate it if you have a better option name.
  2. Adding a new parameter style, which can be either table or plain, to _make_options() like this sounds more straight-forward to me rather than defining two functions. May I ask the reason you want purely additive implementation?
def _make_options(ctx, style="plain"):
    if style == "plain":
        # format options here
    elif style == "table":
        # format options here
    else:
        # raise some ValueError

from mkdocs-click.

florimondmanca avatar florimondmanca commented on August 20, 2024

@yudai-nkt 👍 The style=... parameter sounds good, as well as plain.

from mkdocs-click.

yudai-nkt avatar yudai-nkt commented on August 20, 2024

#25 is ready for your review, @florimondmanca!

from mkdocs-click.

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.