Skip to content
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

API documentation shows parameters without a space #24

Open
wrobell opened this issue Aug 7, 2023 · 14 comments
Open

API documentation shows parameters without a space #24

wrobell opened this issue Aug 7, 2023 · 14 comments

Comments

@wrobell
Copy link
Collaborator

wrobell commented Aug 7, 2023

For example I see

(hy.readstreamfilenamereader)

I would, probably, expect

(hy.read stream filename reader)

Screenshot (I hope as raising the issue from a phone :/)

image

@Kodiologist
Copy link
Member

Looks okay to me at both https://docs.hylang.org/en/master/api.html#hy.read and https://docs.hylang.org/en/stable/api.html#hy.read in Firefox 108 with mostly default settings:

screenshot

Are you sure this is our bug and not a bug in your web browser? Even if the CSS is wrong, I bet the CSS in question is upstream in the Read the Docs theme or something, and not in this repository.

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 8, 2023

I think this might be the problem in conf.py

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

I believe this is no longer required, and prevents loading of some of CSS (if I remember well) properly on Webkit based browsers.

@scauligi
Copy link
Member

scauligi commented Aug 8, 2023

Confirmed on MacOS Safari Version 16.5.2 (18615.2.9.11.10). Commenting out the html_theme_path setting didn't fix it for me either, seems to be some sort of issue with Safari collapsing whitespace (but I don't have time right now to dig into it).

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 8, 2023

I can confirm the issue with

  • Safari and DuckDuckGo webrowser on iOS - but both use the same Webkit engine (sigh)
  • Chromium on Linux

It is fine on Firefox indeed.

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 8, 2023

BTW. I tried to build documentation locally using Python 11 and Sphinx 7. I get error that sphinxcontrib.hydomain cannot be found. Manually:

>>> import sphinxcontrib.hydomain
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wrobell/projects/hy/.venv-3.11/lib/python3.11/site-packages/sphinxcontrib/hydomain.py", line 41, in <module>
    from sphinx.pycode.ast import parse as ast_parse
ImportError: cannot import name 'parse' from 'sphinx.pycode.ast' (/home/wrobell/projects/hy/.venv-3.11/lib/python3.11/site-packages/sphinx/pycode/ast.py)

This https://github.com/sphinx-doc/sphinx/pull/11371/files hints to use ast.parse.

Also

@Kodiologist
Copy link
Member

Try pip install -r requirements-dev.txt.

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 8, 2023

Try pip install -r requirements-dev.txt.

This is what I did, but I gave up seeing Sphinx 5 ;)

@Kodiologist
Copy link
Member

But it works. That's how the manual is built currently. Try it if you don't believe me.

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 8, 2023

I know, but there is no point dealing with Sphinx 5 to debug the original issue - maybe it is fixed in Sphinx 7.

@Kodiologist
Copy link
Member

Maybe, but you may also find it an uphill battle to get sphinxcontrib-hydomain to work with Sphinx 7.

@wrobell
Copy link
Collaborator Author

wrobell commented Aug 12, 2023

Maybe, but you may also find it an uphill battle to get sphinxcontrib-hydomain to work with Sphinx 7.

I might try. Any specific example of problems?

@Kodiologist
Copy link
Member

I don't remember. I've generally only done the minimum to get sphinxcontrib-hydomain when it breaks.

@Kodiologist
Copy link
Member

I can replicate this in Thorium 109, so that seems to confirm this issue is related to WebKit and its descendants. I also find that while hy:autofunction:: hy.read has the spacing issue, autofunction:: hy.read doesn't. I conclude that this is a problem with sphinxcontrib-hydomain.

@Kodiologist Kodiologist transferred this issue from hylang/hy Aug 14, 2023
@wrobell
Copy link
Collaborator Author

wrobell commented Sep 15, 2023

BTW. Hyrule uses different theme, and does not suffer from the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants