Skip to content

Polish CPP docs, Minor Python Docs Fixes#11722

Closed
svenevs wants to merge 11 commits intopytorch:masterfrom
svenevs:polish-cpp-docs
Closed

Polish CPP docs, Minor Python Docs Fixes#11722
svenevs wants to merge 11 commits intopytorch:masterfrom
svenevs:polish-cpp-docs

Conversation

@svenevs
Copy link
Contributor

@svenevs svenevs commented Sep 14, 2018

CC: @goldsborough

Generic CPP Docs Stuff

  • Clean targets

    • Python: add -f so that a vanilla make clean doesn't formally fail ;)
    • CPP: has to be before the catch-all and should also delete generated api.
  • Simplify Doxyfile for maintainers 💥

  • CPP: separate source and build directories.

    • Local build times go from 15 minutes to 2 😱
    • CPP auto-doc pushing repo script thing to host online does not need to change (still just cd docs/cpp && make html followed by copying docs/cpp/build/html/**.
  • See HTML_OUTPUT in Doxyfile for how to easily compare doxygen html with Sphinx

  • fix FunctionImpl docs (nesting document-comments /// and /*scale=0.5*/ apparently confuses doxygen.

  • remove forward declaration to guarantee correct location extracted by exhale

CPP and Python conf.py Cleanup / HTML Theme "Fixes"

Separating into two categories since I cannot figure out how the python docs build. Somebody needs to test them and report back success or failure.

Removal of html_context['css_files']

Using html_context['css_files'] is apparently formally undefined behavior. See sphinx/#2442. Unfortunately, this took a long time to have an official fix in Sphinx. Sphinx 1.8 and later you can use html_css_files, but since the python docs are pinned at 1.7.9 (as well as CPP docs will break with Sphinx 1.8 if more files are documented), I'm adding the "old" setup(app) method. The sphinx 1.8 // cpp docs issues are something in breathe that will take a lot of effort to fix 😢

Removal of html_static_path

Setting html_theme_path is no longer necessary, Sphinx 1.6+ allow html theme's to set this in their setup(app) function (and the sphinx rtd theme does it correctly). In some (rare) cases it may actually create problems / conflicts.

I guess officially you could introduce convoluted logic to check if Sphinx <1.6 but I view that as pointless.


CPP docs html setup fixes / cleanup

  • html_context['css_files'] removal
  • remove html_static_path
  • verified as valid (works with Sphinx 1.7 and 1.8)

Python: html setup fixes / cleanup

  • html_context['css_files'] removal
  • remove html_static_path
  • verified as valid

- py docs: add `-f` to avoid failure when `build/` does not exist
- cpp docs: must be before catch-all and remove generated `api/`
@goldsborough
Copy link
Contributor

Thanks! 😊 I'll keep an eye on the PR

- Doxygen may provide multiple warnings about items in the build
  directory
- `grep -v` can give an exit code of 1 if warning match not found
  which will halt script from `set -e` at top.
@svenevs svenevs changed the title [WIP] Polish CPP docs, Minor Python Docs Fixes Polish CPP docs, Minor Python Docs Fixes Sep 18, 2018
- remove unsupported use of `html_context`
- let `html_theme` set `html_theme_path` (Sphinx 1.6+)
- remove unsupported use of `html_context`
- let `html_theme` set its `html_theme_path` (Sphinx 1.6+)
doxygen is choking on /// ... /*slope=0.5*/ for inline comment
Copy link
Contributor

@goldsborough goldsborough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infinite gratitude for working on this! 😊 Waiting for @soumith to stamp the Python doc changes

Copy link
Collaborator

@soumith soumith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks really good. Thanks a lot for working on this @svenevs !

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goldsborough is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Sep 18, 2018
Differential Revision: D9919120

Pulled By: goldsborough

fbshipit-source-id: bf14cbe4ab79524495957cb749828046af864aab
@vishwakftw
Copy link
Contributor

Considering this has been merged, is there any reason to keep it open?

@soumith
Copy link
Collaborator

soumith commented Sep 19, 2018

it was merged 18 hours ago via e585f2f

Weird that the PR didn't get auto-closed.

Closing via e585f2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants