Skip to content

Commit 6db89fa

Browse files
committed
chore: move to exclude only logic based on toc.txt
Exclude all documents with an rst suffix not explicitly listed in the toc.txt. This removes a lot of dead logic and unnecessary config values. For a while this project mixed including and excluding document logic, where the include list was provided as an exhaustive description of everything through the toc.txt and a basic exclude list was provided as a sparse array populated manually in the OS tags.py file. This sparse array was supposed to change the way we searched for index files (previously referred to as toctreefiles), but ultimately any index files we needed were already listed in the main toc.txt. Signed-off-by: Randolph Sapp <[email protected]>
1 parent 99963c2 commit 6db89fa

36 files changed

+32
-375
lines changed

conf.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,6 @@
260260

261261
# -- Tag file loader ------------------------------------------------------
262262

263-
# Defaults
264-
exclude_patterns = []
265-
266263
FAMILY = os.environ.get("DEVFAMILY", "")
267264
OS = os.environ.get("OS", "")
268265
try:
@@ -277,6 +274,9 @@
277274
# Family Configuration file to use
278275
family_config_inputfile = f"{FAMILY}/{FAMILY}_{OS}_config.txt"
279276

277+
# Set document exclusion list from the tocfiles
278+
exclude_patterns = sectinc.generate_exclude_patterns(family_tocfiles)
279+
280280
# Hash table for Replacement Variables and Config Values
281281
family_replacevars, family_configvals = interpretvalues.read_familyvals(family_config_inputfile)
282282

@@ -299,16 +299,6 @@ def setup(app):
299299
print("family_configvals = ")
300300
print(family_configvals)
301301

302-
# Determine which sections need to be excluded
303-
sectinc.find_all_rst_files(app, exclude_patterns)
304-
sectinc.fill_docs_to_keep(app, family_tocfiles, 0)
305-
sectinc.set_excluded_docs(app, exclude_patterns)
306-
print(FAMILY + " exclude_patterns is:")
307-
print('[')
308-
for elem in exclude_patterns:
309-
print(elem)
310-
print(']')
311-
312302
# Load family config values into application context
313303
for key, value in family_configvals.items():
314304
app.add_config_value(key, value, 'env')

configs/AM335X/AM335X_linux_tags.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@
99
# The master toctree document.
1010
master_doc = 'devices/AM335X/linux/index'
1111

12-
# List of patterns, relative to source directory, that match files and
13-
# directories to ignore when looking for source files.
14-
exclude_patterns = ['rtos', 'android', 'linux/index.rst', 'devices/AM335X/rtos', 'devices/AM437X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/DRA821A', 'devices/AM62X', 'devices/AM62AX', 'devices/AM62PX', 'devices/AM62LX']
15-
1612
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
1713
sdk_os = 'linux'

configs/AM437X/AM437X_linux_tags.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@
99
# The master toctree document.
1010
master_doc = 'devices/AM437X/linux/index'
1111

12-
# List of patterns, relative to source directory, that match files and
13-
# directories to ignore when looking for source files.
14-
exclude_patterns = ['rtos', 'android', 'linux/index.rst', 'devices/AM437X/rtos', 'devices/AM335X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/DRA821A', 'devices/AM62X', 'devices/AM62AX', 'devices/AM62PX', 'devices/AM62LX']
15-
1612
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
1713
sdk_os = 'linux'

configs/AM57X/AM57X_linux_tags.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@
99
# The master toctree document.
1010
master_doc = 'devices/AM57X/linux/index'
1111

12-
# List of patterns, relative to source directory, that match files and
13-
# directories to ignore when looking for source files.
14-
exclude_patterns = ['rtos', 'android', 'linux/index.rst', 'devices/AM57X/rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/DRA821A', 'devices/AM62X', 'devices/AM62AX', 'devices/AM62PX', 'devices/AM62LX']
15-
1612
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
1713
sdk_os = 'linux'

configs/AM62AX/AM62AX_linux_tags.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,5 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62AX/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62Ax RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['android', 'files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/DRA821A', 'devices/AM62X', 'devices/AM62PX', 'devices/AM62LX']
19-
2013
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2114
sdk_os = 'linux'

configs/AM62LX/AM62LX_buildroot_tags.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62LX/buildroot/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62x RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['android', 'files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM62PX', 'devices/AM65X', 'devices/J7_Family', 'devices/J721E', 'devices/J7200', 'devices/J721S2', 'devices/J784S4', 'devices/DRA821A', 'devices/AM62AX', 'linux', 'debian']
19-
2013
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2114
sdk_os = 'buildroot'
2215

configs/AM62LX/AM62LX_debian_tags.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62LX/debian/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62x RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['android', 'files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM62X', 'devices/AM65X', 'devices/J7_Family', 'devices/J721E', 'devices/J7200', 'devices/J721S2', 'devices/J784S4', 'devices/DRA821A', 'devices/AM62AX']
19-
2013
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2114
sdk_os = 'debian'
2215

configs/AM62LX/AM62LX_linux_tags.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62LX/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62x RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['android', 'files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/DRA821A', 'devices/AM62AX','devices/AM62PX']
19-
2013
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2114
sdk_os = 'linux'
2215

configs/AM62PX/AM62PX_android_tags.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62PX/android/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62x RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM65X', 'devices/J7_Family', 'devices/J721E', 'devices/J7200', 'devices/J721S2', 'devices/DRA821A']
19-
#exclude_patterns = ['devices/AM62X']
20-
2113
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2214
sdk_os = 'android'
2315

configs/AM62PX/AM62PX_debian_tags.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
# The master toctree document.
1111
master_doc = 'devices/AM62PX/debian/index'
1212

13-
# List of patterns, relative to source directory, that match files and
14-
# directories to ignore when looking for source files.
15-
16-
# AM62x RTOS docs are not in this project, rather referenced externally,
17-
# so exclude 'rtos' folder along with others.
18-
exclude_patterns = ['android', 'files', 'rtos', 'devices/AM335X', 'devices/AM437X', 'devices/AM64X', 'devices/AM62X', 'devices/AM65X', 'devices/J7_Family', 'devices/J721E', 'devices/J7200', 'devices/J721S2', 'devices/J784S4', 'devices/DRA821A', 'devices/AM62AX', 'devices/AM62LX']
19-
2013
# OS for the build. Sphinx uses source/{sdk_os} when looking for doc inputs
2114
sdk_os = 'debian'
2215

0 commit comments

Comments
 (0)