55
66import os
77import shutil
8-
8+ # At the top.
9+ import sphinx_bootstrap_theme
910
1011def copy_tutorials (app ):
1112 src = os .path .abspath ("../tutorials" )
@@ -20,14 +21,16 @@ def copy_tutorials(app):
2021
2122def setup (app ):
2223 app .connect ("builder-inited" , copy_tutorials )
24+ # app.add_stylesheet("my-styles.css")
25+ app .add_css_file ("custom.css" )
2326
2427
2528# -- Project information -----------------------------------------------------
2629# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
2730
2831project = "python-template"
29- copyright = "2025, Max Lindqvist "
30- author = "Max Lindqvist "
32+ copyright = "2025, Max"
33+ author = "Max"
3134
3235# -- General configuration ---------------------------------------------------
3336# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -36,14 +39,112 @@ def setup(app):
3639 "nbsphinx" ,
3740 "sphinx.ext.mathjax" ,
3841 "sphinx.ext.autodoc" ,
42+ "myst_parser" , # enable Markdown support
3943]
4044
41- templates_path = ["_templates" ]
4245exclude_patterns = []
4346
47+ # Recognize both .rst and .md
48+ source_suffix = {
49+ ".rst" : "restructuredtext" ,
50+ ".md" : "markdown" ,
51+ }
4452
4553# -- Options for HTML output -------------------------------------------------
4654# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4755
48- html_theme = "sphinx_rtd_theme"
56+ # html_theme = "furo"
57+ # conf.py
58+ # ...
59+
60+ # Activate the theme.
61+ html_theme = 'bootstrap'
62+ html_theme_path = sphinx_bootstrap_theme .get_html_theme_path ()
63+
64+ # (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24).
65+ # Path should be relative to the ``_static`` files directory.
66+ # html_logo = "my_logo.png"
67+
68+ # Theme options are theme-specific and customize the look and feel of a
69+ # theme further.
70+ html_theme_options = {
71+ # Navigation bar title. (Default: ``project`` value)
72+ 'navbar_title' : "python-template" ,
73+
74+ # Tab name for entire site. (Default: "Site")
75+
76+ 'navbar_site_name' : "Site" ,
77+
78+ # A list of tuples containing pages or urls to link to.
79+ # Valid tuples should be in the following forms:
80+ # (name, page) # a link to a page
81+ # (name, "/aa/bb", 1) # a link to an arbitrary relative url
82+ # (name, "http://example.com", True) # arbitrary absolute url
83+ # Note the "1" or "True" value above as the third argument to indicate
84+ # an arbitrary url.
85+ 'navbar_links' : [
86+ ("Quickstart" , "quickstart" ),
87+ ("Tutorials" , "tutorial" ),
88+ ("API" , "api" ),
89+ # ("Link", "http://example.com", True),
90+ ],
91+
92+ # Render the next and previous page links in navbar. (Default: true)
93+ 'navbar_sidebarrel' : False ,
94+
95+ # Render the current pages TOC in the navbar. (Default: true)
96+ 'navbar_pagenav' : False ,
97+
98+ # Tab name for the current pages TOC. (Default: "Page")
99+ 'navbar_pagenav_name' : "Page" ,
100+
101+ # Global TOC depth for "site" navbar tab. (Default: 1)
102+ # Switching to -1 shows all levels.
103+ 'globaltoc_depth' : 2 ,
104+
105+ # Include hidden TOCs in Site navbar?
106+ #
107+ # Note: If this is "false", you cannot have mixed ``:hidden:`` and
108+ # non-hidden ``toctree`` directives in the same page, or else the build
109+ # will break.
110+ #
111+ # Values: "true" (default) or "false"
112+ 'globaltoc_includehidden' : "true" ,
113+
114+ # HTML navbar class (Default: "navbar") to attach to <div> element.
115+ # For black navbar, do "navbar navbar-inverse"
116+ 'navbar_class' : "navbar inverse" ,
117+
118+ # Fix navigation bar to top of page?
119+ # Values: "true" (default) or "false"
120+ 'navbar_fixed_top' : "true" ,
121+
122+ # Location of link to source.
123+ # Options are "nav" (default), "footer" or anything else to exclude.
124+ 'source_link_position' : "footer" ,
125+
126+ # Bootswatch (http://bootswatch.com/) theme.
127+ #
128+ # Options are nothing (default) or the name of a valid theme
129+ # such as "cosmo" or "sandstone".
130+ #
131+ # The set of valid themes depend on the version of Bootstrap
132+ # that's used (the next config option).
133+ #
134+ # Currently, the supported themes are:
135+ # - Bootstrap 2: https://bootswatch.com/2
136+ # - Bootstrap 3: https://bootswatch.com/3
137+ 'bootswatch_theme' : "flatly" ,
138+
139+ # Choose Bootstrap version.
140+ # Values: "3" (default) or "2" (in quotes)
141+ 'bootstrap_version' : "3" ,
142+ }
143+
49144html_static_path = ["_static" ]
145+ templates_path = ['_templates' ]
146+
147+
148+ html_sidebars = {
149+ '**' : []
150+ }
0 commit comments