-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
✨ Add reference (code API) docs with PEP 727, add subclass with custom docstrings for BackgroundTasks
, refactor docs structure
#10392
Conversation
📝 Docs preview for commit df4c501 at: https://5419df85.fastapitiangolo.pages.dev |
If you install Black alongside mkdocstrings-python, it will use it to format long signatures (such as |
Thanks @pawamoy! Is there a way to render the types using the latest syntax, even if the source uses older syntax? For example, the code for some parameters is It would probably be something like running pyupgrade on the type before it is rendered or something like that... but not sure if it's possible (or maybe there's already a config for that I haven't found). |
There's no such option, but I'll see how we can make it happen. Also I suppose you cannot use |
Thanks @pawamoy!
I'm not fully sure, I might be able to do that, at least in some places. It's funny and ironic that I would recommend people not to use |
As long as you know what you're doing 😉 And it's only for 1 year and 11 months, until 3.9 is EOL 🤫 |
fastapi/applications.py
Outdated
""" | ||
--- | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pawamoy I'm noticing that to render the __init__()
parameters I need to have some non-empty docstring in the __init__()
method, even if there's already a class docstring...
Am I doing something wrong in the configs or is it expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that in the PR yes. That's probably an oversight (in the PEP 727 extension), I'll take a look :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now fixed by latest versions of Griffe and griffe-typingdoc 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! ...although I can't seem to make it work yet 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell me what is not working? I tried locally to remove the docstring from fastapi.FastAPI.__init__
and the parameters are correctly inserted into the class docs.
Awesome, thanks @pawamoy! 🚀 For some reason, I hadn't found the insiders installation, and now I see that it's quite open there... I was probably too tired and didn't see it 😅 🙈 |
📝 Docs preview for commit e2c3672 at: https://690c34e1.fastapitiangolo.pages.dev |
📝 Docs preview for commit c34b8c9 at: https://eca9a21b.fastapitiangolo.pages.dev |
BackgroundTasks
, refactor docs structure
📝 Docs preview for commit 77cb0c7 at: https://ecb1abc9.fastapitiangolo.pages.dev |
BackgroundTasks
, refactor docs structureBackgroundTasks
, refactor docs structure
📝 Docs preview for commit ac82b9e at: https://2124dde5.fastapitiangolo.pages.dev |
I'll tell you when griffe-typing-deprecated is up-to-date with latest Griffe so you can list it in mkdocs.yml 🙂 |
Thanks @pawamoy! For now, I'll merge and release this. 😎 🚀 |
Congrats! I'm amazed by your efficiency here: in just a few days you managed to document the (almost?) entire API 🤯 Also it's super exciting to see a decently-sized code base use PEP 727 docs 😄 It's looking great! |
Oh and for |
These were added to the Englisch docs in tiangolo#10392. I went through all instances of: * docs/index.md * docs/features.md * docs/fastapi-people.md in the rest of the docs and added this where missing. The PRs for the German translations (tiangolo#10283, tiangolo#10284, tiangolo#10285) already contain this change.
✨ Add reference (code API) docs with PEP 727, add subclass with custom docstrings for
BackgroundTasks
, refactor docs structure.