Skip to content

Commit c8edb95

Browse files
authored
[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
1 parent fe6cdc9 commit c8edb95

File tree

6 files changed

+38
-47
lines changed

6 files changed

+38
-47
lines changed

docs/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_build/
2-
api/
2+
autoapi/

docs/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ BUILDDIR = _build
1212
help:
1313
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1414

15-
.PHONY: help Makefile
15+
.PHONY: help Makefile clean
16+
17+
# The "clean" target is updated to remove the autoapi generated files as well.
18+
# Run "make clean" to ensure a completely fresh build.
19+
clean:
20+
rm -rf $(BUILDDIR) autoapi
1621

1722
# Catch-all target: route all unknown targets to Sphinx using the new
18-
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
23+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1924
%: Makefile
20-
rm -rf api/
21-
sphinx-apidoc --separate -H "Python API" -o ./api/ ../tilelang "../tilelang/language/ast*" "../tilelang/language/parser*" "../tilelang/libinfo*" "../tilelang/version*"
2225
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
# -*- coding: utf-8 -*-
2-
import os
3-
import sys
4-
5-
# import tlcpack_sphinx_addon
6-
7-
# -- General configuration ------------------------------------------------
8-
9-
sys.path.insert(0, os.path.abspath("../tilelang"))
10-
sys.path.insert(0, os.path.abspath("../"))
11-
12-
autodoc_mock_imports = ["torch", "tilelang.language.ast", "tilelang.language.parser"]
132

143
# General information about the project.
154
project = "Tile Language <br>"
165
author = "Tile Lang Contributors"
176
copyright = "2025-2025, %s" % author
187

198
# Version information.
20-
21-
# TODO: use the version from project metadata
229
with open("../VERSION", "r") as f:
2310
version = f.read().strip()
2411
release = version
@@ -27,15 +14,32 @@
2714
"sphinx_tabs.tabs",
2815
"sphinx_toolbox.collapse",
2916
"sphinxcontrib.httpdomain",
30-
"sphinx.ext.autodoc",
3117
"sphinx.ext.napoleon",
3218
"sphinx.ext.intersphinx",
3319
"sphinx_reredirects",
3420
"sphinx.ext.mathjax",
35-
"sphinx.ext.autosummary",
3621
"myst_parser",
22+
"autoapi.extension",
3723
]
3824

25+
autoapi_type = 'python'
26+
autoapi_dirs = ['../tilelang']
27+
28+
autoapi_options = [
29+
'members',
30+
'undoc-members',
31+
'show-inheritance',
32+
'show-module-summary',
33+
'special-members',
34+
]
35+
autoapi_keep_files = False # Useful for debugging the generated rst files
36+
37+
autoapi_generate_api_docs = True
38+
39+
autodoc_typehints = 'description'
40+
41+
autoapi_ignore = ["*language/ast*", "*version*", "*libinfo*", "*parser*"]
42+
3943
source_suffix = {
4044
'.rst': 'restructuredtext',
4145
'.md': 'markdown',
@@ -48,27 +52,18 @@
4852

4953
redirects = {"get_started/try_out": "../index.html#getting-started"}
5054

51-
source_suffix = [".md", ".rst"]
52-
5355
language = "en"
5456

5557
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.md", "**/*libinfo*", "**/*version*"]
5658

57-
# The name of the Pygments (syntax highlighting) style to use.
5859
pygments_style = "sphinx"
59-
60-
# A list of ignored prefixes for module index sorting.
61-
# If true, `todo` and `todoList` produce output, else they produce nothing.
6260
todo_include_todos = False
6361

6462
# -- Options for HTML output ----------------------------------------------
6563

6664
html_theme = "furo"
67-
6865
templates_path = []
69-
7066
html_static_path = ["_static"]
71-
7267
footer_copyright = "© 2025-2025 Tile Language"
7368
footer_note = " "
7469

@@ -91,11 +86,4 @@
9186
"github_repo": "tilelang",
9287
"github_version": "main/docs/",
9388
"theme_vcs_pageview_mode": "edit",
94-
# "header_logo": "/path/to/logo",
95-
# "header_logo_link": "",
96-
# "version_selecter": "",
9789
}
98-
99-
# # add additional overrides
100-
# templates_path += [tlcpack_sphinx_addon.get_templates_path()]
101-
# html_static_path += [tlcpack_sphinx_addon.get_static_path()]

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ deeplearning_operators/deepseek_mla
3939
:maxdepth: 1
4040
:caption: API Reference
4141

42-
api/modules
42+
autoapi/tilelang/index
4343
:::
4444

4545
:::{toctree}

docs/requirements.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
fastapi
22
pydantic
3-
sphinx == 5.2.3
4-
sphinx-reredirects==0.1.2
5-
sphinx-tabs == 3.4.1
6-
sphinx-toolbox == 3.4.0
7-
sphinxcontrib-napoleon==0.7
8-
sphinxcontrib_httpdomain==1.8.1
3+
sphinx
4+
sphinx-reredirects
5+
sphinx-tabs
6+
sphinx-toolbox
7+
sphinxcontrib-napoleon
8+
sphinxcontrib_httpdomain
99
furo
1010
uvicorn
1111
myst-parser
12+
sphinx-autoapi == 3.6.0
13+
astroid

maint/scripts/build_docs.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
python -m venv .venv
22
source .venv/bin/activate
3-
python -m pip install --upgrade pip
4-
python -m pip install -r requirements-test.txt
5-
python -m pip install -r docs/requirements.txt
6-
python -m pip install -e .
3+
python -m pip install --upgrade pip --no-user
4+
python -m pip install -r docs/requirements.txt --no-user
75

86
cd docs
97
make html

0 commit comments

Comments
 (0)