autodoc module¶
This module provides a class to create documentation automatically.
-
exception
autodoc.
SphinxError
[source]¶ Bases:
Exception
Exception raised when creating, building, or generating Sphinx docs.
-
class
autodoc.
SphinxProject
(package_dir, project_dir)[source]¶ Bases:
object
Representation of a Sphinx project.
-
build
(clean=False)[source]¶ Build the Sphinx project.
Parameters: clean (bool) – If True a clean build will be created.
Raises: - ValueError – Raised if the project and/or package does not exist.
- SphinxError – Raised if an error occured during the build.
-
create
(author, project_name=None, version='1')[source]¶ Create a new Sphinx project.
Parameters: Raises: - ValueError – Raised if the project already exists.
- ValueError – Raised if the package does not exist.
- SphinxError – Raised if an error occured during the creation.
-
generate_project_files
(sub_dir='')[source]¶ Generate the project files (*.rst files).
Parameters: sub_dir (str) – A sub-directory of the
project_source_dir
where the module documentation will be generated in.Raises: - ValueError – Raised if the project and/or package does not exist.
- SphinxError – Raised if an error occured during the generation.
-
quickstart
(author, project_name=None, version='1')[source]¶ A wrapper for creating, generating, and building documentation.
Parameters:
-
validate_package
()[source]¶ Validate the package.
Raises: ValueError – Raised if the package does not exist.
-
validate_project
()[source]¶ Validate the project.
Raises: ValueError – Raised if the project does not exist.
-
validate_project_and_package
()[source]¶ Validate the project and package.
Raises: ValueError – Raised if the project or package does not exist.
-
package_dir
¶ Return the package directory as a Path object.
Return type: Path
-
project_build_dir
¶ Return the project build directory.
Return type: Path
-
project_dir
¶ Return the project directory.
Return type: Path
-
project_source_dir
¶ Return the project source directory.
Return type: Path
-