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
Final Sphinx documentation w/ ReadTheDocs #172
Conversation
@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
17 similar comments
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
1 similar comment
@jbitton has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
lil update: @iAdityaEmpire, your fix for version.txt worked! let us know when you've updated this for the rest of the files zoe listed :) |
@jbitton Haha I think that was Zoe who updated the version.txt file, I was at school during the time. I'll be able to fix the existing issues by the end of day today. |
ohhh lol i didn't notice. okay, sounds good! no rush :) |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@jbitton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
you're the absolute best!!! these are my last super simple comments and then we can land this!!
docs/source/augly.image.rst
Outdated
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
augly.image.utils |
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.
since augly.image.utils doesn't exist anymore as an .rst file, should this be deleted 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.
@jbitton Yep I'll delete that
@@ -0,0 +1,109 @@ | |||
augly.text.augmenters package |
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.
since we deleted the other augmenters .rst files, let's delete this one too for consistency
docs/source/augly.text.rst
Outdated
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
augly.text.augmenters |
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.
and then make sure to remove this as well as necessary
docs/source/augly.text.rst
Outdated
|
||
.. automodule:: augly.text.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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.
make sure to remove this :D
docs/source/augly.video.rst
Outdated
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
augly.video.augmenters |
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.
make sure to remove augmenters since it doesn't exist anymore
@iAdityaEmpire just flagging that FYI this error is still happening when we import the diff! Did you try the solutions I suggested up here? |
@zpapakipos Oh that's weird -- I did try using |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@jbitton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@iAdityaEmpire has updated the pull request. You must reimport the pull request before landing. |
@jbitton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
@iAdityaEmpire this all looks amazing!!!! all the tests on the Meta side have passed successfully!!! thank you so much for all of your extra work to get this done :)
Thanks @jbitton! Glad to help. |
Summary
<Please summarize what you are trying to achieve, what changes you made, and how they acheive the desired result.>
What This Is
This is comprehensive documentation for AugLy with Sphinx docstring formatting under the hood with a Read the Docs theme to make augmentation parameters, return types, etc more readable and user-friendly.
How It Works
Sphinx is a documentation generator commonly used by the Python community. It also has its own docstring format.
Internal AugLy docstrings utilize tags such as
@param
or@returns
for labeling due to internal Facebook convention. However, Sphinx does not recognize these tags, opting for:
in favor of@
, among other changes.Luckily for us, Python docstring format
epytext
is very similar to AugLy (credit @Cloud9c), meaning that we can claim that we use epytext formatting and then convert it tosphinx
when necessary.Another problem: Sphinx requires explicit types labeled in the form of
:type
and:rtype
to display types once documentation is rendered. However, Python typehints (which AugLy uses generously) are not natively supported. Therefore we use an extension to Sphinx that autodetects typehints and adds them on the fly.In the end, Sphinx uses the module structure specified in
docs/source
with rST (filetype similar to Markdown) to generate a table of contents for our final documentation.How to Build Documentation Locally
git clone github.com/facebookresearch/AugLy
cd docs && pip install -r requirements.txt
docs
subdirectory. Then runmake html
to generate documentation. If you want to delete all these later, you can runmake clean
.docs/build
and openindex.html
Generating new documentation later
augly
subdirectory and add their.rst
files accordingly, but the process of detection needs to be triggered manually. Runsphinx-apidoc -o ./source ../augly
in the root directory to do so, and update thetoctree
inindex.rst
if necessary.Integration with ReadTheDocs
.readthedocs.yml
file specifies the configuration for these builds. By defaultffmpeg
andlibsndfile1
are based on C and are required as prerequisites before requirements indocs/requirements.txt
are installed (as RTD uses Ubuntu behind the scenes).docs
subdirectory at all, so all are read from the source folder. Updating the docstrings inaugly/<modality>
will be sufficient.