Wan2.1/docs/conf.py
Claude 28a931100b
docs: add Sphinx documentation framework
Sets up Sphinx documentation infrastructure for generating
comprehensive API documentation and user guides.

Sphinx Configuration (docs/conf.py):
- RTD (Read the Docs) theme
- Autodoc for automatic API documentation
- Napoleon for Google/NumPy style docstrings
- Intersphinx for cross-referencing external docs
- MyST parser for Markdown support
- Coverage and TODO extensions

Documentation Structure (docs/index.rst):
- Getting Started guides
- User Guide sections
- API Reference structure
- Development documentation
- Quick links and features overview
- System requirements
- Quick start examples

Build System (docs/Makefile):
- Standard Sphinx build targets
- HTML output generation
- Clean and build commands

Planned Documentation:
- Installation guide
- Quickstart tutorial
- Pipeline documentation
- Model architecture guides
- Configuration reference
- Distributed training guide

Build Commands:
- make html          # Build HTML documentation
- make clean         # Clean build directory
- make html-open     # Build and open in browser

Benefits:
- Professional API documentation
- Searchable reference material
- Improved discoverability
- Better user onboarding
- Integration with Read the Docs
2025-11-19 04:25:31 +00:00

129 lines
3.2 KiB
Python

"""
Sphinx configuration file for Wan2.1 documentation.
Copyright (c) 2025 Kuaishou. All rights reserved.
"""
import os
import sys
from datetime import datetime
# Add source directory to path
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project = 'Wan2.1'
copyright = f'{datetime.now().year}, Kuaishou'
author = 'Kuaishou'
release = '2.1.0'
version = '2.1'
# -- General configuration ---------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.githubpages',
'myst_parser', # For markdown support
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The suffix(es) of source filenames.
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
# The master toctree document.
master_doc = 'index'
# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_logo = None
html_favicon = None
html_theme_options = {
'canonical_url': '',
'analytics_id': '',
'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'style_nav_header_background': '#2980B9',
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
}
# -- Extension configuration -------------------------------------------------
# Napoleon settings (for Google/NumPy style docstrings)
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_preprocess_types = False
napoleon_type_aliases = None
napoleon_attr_annotations = True
# Autodoc settings
autodoc_default_options = {
'members': True,
'member-order': 'bysource',
'special-members': '__init__',
'undoc-members': True,
'exclude-members': '__weakref__'
}
autodoc_typehints = 'description'
autodoc_typehints_description_target = 'documented'
# Intersphinx mapping
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'torch': ('https://pytorch.org/docs/stable/', None),
'numpy': ('https://numpy.org/doc/stable/', None),
}
# Todo extension
todo_include_todos = True
# MyST parser options
myst_enable_extensions = [
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]