-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconf.py
78 lines (59 loc) · 2.18 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python3
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
from pathlib import Path
import sys
import glob
import shutil
# Paths ------------------------------------------------------------------------
NPMX_ZEPHYR_BASE = Path(__file__).absolute().parents[1]
# Copy samples readmes
src_dir = NPMX_ZEPHYR_BASE / "samples"
dst_dir = NPMX_ZEPHYR_BASE / "doc" / "samples"
if os.path.exists(dst_dir):
shutil.rmtree(dst_dir)
for file in glob.glob(str(src_dir) + r'/**/*.rst'):
path_len = len(str(src_dir)) + 1
file_short = str(file[path_len:])
os.makedirs((dst_dir / file_short).parents[0])
shutil.copy(src_dir / file_short, dst_dir / file_short)
# General configuration --------------------------------------------------------
# The root document.
root_doc = 'index'
project = 'npmx-zephyr'
copyright = '2024, Nordic Semiconductor'
author = 'Nordic Semiconductor'
version = release = "1.1.0"
sys.path.insert(0, str(NPMX_ZEPHYR_BASE / "doc" / "_extensions"))
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"table_from_rows",
]
rst_epilog = """
.. include:: /links.txt
.. include:: /shortcuts.txt
"""
# Options for HTML output ------------------------------------------------------
html_theme = "sphinx_ncs_theme"
html_last_updated_fmt = "%b %d, %Y"
html_show_sourcelink = True
html_show_sphinx = False
html_theme_options = html_theme_options = {"standalone": True}
# Options for table_from_rows --------------------------------------------------
table_from_rows_base_dir = NPMX_ZEPHYR_BASE
table_from_sample_yaml_board_reference = "/includes/sample_board_rows.txt"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["venv"]