1111# documentation root, use os.path.abspath to make it absolute, like shown here.
1212#
1313import os
14- import sys
1514import subprocess
15+ import sys
1616
1717sys .path .insert (0 , os .path .abspath (".." ))
1818sys .path .insert (0 , os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." , ".." )))
@@ -68,12 +68,6 @@ def generate_apidocs(*args):
6868 )
6969
7070
71- def setup (app ):
72- # Hook to allow for automatic generation of API docs
73- # before doc deployment begins.
74- app .connect ("builder-inited" , generate_apidocs )
75-
76-
7771# -- General configuration ---------------------------------------------------
7872
7973# Add any Sphinx extension module names here, as strings. They can be
@@ -94,8 +88,10 @@ def setup(app):
9488
9589autoclass_content = "both"
9690add_module_names = True
91+ source_encoding = "utf-8"
9792autosectionlabel_prefix_document = True
9893napoleon_use_param = True
94+ napoleon_include_init_with_doc = True
9995set_type_checking_flag = True
10096
10197# Add any paths that contain templates here, relative to this directory.
@@ -106,29 +102,55 @@ def setup(app):
106102# The theme to use for HTML and HTML Help pages. See the documentation for
107103# a list of builtin themes.
108104#
109- html_theme = "sphinx_rtd_theme "
105+ html_theme = "pydata_sphinx_theme "
110106# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
111107html_theme_options = {
108+ "external_links" : [{"url" : "https://github.com/Project-MONAI/tutorials" , "name" : "Tutorials" }],
112109 "collapse_navigation" : True ,
113- "display_version" : True ,
114- "sticky_navigation" : True , # Set to False to disable the sticky nav while scrolling.
115- "logo_only" : True , # if we have a html_logo below, this shows /only/ the logo with no title text
116- "style_nav_header_background" : "#FBFBFB" ,
110+ "icon_links" : [
111+ {
112+ "name" : "GitHub" ,
113+ "url" : "https://github.com/project-monai/monai" ,
114+ "icon" : "fab fa-github-square" ,
115+ },
116+ {
117+ "name" : "Twitter" ,
118+ "url" : "https://twitter.com/projectmonai" ,
119+ "icon" : "fab fa-twitter-square" ,
120+ },
121+ ],
122+ "collapse_navigation" : True ,
123+ "navigation_depth" : 3 ,
124+ "show_toc_level" : 1 ,
125+ "footer_items" : ["copyright" ],
126+ "navbar_align" : "content" ,
117127}
118128html_context = {
119- "display_github" : True ,
120129 "github_user" : "Project-MONAI" ,
121130 "github_repo" : "MONAI" ,
122131 "github_version" : "dev" ,
132+ "doc_path" : "docs/" ,
123133 "conf_py_path" : "/docs/" ,
134+ "VERSION" : version ,
124135}
125136html_scaled_image_link = False
126137html_show_sourcelink = True
127138html_favicon = "../images/favicon.ico"
128139html_logo = "../images/MONAI-logo-color.png"
140+ html_sidebars = {"**" : ["search-field" , "sidebar-nav-bs" ]}
141+ pygments_style = "sphinx"
129142
130143# Add any paths that contain custom static files (such as style sheets) here,
131144# relative to this directory. They are copied after the builtin static files,
132145# so a file named "default.css" will overwrite the builtin "default.css".
133146html_static_path = ["../_static" ]
134147html_css_files = ["custom.css" ]
148+ html_title = f"{ project } { version } Documentation"
149+
150+ # -- Auto-convert markdown pages to demo --------------------------------------
151+
152+
153+ def setup (app ):
154+ # Hook to allow for automatic generation of API docs
155+ # before doc deployment begins.
156+ app .connect ("builder-inited" , generate_apidocs )
0 commit comments