forked from upsidedownlabs/upsidedownlabs.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.py
190 lines (170 loc) · 5.86 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys
import yaml
from pathlib import Path
from typing import Any, Dict
import pydata_sphinx_theme
sys.path.append(str(Path(".").resolve()))
project = 'upsidedownlabs.github.io'
copyright = '2024, Upside Down Labs'
author = 'Upside Down Labs'
# Configure PDF build and sidebar links
latex_documents = []
pdfs = []
with open('conf.yml', 'r') as conf_file:
conf_data = yaml.safe_load(conf_file)
pdf_build_all = True
pdf_build = []
if(conf_data["pdf_build"] != "all"):
for name in conf_data["pdf_build"].split(","):
pdf_build.append(name.lstrip())
pdf_build_all = False
for type, data in conf_data.items():
# PDFs
if(type == "PDFs"):
for board, data in conf_data["PDFs"].items():
name = board
path = data['path']
pdf = data.get('pdf', False)
# PDF build details
if(pdf and (name in pdf_build or pdf_build_all)):
tex_name = pdf.split('/')[-1]
pdfs.append((path, tex_name))
latex_documents.append((pdf, tex_name+".tex", "", author, "manual"))
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx_design",
"sphinxcontrib.youtube",
"sphinx_copybutton",
"sphinx.ext.todo",
]
todo_include_todos = False
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'env', ".venv"]
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_logo = "_static/logo/logo_black_hr_nbg.svg"
html_favicon = "_static/logo/logo_sqr_bgw.svg"
html_sourcelink_suffix = ""
html_last_updated_fmt = ""
html_theme_path = [pydata_sphinx_theme.Path()]
html_baseurl = "docs.upsidedownlabs.tech"
html_css_files = [
'css/custom.css',
]
# Pages entry without primary (left) sidebar
# html_sidebars = {
# }
html_theme_options = {
"external_links": [
{
"url": "https://www.digikey.com/en/supplier-centers/myupsidedownlab",
"name": "DigiKey",
},
{
"url": "https://www.mouser.com/manufacturer/upside-down-labs/",
"name": "Mouser",
},
{
"url": "https://www.tindie.com/stores/upsidedownlabs/",
"name": "Tindie",
},
{
"url": "https://www.amazon.in/stores/UpsideDownLabs/Homepage/page/476F15A3-A296-4D5F-A91A-D266CB247355",
"name": "Amazon India",
},
{
"url": "https://store.upsidedownlabs.tech/",
"name": "Store India",
},
{
"url": "https://t.ly/ExlaF",
"name": "GeM India",
}
],
"header_links_before_dropdown": 6,
"show_prev_next": True,
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/upsidedownlabs/",
"icon": "fa-brands fa-github",
"attributes": {"target": "_blank"},
},
{
"name": "Docs",
"url": "https://docs.upsidedownlabs.tech",
"icon": "fa-solid fa-book",
"attributes": {"target": "_blank"},
},
{
"name": "Discord",
"url": "https://discord.gg/SzYRVz8xRw",
"icon": "fa-brands fa-discord",
"attributes": {"target": "_blank"},
},
{
"name": "Instructables",
"url": "https://www.instructables.com/member/Upside%20Down%20Labs/instructables/",
"icon": "_static/logo/instructables.svg",
"type": "local",
"attributes": {"target": "_blank"},
},
{
"name": "Upside Down Labs",
"url": "https://upsidedownlabs.tech/",
"icon": "_static/logo/logo_sqr_bgw.svg",
"type": "local",
"attributes": {"target": "_blank"},
},
],
"logo": {
"image_dark": "_static/logo/logo_white_hr_nbg.svg",
},
"use_edit_page_button": True,
"show_toc_level": 1,
"navbar_align": "right",
"show_nav_level": 1,
"announcement": "Welcome to Upside Down Labs docs site!",
# "show_version_warning_banner": True,
"navbar_center": ["navbar-nav"],
"navbar_start": ["navbar-logo"],
"navbar_end": ["theme-switcher", "navbar-icon-links"],
# "navbar_persistent": ["search-button"],
"footer_start": ["copyright"],
"footer_end": ["last-updated"],
# "content_footer_items": ["last-updated"],
"secondary_sidebar_items": {
"**": ["page-toc", "edit-this-page", "sourcelink","pdf"]
},
}
html_context = {
"display_github": True,
"github_user": "upsidedownlabs",
"github_repo": "upsidedownlabs.github.io",
"github_version": "main",
"doc_path": "",
"conf_py_path": "",
"show_license": True,
"pages_url": "https://docs.upsidedownlabs.tech",
"pages_slug": "",
"docs_url": "https://docs.upsidedownlabs.tech",
"edit_page_url_template": "{{ my_vcs_site }}{{ file_name }}",
"edit_page_provider_name": "GitHub",
"my_vcs_site": "https://github.com/upsidedownlabs/upsidedownlabs.github.io/edit/main",
"pdfs": pdfs
}
# -- Options for LaTeX output --
latex_elements = {
"papersize": "a4paper",
"preamble": open("_static/latex/preamble.tex").read(),
}