-
Notifications
You must be signed in to change notification settings - Fork 68
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
[SYNPY-1345] Migrate to mkdocstrings #1023
[SYNPY-1345] Migrate to mkdocstrings #1023
Conversation
repo_name: synapsePythonClient | ||
|
||
# Navigation | ||
nav: |
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 nav section is the biggest thing to be concerned about for this ticket. This is everything for the first round of documentation that I thought we should include. This is based off the documentation from https://diataxis.fr/
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.
What do you think about adding navigation.tabs
and/or navigation.tabs.sticky
feature? Because the Python client docs is pretty big, I think adding tabs could be useful / more organized.
For some references, both mkdocstrings and Material for MkDocs use it for their docs site.
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.
when making http requests | ||
|
||
Typically, no parameters are needed:: | ||
Attributes: |
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 what it'll look like to convert the existing docstrings into google style. This style gives us the biggest flexibility and interoperability with mkdocstrings.
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.
Agreed, I think we can have an epic around converting everything to google style docs, and those can be good-first-tickets for the community to contribute to. They're also honestly just a lot easier to write...
It'll also be good tickets for all of us to contribute.
@@ -21,14 +21,49 @@ | |||
|
|||
@dataclass() | |||
class File: | |||
"""A file within Synapse. | |||
|
|||
Attributes: |
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.
Due to microsoft/pylance-release#4759 pylance does not support seeing attributes in the doc string and linking them in the hover document. You'll see in these files that the information is duplicated.
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.
Ahhh, I see. That's really unfortunate...
mkdocs.yml
Outdated
palette: | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
primary: teal |
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.
It's hard to see the Synapse logo using this color:
I tested some other colors, and these work a little better:
white
black
cyan
(though the green part of the Sage logo gets a little lost)
yellow
- but I consider this chaotic good 🙃
We can also move forward with a custom color too.
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.
mkdocs.yml
Outdated
name: Switch to dark mode | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
primary: deep purple |
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.
mkdocs-material>=9.4.14 | ||
mkdocstrings>=0.24.0 | ||
mkdocstrings-python>=1.7.5 | ||
termynal>=0.11.1 |
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.
Feel free to remove termynal
from the build if it's not utilized.
It's fun, though 😄
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.
That does look fun, that would add some dynamic-ness to our docs.
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 think I do want to leave it in. I'm not using it for anything yet, but it'll be nice to show for things like file transfers.
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 awesome, thanks!!!
My only nitpick is with the color palette used for the navbar.
|
||
Tip: Title for my tip. | ||
Testing what a tip looks like. | ||
|
||
Todo: | ||
* Testing what a todo looks like. | ||
* Testing what a todo looks like. | ||
|
||
Deprecated: | ||
Testing what a deprecated section looks like. | ||
|
||
I can put anything here for the title of a section: | ||
askldjfghasdkljfghasdklfhasd;ofgyadilfghadfklhgdklghdsklfghksdhfaglkh | ||
|
||
Raises: | ||
Exception: Testing what an exception looks like. | ||
|
||
Yields: | ||
Testing what a yield section looks like. | ||
|
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.
We can clean this up at a later date
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.
💯 LGTM! I added some comments, but I'm very pleased with this.
What we will need to do is be diligent about some of the potential broken links to the python client docs from the synapse help docs once we push to master
.
Thanks @thomasyu888 . My plan is to make a branch from develop and bring forward the minimum number of changes required to have a 1-to-1 (Or close to) transition from the current python client docs into this format. That way there are less things to review and go wrong. Once we are in the format than we have a great base to start adding all of these additional documents. |
Hello @BryanFauble! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
Problem:
Our previous documentation tool through Sphinx was a bit difficult to work with. It relied on RST files. It used sphinx docstrings format as well.
Solution:
Testing:
pip install .
root
synapsePythonClient directory you should see themkdocs.yml
. In this directory you can runmkdocs serve
to view the live files.mkdocs builds
is used to create thesite
directory when we serve these on a live server.