Skip to content

Commit e044f7b

Browse files
committed
Disable documentation generation for undocumented api
1 parent 016a484 commit e044f7b

File tree

7 files changed

+214
-210
lines changed

7 files changed

+214
-210
lines changed

chipflow_lib/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Chipflow library
3+
"""
4+
15
import importlib.metadata
26
import os
37
import sys
@@ -7,7 +11,6 @@
711

812
__version__ = importlib.metadata.version("chipflow_lib")
913

10-
1114
class ChipFlowError(Exception):
1215
pass
1316

chipflow_lib/platforms/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
"""
2+
Platform definititions
3+
----------------------
4+
5+
This module defines the functionality you use in you code to target the ChipFlow platform
6+
7+
"""
8+
19
from .silicon import *
210
from .sim import *
311
from .utils import *
12+
13+
import utils
14+
15+
__all__ = ['PIN_ANNOTATION_SCHEMA', 'PinSignature',
16+
'OutputPinSignature', 'InputPinSignature', 'BidirPinSignature',
17+
'load_pinlock', "PACKAGE_DEFINITIONS", 'top_interfaces']

chipflow_lib/platforms/utils.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,24 @@ def __init__(self, direction: io.Direction, width: int = 1, all_have_oe: bool =
9999
super().__init__(sig)
100100

101101
@property
102-
def direction(self):
102+
def direction(self) -> io.Direction:
103+
"The direction of the IO port"
103104
return self._direction
104105

105-
def width(self):
106+
def width(self) -> int:
107+
"The width of the IO port, in wires"
106108
return self._width
107109

108-
def options(self):
110+
def options(self) -> dict:
111+
"""
112+
Options set on the io port at construction
113+
114+
Valid options are:
115+
"all_have_oe": For a bidirectional port, each wire can
116+
have it's direction dynamically controlled seperately,
117+
so each wire also has a corresponding Output Enable wire.
118+
"init": the initial value that this io port will have at power-up and reset.
119+
"""
109120
return self._options
110121

111122
def annotations(self, *args):

docs/conf.py

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Add parent folder to path so we can pick up module
55
import os
66
import sys
7+
from pprint import pformat
8+
79
sys.path.insert(0, os.path.abspath('../../chipflow_lib'))
810

911
from chipflow_lib import __version__
@@ -25,51 +27,39 @@
2527
# -- General configuration
2628

2729
extensions = [
28-
'sphinx.ext.duration',
29-
'sphinx.ext.doctest',
3030
'sphinx.ext.autodoc',
31+
'sphinx.ext.autodoc.typehints',
32+
'sphinx.ext.doctest',
33+
'sphinx.ext.duration',
3134
'sphinx.ext.intersphinx',
35+
'sphinx.ext.napoleon',
3236
'autoapi.extension',
33-
'sphinx.ext.napoleon'
3437
]
3538

36-
html_theme = 'sphinx_book_theme'
39+
html_theme = 'furo'
3740
html_logo = '_static/chipflow-logo.svg'
3841
html_title = "ChipFlow Platform Documentation"
3942

40-
41-
html_sidebars = {
42-
'**': [
43-
'relations.html', # needs 'show_related': True theme option to display
44-
'searchbox.html',
45-
]
46-
}
47-
48-
html_static_path = ['_static']
49-
50-
html_theme_options = {
51-
"home_page_in_toc": True,
52-
"repository_url": "https://github.com/ChipFlow/chipflow-lib",
53-
"repository_branch": "master",
54-
"path_to_docs": "docs",
55-
"use_repository_button": True,
56-
"use_edit_page_button": True,
57-
"use_issues_button": True,
58-
"show_navbar_depth": 3,
59-
# "announcement": "<b>v3.0.0</b> is now out! See the Changelog for details",
60-
}
61-
6243
autodoc_typehints = 'description'
6344

64-
autoapi_dirs = ["../chipflow_lib"]
45+
autoapi_dirs = [
46+
"../chipflow_lib/platforms",
47+
"../chipflow_lib",
48+
]
49+
autoapi_generate_api_docs = True
50+
autoapi_template_dir = "_templates/autoapi"
51+
# autoapi_verbose_visibility = 2
52+
autoapi_keep_files = True
6553
autoapi_options = [
6654
'members',
67-
'undoc-members',
6855
'show-inheritance',
6956
'show-module-summary',
7057
'imported-members',
7158
]
7259

60+
# Exclude autoapi templates
61+
exclude_patterns = [autoapi_template_dir]
62+
7363
intersphinx_mapping = {
7464
'py': ('https://docs.python.org/3/', None),
7565
'amaranth': ('https://amaranth-lang.org/docs/amaranth/v0.5.4/', None),

docs/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ChipFlow Library Documentation
1111
1212
1313
.. toctree::
14+
:maxdepth: 2
15+
:caption: Contents:
1416

1517
chipflow-toml-guide
16-
18+
autoapi/index

0 commit comments

Comments
 (0)