Unverified Commit c8edb957 authored by Wenhao Xie's avatar Wenhao Xie Committed by GitHub
Browse files

[Bugfix][Docs] Update documentation build process and configurations for autoapi support (#663)

* [Bugfix][Docs] Update documentation build process and configurations for autoapi support

* lint fix
parent fe6cdc9d
_build/
api/
\ No newline at end of file
autoapi/
\ No newline at end of file
......@@ -12,11 +12,14 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
.PHONY: help Makefile clean
# The "clean" target is updated to remove the autoapi generated files as well.
# Run "make clean" to ensure a completely fresh build.
clean:
rm -rf $(BUILDDIR) autoapi
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
rm -rf api/
sphinx-apidoc --separate -H "Python API" -o ./api/ ../tilelang "../tilelang/language/ast*" "../tilelang/language/parser*" "../tilelang/libinfo*" "../tilelang/version*"
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# -*- coding: utf-8 -*-
import os
import sys
# import tlcpack_sphinx_addon
# -- General configuration ------------------------------------------------
sys.path.insert(0, os.path.abspath("../tilelang"))
sys.path.insert(0, os.path.abspath("../"))
autodoc_mock_imports = ["torch", "tilelang.language.ast", "tilelang.language.parser"]
# General information about the project.
project = "Tile Language <br>"
......@@ -17,8 +6,6 @@ author = "Tile Lang Contributors"
copyright = "2025-2025, %s" % author
# Version information.
# TODO: use the version from project metadata
with open("../VERSION", "r") as f:
version = f.read().strip()
release = version
......@@ -27,15 +14,32 @@ extensions = [
"sphinx_tabs.tabs",
"sphinx_toolbox.collapse",
"sphinxcontrib.httpdomain",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx_reredirects",
"sphinx.ext.mathjax",
"sphinx.ext.autosummary",
"myst_parser",
"autoapi.extension",
]
autoapi_type = 'python'
autoapi_dirs = ['../tilelang']
autoapi_options = [
'members',
'undoc-members',
'show-inheritance',
'show-module-summary',
'special-members',
]
autoapi_keep_files = False # Useful for debugging the generated rst files
autoapi_generate_api_docs = True
autodoc_typehints = 'description'
autoapi_ignore = ["*language/ast*", "*version*", "*libinfo*", "*parser*"]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
......@@ -48,27 +52,18 @@ myst_enable_extensions = [
redirects = {"get_started/try_out": "../index.html#getting-started"}
source_suffix = [".md", ".rst"]
language = "en"
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.md", "**/*libinfo*", "**/*version*"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# A list of ignored prefixes for module index sorting.
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
html_theme = "furo"
templates_path = []
html_static_path = ["_static"]
footer_copyright = "© 2025-2025 Tile Language"
footer_note = " "
......@@ -91,11 +86,4 @@ html_context = {
"github_repo": "tilelang",
"github_version": "main/docs/",
"theme_vcs_pageview_mode": "edit",
# "header_logo": "/path/to/logo",
# "header_logo_link": "",
# "version_selecter": "",
}
# # add additional overrides
# templates_path += [tlcpack_sphinx_addon.get_templates_path()]
# html_static_path += [tlcpack_sphinx_addon.get_static_path()]
......@@ -39,7 +39,7 @@ deeplearning_operators/deepseek_mla
:maxdepth: 1
:caption: API Reference
api/modules
autoapi/tilelang/index
:::
:::{toctree}
......
fastapi
pydantic
sphinx == 5.2.3
sphinx-reredirects==0.1.2
sphinx-tabs == 3.4.1
sphinx-toolbox == 3.4.0
sphinxcontrib-napoleon==0.7
sphinxcontrib_httpdomain==1.8.1
sphinx
sphinx-reredirects
sphinx-tabs
sphinx-toolbox
sphinxcontrib-napoleon
sphinxcontrib_httpdomain
furo
uvicorn
myst-parser
sphinx-autoapi == 3.6.0
astroid
\ No newline at end of file
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-test.txt
python -m pip install -r docs/requirements.txt
python -m pip install -e .
python -m pip install --upgrade pip --no-user
python -m pip install -r docs/requirements.txt --no-user
cd docs
make html
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment