Skip to content

Commit 8d4f45f

Browse files
authored
new theme (#2657)
Signed-off-by: Wenqi Li <[email protected]>
1 parent 141e9db commit 8d4f45f

File tree

10 files changed

+94
-44
lines changed

10 files changed

+94
-44
lines changed

docs/_static/custom.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
@import url('https://fonts.googleapis.com/css?family=Lekton:700|Roboto&display=swap');
2-
body{font-family:'Roboto',sans-serif;}.wy-side-nav-search>div.version{color:#222;}a:visited{color:#0285b0;}.wy-menu-vertical a:visited{color:#d9d9d9;}.wy-menu-vertical p.caption{color:#7cccc7;}
2+
body{font-family:'Roboto',sans-serif;}.wy-menu-vertical p.caption{color:#7cccc7;}
3+
*{font-variant-ligatures: none;}.autoclasstoc td {padding:0.2rem;line-height:normal;}
4+
dl.field-list>dt{word-break: normal}

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ scikit-image>=0.14.2
99
tensorboard
1010
commonmark==0.9.1
1111
recommonmark==0.6.0
12-
Sphinx==3.5.3
13-
sphinx-rtd-theme==0.5.2
12+
Sphinx
13+
pydata-sphinx-theme
1414
sphinxcontrib-applehelp
1515
sphinxcontrib-devhelp
1616
sphinxcontrib-htmlhelp

docs/source/api.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:github_url: https://github.com/Project-MONAI/MONAI
2+
3+
API Reference
4+
=============
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
apps
10+
transforms
11+
losses
12+
networks
13+
metrics
14+
optimizers
15+
data
16+
engines
17+
inferers
18+
handlers
19+
visualize
20+
utils

docs/source/conf.py

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
1313
import os
14-
import sys
1514
import subprocess
15+
import sys
1616

1717
sys.path.insert(0, os.path.abspath(".."))
1818
sys.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

9589
autoclass_content = "both"
9690
add_module_names = True
91+
source_encoding = "utf-8"
9792
autosectionlabel_prefix_document = True
9893
napoleon_use_param = True
94+
napoleon_include_init_with_doc = True
9995
set_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()]
111107
html_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
}
118128
html_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
}
125136
html_scaled_image_link = False
126137
html_show_sourcelink = True
127138
html_favicon = "../images/favicon.ico"
128139
html_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".
133146
html_static_path = ["../_static"]
134147
html_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)

docs/source/contrib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:github_url: https://github.com/Project-MONAI/MONAI
2+
3+
Development
4+
===========
5+
6+
For guidance on making a contribution to MONAI, see the `contributing guidelines
7+
<https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md>`_.

docs/source/highlights.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Modules overview
1+
# Modules Overview
22

33
MONAI aims at supporting deep learning in medical image analysis at multiple granularities.
44
This figure shows a typical example of the end-to-end workflow:

docs/source/index.rst

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,39 +45,26 @@ Technical documentation is available at `docs.monai.io <https://docs.monai.io>`_
4545
:maxdepth: 1
4646
:caption: Feature highlights
4747

48-
whatsnew_0_6.md
49-
whatsnew_0_5.md
48+
whatsnew
5049
highlights.md
5150

5251
.. toctree::
5352
:maxdepth: 1
54-
:caption: APIs
55-
56-
apps
57-
transforms
58-
losses
59-
networks
60-
metrics
61-
optimizers
62-
data
63-
engines
64-
inferers
65-
handlers
66-
visualize
67-
utils
53+
:caption: API Reference
54+
55+
api
6856

6957
.. toctree::
7058
:maxdepth: 1
7159
:caption: Installation
7260

7361
installation
7462

63+
.. toctree::
64+
:maxdepth: 1
65+
:caption: Contributing
7566

76-
Contributing
77-
------------
78-
79-
For guidance on making a contribution to MONAI, see the `contributing guidelines
80-
<https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md>`_.
67+
contrib
8168

8269

8370
Links

docs/source/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Installation guide
1+
# Installation Guide
22

33
## Table of Contents
44
1. [From PyPI](#from-pypi)

docs/source/whatsnew.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:github_url: https://github.com/Project-MONAI/MONAI
2+
3+
What's New
4+
==========
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
whatsnew_0_6.md
10+
whatsnew_0_5.md

monai/data/image_reader.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,16 @@ class ITKReader(ImageReader):
131131
132132
Args:
133133
channel_dim: the channel dimension of the input image, default is None.
134-
This is used to set `original_channel_dim` in the meta data, `EnsureChannelFirstD` reads this field.
135-
If None, `original_channel_dim` will be either `no_channel` or `-1`.
136-
- Nifti file is usually "channel last", so there is no need to specify this argument.
137-
- PNG file usually has `GetNumberOfComponentsPerPixel()==3`, so there is no need to specify this argument.
134+
This is used to set original_channel_dim in the meta data, EnsureChannelFirstD reads this field.
135+
If None, original_channel_dim will be either `no_channel` or `-1`.
136+
137+
- Nifti file is usually "channel last", so there is no need to specify this argument.
138+
- PNG file usually has `GetNumberOfComponentsPerPixel()==3`, so there is no need to specify this argument.
139+
138140
series_name: the name of the DICOM series if there are multiple ones.
139141
used when loading DICOM series.
140142
kwargs: additional args for `itk.imread` API. more details about available args:
141-
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/itkExtras.py
143+
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/itk/support/extras.py
142144
143145
"""
144146

0 commit comments

Comments
 (0)