Giter VIP home page Giter VIP logo

Comments (5)

stephenfin avatar stephenfin commented on June 16, 2024

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.

morcef avatar morcef commented on June 16, 2024

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:
image

Click:
image

from sphinx-click.

stephenfin avatar stephenfin commented on June 16, 2024

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:

image

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.

morcef avatar morcef commented on June 16, 2024

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.

stephenfin avatar stephenfin commented on June 16, 2024

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)

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.