# listed in BUILD.bazel will render onto the website. symlink_input("drake/doc/styleguide/jekyll_input.txt", temp_dir, copy=True, strip_prefix=[ "drake/doc/styleguide/", "styleguide/", ]) # Prepare the files for Jekyll. _add_title(temp_dir=temp_dir, filename="pyguide.md", title="Google Python Style Guide for Drake") # Run the documentation generator. check_call([ "/usr/bin/jekyll", "build", "--source", temp_dir, "--destination", out_dir, ]) # The filenames to suggest as the starting points for preview. return ["cppguide.html", "pyguide.html"] if __name__ == '__main__': main(build=_build, subdir="styleguide", description=__doc__.strip())
from drake.doc.defs import check_call, main, symlink_input def _build(*, out_dir, temp_dir): """Callback function that implements the bulk of main(). Generates into out_dir; writes scratch files into temp_dir. Both directories must already exist and be empty. """ # Create a hermetic copy of our input. This helps ensure that only files # listed in BUILD.bazel will render onto the website. symlink_input("drake/doc/pages_input.txt", temp_dir) # Run the documentation generator. check_call([ "jekyll", "build", "--source", os.path.join(temp_dir, "drake/doc"), "--destination", out_dir, ]) # The filename to suggest as the starting point for preview; in this case, # it's an empty filename (i.e., the index page). return [""] if __name__ == '__main__': main(build=_build, subdir="", description=__doc__.strip())
# Fix the formatting of deprecation text (see drake#15619 for an example). perl_statements = [ # Remove quotes around the removal date. r's#(removed from Drake on or after) "(....-..-..)" *\.#\1 \2.#;', # Remove all quotes within the explanation text, i.e., the initial and # final quotes, as well as internal quotes that might be due to C++ # multi-line string literals. # - The quotes must appear after a "_deprecatedNNNNNN" anchor. # - The quotes must appear before a "<br />" end-of-line. # Example lines: # <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000013">Deprecated:</a></b></dt><dd>"Use RotationMatrix::MakeFromOneVector()." <br /> # noqa # <dd><a class="anchor" id="_deprecated000013"></a>"Use RotationMatrix::MakeFromOneVector()." <br /> # noqa r'while (s#(?<=_deprecated\d{6}")([^"]*)"(.*?<br)#\1\2#) {};', ] while html_files: # Work in batches of 100, so we don't overflow the argv limit. first, html_files = html_files[:100], html_files[100:] check_call(["perl", "-pi", "-e", "".join(perl_statements)] + first, cwd=out_dir) # The nominal pages to offer for preview. return ["", "classes.html", "modules.html"] if __name__ == '__main__': main(build=_build, subdir="doxygen_cxx", description=__doc__.strip(), supports_modules=True, supports_quick=True)
# Run the documentation generator. os.environ["LANG"] = "en_US.UTF-8" check_call([ sphinx_build, "-b", "html", # HTML output. "-a", "-E", # Don't use caching. "-N", # Disable colored output. "-T", # Traceback (for plugin). "-d", join(temp_dir, "doctrees"), input_dir, out_dir, ]) # The filename to suggest as the starting point for preview; in this case, # it's an empty filename (i.e., the index page). return [""] # TODO(eric.cousineau): Do some simple linting if this is run under `bazel # test` (e.g. scan for instances of `TemporaryName`, scan for raw C++ types # in type signatures, etc). if __name__ == "__main__": main(build=_build, subdir="pydrake", description=__doc__.strip(), supports_modules=True)