-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option defaults with escape characters don't render correctly #111
Comments
I haven't played with Typer so it's not really supported. Can you provide a minimal reproduction repo (ideally including a |
Hi @stephenfin , 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? |
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:
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
I wonder if you see the same. Closing this as working as expected. |
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. |
Ah, a curiosity indeed 🙂 If you include |
Hi,
I am using a Typer CLI app, and making use of typer_click_object to generate my documentation. However I see that a default value that is a Path will render incorrectly in the documentation:
This is rendered by the following code:
And the following rst:
I must admit I do not know where this issue lies, or where I can try to figure it out, so this is my first attempt.
The text was updated successfully, but these errors were encountered: