Skip to content

Commit 7c9b0b4

Browse files
committed
docs: Generate API
1 parent 94b9ccb commit 7c9b0b4

File tree

7 files changed

+68
-11
lines changed

7 files changed

+68
-11
lines changed

chipflow_lib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import sys
55
import tomli
66

7+
__version__ = importlib.metadata.version("chipflow_lib")
8+
79

810
class ChipFlowError(Exception):
911
pass

docs/_static/chipflow-logo.png

90 KB
Loading

docs/_static/chipflow-logo.svg

Lines changed: 18 additions & 0 deletions
Loading

docs/chipflow-toml-guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The ``project_name`` is a human-readable identifier for this project. If not set
3333

3434
The ``steps`` section allows overriding or addition to the standard steps available from `chipflow_lib`_.
3535

36-
For example, if you want to override the standard silicon preparation step, you could derive from :ref:`SiliconStep`, add your custom functionality
36+
For example, if you want to override the standard silicon preparation step, you could derive from :class:`chipflow_lib.steps.silicon.SiliconStep`, add your custom functionality
3737
and add the following to your `chipflow.toml`, with the appropriate Python `qualified name`_ :
3838

3939
.. code-block:: TOML

docs/conf.py

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import sys
77
sys.path.insert(0, os.path.abspath('../../chipflow_lib'))
88

9+
from chipflow_lib import __version__
10+
911
doctest_path = [os.path.abspath('..')]
1012

1113
# -- Project information
@@ -15,34 +17,62 @@
1517
author = 'ChipFlow Platform Team'
1618

1719
release = 'alpha'
18-
version = '0.1.0'
20+
version = __version__
21+
22+
master_doc = "index"
1923

2024
# -- General configuration
2125

2226
extensions = [
2327
'sphinx.ext.duration',
2428
'sphinx.ext.doctest',
2529
'sphinx.ext.autodoc',
26-
'sphinx.ext.autosummary',
2730
'sphinx.ext.intersphinx',
31+
'autoapi.extension',
2832
'sphinx.ext.napoleon'
2933
]
3034

31-
html_static_path = ['_static']
32-
html_logo = '_static/chipflow-logo.png'
33-
logo_only = True
3435
html_theme = 'sphinx_book_theme'
36+
html_logo = '_static/chipflow-logo.svg'
37+
html_title = "ChipFlow Platform Documentation"
38+
3539

3640
html_sidebars = {
3741
'**': [
3842
'relations.html', # needs 'show_related': True theme option to display
3943
'searchbox.html',
4044
]
4145
}
46+
47+
html_static_path = ['_static']
48+
49+
html_theme_options = {
50+
"home_page_in_toc": True,
51+
"repository_url": "https://github.com/ChipFlow/chipflow-lib",
52+
"repository_branch": "master",
53+
"path_to_docs": "docs",
54+
"use_repository_button": True,
55+
"use_edit_page_button": True,
56+
"use_issues_button": True,
57+
"show_navbar_depth": 3,
58+
# "announcement": "<b>v3.0.0</b> is now out! See the Changelog for details",
59+
}
60+
61+
autodoc_typehints = 'description'
62+
63+
autoapi_dirs = ["../chipflow_lib"]
64+
autoapi_options = [
65+
'members',
66+
'undoc-members',
67+
'show-inheritance',
68+
'show-module-summary',
69+
'imported-members',
70+
]
71+
4272
intersphinx_mapping = {
43-
'python': ('https://docs.python.org/3/', None),
44-
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
45-
'chipflow': ('https://docs.chipflow.io/', None),
73+
'py': ('https://docs.python.org/3/', None),
74+
'amaranth': ('https://amaranth-lang.org/docs/amaranth/v0.5.4/', None),
75+
# 'chipflow': ('https://docs.chipflow.io/', None),
4676
}
4777
intersphinx_disabled_domains = ['std']
4878

docs/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
chipflow-lib documentation
2-
==========================
1+
.. image: _static/logo-square.svg
2+
:width: 200px
3+
:class: sd-m-auto
4+
:name: landing-page-logo
5+
6+
7+
.. rubric: ChipFlow IC Design Platform
38
49
Contents
510
--------
611

712
.. toctree::
813

914
chipflow-toml-guide
15+

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies = [
2828
"python-dotenv>=1.0.1",
2929
"pydantic>=2.10.6",
3030
"sphinx-book-theme>=1.1.3",
31+
"sphinx-autoapi>=3.5.0",
3132
]
3233

3334
[project.scripts]

0 commit comments

Comments
 (0)