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

Consider using something other than urllib.parse to demonstrate API docs? Plus dummy examples #132

Open
smheidrich opened this issue Mar 29, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@smheidrich
Copy link

The API docs for urllib.parse included in the theme demos don't feature a single method, only functions and classes without methods, so IMHO it's kind of a bad example to show what typical API docs will look like. Would you be open to using another module for the API docs demo and/or maybe adding some dummy class examples to that page manually?

The latter option would also be good because another thing that differentiates themes is how well they deal with overly long package/module or class/function names, e.g. Alabaster vs Insipid:

image showing overly long class name leading to horizontal scrollbar in Alabaster, which looks bad   image showing overly long class name leading to mid-word break in Insipid, which looks fine

As such names are rare in Python's standard library, the only (?) way to get this to show would probably be dummy examples. Although maybe they should be on a separate page so people aren't put off themes just because of this edge case.

Thoughts?

@andrei-korshikov
Copy link

andrei-korshikov commented Aug 19, 2023

Also urllib.parse isn't good due to incorrect arguments rendering (well, maybe rendering is correct, but docstrings are not). You can see it on above Insipid screenshot.

Look at qs: percent-encoded query string to be parsed string, qs is not bold. Next string keep_blank_values: flag indicating whether blank values in is bold, but that's not right behavior, only parameter name should be bold.

@pradyunsg
Copy link
Collaborator

If someone knows of an existing package to exercise this, I'll happily reuse that. Absent that, I'd also be OK with adapting the demo documentation to use a custom .py file to run autodoc on.

@pradyunsg pradyunsg added the enhancement New feature or request label Aug 20, 2023
@stevepiercy
Copy link

I'm not sure if any of Pyramid's API has better docstrings. At least it renders without errors, unlike urllib.

python3.12/urllib/parse.py:docstring of urllib.parse.quote:13: ERROR: Unexpected indentation.

I would suggest registry.

I'm happy to submit a PR if any of these are agreeable to others.

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

No branches or pull requests

4 participants