Comments (5)
I haven't played with Typer so it's not really supported. Can you provide a minimal reproduction repo (ideally including a setup.py
or requirements.txt
file) so I or someone else can look at this?
from sphinx-click.
Hi @stephenfin ,
Sorry for the delay, but I have now set up https://github.com/morcef/sphinx-click-111 as a minimal reproduction.
I am unfortunately stuck on Python36, but I have created two branches in my repo, one for Python310 (main) and the latest versions of all dependencies, and one for Python36 (python36) with the highest compatible versions of the dependencies. Both of them seem to give the same output.
In addition to the bad path representation, I can also see that if I make a similar Click app, the default value isn't even displayed in the docs. Is there something I am doing wrong?
These are my output docs:
Typer:
from sphinx-click.
I don't think this is something I can fix. I'm not sure what's going on here, but it looks like something to do with your environment. This is what I see locally:
To get to this, I cloned the reproducer repo locally and removed the theme configurations since it wasn't necessary:
❯ git diff
diff --git docs/conf.py docs/conf.py
index 99063a0..c0eb07c 100644
--- docs/conf.py
+++ docs/conf.py
@@ -29,34 +29,15 @@ extensions = [
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
"sphinx_click",
- "sphinx_rtd_dark_mode",
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
-
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
-html_theme = 'sphinx-rtd-theme'
-html_static_path = ['_static']
-
-html_theme_options = {
- "logo_only": False,
- "display_version": True,
- "prev_next_buttons_location": "bottom",
- "style_external_links": False,
- "style_nav_header_background": "black",
- # Toc options
- "collapse_navigation": False,
- "sticky_navigation": True,
- "navigation_depth": 5,
- "includehidden": True,
- "titles_only": False,
-}
-
# General autodoc settings
autodoc_default_options = {
"members": True,
I then installed dependencies:
❯ virtualenv venv
❯ source venv/bin/activate
❯ pip install .
❯ pip install sphinx-click sphinx_autodoc_typehints
❯ make -C docs/ html
❯ python -m http.server -d docs/_build/html
Out of curiosity, what happens if you execute the following in your local environment?
>>> import pathlib
>>> str(pathlib.Path('/this/is/a/path'))
I see
'/this/is/a/path'
I wonder if you see the same.
Closing this as working as expected.
from sphinx-click.
Thank you @stephenfin for looking into this. It is a curiosity.
>>> import pathlib
>>> pathlib.Path("/this/is/a/path")
WindowsPath('/this/is/a/path')
>>> str(pathlib.Path("/this/is/a/path"))
'\\this\\is\\a\\path'
As you can see, I am currently on a Windows system.
I don't believe that should be an issue?
from sphinx-click.
Ah, a curiosity indeed 🙂 If you include '\this\is\a\path'
in a a rST document, it renders as thisisapath
because the backslashes are interpreted as escapes. We'd need to render the default values as literals (i.e. code
) to avoid this. I need to think about the implications of this.
from sphinx-click.
Related Issues (20)
- add build-backend to pyproject.toml
- 4.0.0: sphinx warnings `reference target not found` HOT 7
- Missing detection of envvars via auto_envvar_prefix-option HOT 1
- Extend \b rewrapping to click options HOT 2
- Nested subcommands improvement HOT 1
- Supports `.. click:example::` and `.. click:run::` directives HOT 3
- <class ‘click.core.Command’>” of type “scripts.my module:mycommand” is not click.Command or click.Group.”click.BaseCommand” HOT 1
- metavar in docs does not match metavar in help output HOT 2
- Missing show_default detection via context_settings. HOT 1
- _format_envvars does not seem to support auto_envvar_prefix on group HOT 1
- remove "Required argument" from every click arg HOT 1
- Sphinx_click not working with Read The Docs HOT 2
- Issue with sphinx 7.0 HOT 2
- "\b" prevents formatting HOT 1
- Support myst-parser HOT 3
- Document sub-command only
- Show list of commands HOT 1
- Tests fail with click 8.1.x HOT 1
- :nested: full doesn't work anymore HOT 3
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 sphinx-click.