Comments (6)
@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.
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.
@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.
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:
- 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. - Adding a new parameter
style
, which can be eithertable
orplain
, 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.
@yudai-nkt 👍 The style=...
parameter sounds good, as well as plain
.
from mkdocs-click.
#25 is ready for your review, @florimondmanca!
from mkdocs-click.
Related Issues (20)
- Support asyncclick?
- Add to mkdocs wiki plugin overview HOT 1
- Multi-command modules not display correctly
- mkdocs serve command fails can't find module specified in :module: attribute HOT 6
- Is it possible to disable the repetition of --help option for every command? HOT 1
- Context/Options not being picked up with multi-commands
- Documentation only renders when there are at least two spaces at the end of .md file HOT 5
- Add option to exclude `hidden` commands, options and groups HOT 3
- Specify subcommands HOT 2
- Support for language-agnostic documentation HOT 2
- `remove_ascii_art` option doesn't work HOT 1
- Escape markdown special characters
- Respect clicks docstring `\b` and `\f` markers
- Generate the CLI documentation without first having to install the Python package
- Can't set up - getting `ModuleNotFoundError` HOT 1
- No output generated at all HOT 2
- Project Status HOT 7
- Indented ::: mkdocs-click blocks are not picked up
- Conflicts with front matter HOT 2
- Option to remove the top level header for the root command
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-click.