Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sphinx-apidoc to create API reference (GH-309)
* Add some missing files to .gitignore * Remove duplicate open_in_browser from lxml.html.__all__ * Make ETreeXMLSchemaTestCase docstring Sphinx autodoc friendly * Fix outdated codespeak.net links in docstrings * Convert html/defs.py comment to be the module docstring * Use sphinx-apidoc to create the API reference instead of epydoc Epydoc is Python 2 only and unmaintained. sphinx-apidoc is run before the build step, to avoid duplicate entries being created. * Include the elements from html.builder in the API reference * Use Python 3.8 for coverage Travis job * Build html documentation in Travis
- Loading branch information
Showing
12 changed files
with
233 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
html: | ||
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" -d "$(BUILDDIR)/doctrees" ../html/api $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.abspath('../../src')) | ||
|
||
from lxml import __version__ as lxml_version | ||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = 'lxml' | ||
copyright = '2020, lxml dev team' | ||
author = 'lxml dev team' | ||
version = lxml_version | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.viewcode', | ||
'sphinx_rtd_theme', | ||
] | ||
|
||
language = 'en' | ||
|
||
exclude_patterns = ['_build'] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
|
||
html_logo = '../html/python-xml.png' | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
#html_static_path = ['_static'] | ||
|
||
html_theme_options = { | ||
'collapse_navigation': False, | ||
'titles_only': True, | ||
} | ||
|
||
# -- Extension configuration ------------------------------------------------- | ||
|
||
autodoc_default_options = { | ||
'ignore-module-all': True, | ||
'private-members': True, | ||
} | ||
|
||
autodoc_member_order = 'groupwise' | ||
|
||
# -- Options for todo extension ---------------------------------------------- | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
#todo_include_todos = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
lxml API Reference | ||
================== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
lxml | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.