Skip to content

Commit 2187b9b

Browse files
authored
Switch to furo theme (#297)
2 parents 70274d1 + d9d51ea commit 2187b9b

File tree

16 files changed

+84
-116
lines changed

16 files changed

+84
-116
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@ Steps to build this documentation locally:
112112
```
113113

114114
where `{width}` and `{height}` are the values already present in the existing `width` and `height` XML attributes.
115-
- Load SVGs in HTML `object` elements with the `raw:: html` directive to preserve hyperlinks and scaling:
115+
- Embed SVGs with the `raw:: html` directive to preserve hyperlinks. Since the `svg-flowchart` container scales SVGs to the page width, add a link below to view them at their original scale:
116116

117117
```rst
118-
.. raw:: html
118+
.. container:: svg-flowchart
119119
120-
<object data="../_static/path/to/chart.svg" type="image/svg+xml"></object>
120+
.. raw:: html
121+
:file: ../_static/path/to/chart.svg
122+
123+
`Open image <../_static/path/to/chart.svg>`_
121124
```
122125

123126
<a id="markdown-tutorials" name="tutorials"></a>

docs/_sources/_static/custom.css

Lines changed: 15 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,20 @@
1-
:root {
2-
--bg-dark: #11303D;
3-
--bg-light: #F0F0F0;
1+
/* docs version dropdown: top bar */
2+
.brand > select {
3+
background: transparent;
4+
border: none;
5+
color: var(--color-header-text);
46
}
57

6-
html {
7-
background-color: var(--bg-dark, #11303D);
8+
/* docs version dropdown: side bar */
9+
.sidebar-brand-text > select {
10+
background-color: transparent;
11+
border: none;
12+
color: var(--color-sidebar-link-text--top-level);
13+
text-decoration: underline;
14+
text-decoration-color: var(--color-link-underline);
815
}
916

10-
body {
11-
background-color: var(--bg-light, #F0F0F0);
12-
}
13-
14-
div.body {
15-
max-width: 100%;
16-
}
17-
div.bodywrapper p {
18-
margin-block: 0;
19-
}
20-
div.bodywrapper section {
21-
background-color: white;
22-
padding: 0 20px 30px 20px;
23-
}
24-
div.bodywrapper section > p {
25-
padding-bottom: 1ex;
26-
}
27-
div.bodywrapper section h2 {
28-
margin-block-start: 0;
29-
padding-block-start: 0.83em;
30-
}
31-
div.citation p {
32-
display: inline;
33-
}
34-
div.flowchart-container {
35-
max-width: 1200px;
36-
}
37-
div.footer {
38-
background-color: var(--bg-dark, #11303D);
39-
}
40-
div.sphinxsidebar {
41-
background-color: var(--bg-light, #F0F0F0);
42-
}
43-
44-
object {
45-
max-width: 100%;
46-
}
47-
48-
.bibtex .brackets::before {
49-
content: "[";
50-
}
51-
.bibtex .brackets::after {
52-
content: "]"
53-
}
54-
55-
.bibtex.label {
56-
display: grid;
57-
}
58-
59-
section[id^="Tutorial:"] p img {
60-
max-width: 80%;
17+
.svg-flowchart > svg {
18+
width: 100%;
19+
height: auto;
6120
}

scripts/versionList.js renamed to docs/_sources/_static/versionList.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ function createDropdown(here) {
2424
function versionDropdown() {
2525
const here = window.location.href;
2626
const dochome = "https://" + here.split('/').slice(2, 5).join('/');
27-
const navTitles = document.getElementsByClassName("nav-item-0");
27+
const navTitles = document.querySelectorAll(".brand,.sidebar-brand-text");
2828
createDropdown(here).then(dropdown => {
2929
for (let item of navTitles) {
30+
item.parentElement.removeAttribute("href");
3031
let newTitle = document.createElement("div");
3132
let newTitlePrefix = document.createElement("a");
3233
newTitlePrefix.setAttribute("href", dochome);

docs/_sources/_templates/layout.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
gtag('js', new Date());
1010
gtag('config', 'UA-19224662-10');
1111
</script>
12-
<script defer src="https://fcp-indi.github.io/scripts/versionList.js"></script>
1312
{% endblock %}

docs/_sources/conf.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def yaml_to_rst(path):
141141
extensions = [
142142
'sphinx.ext.autodoc',
143143
'sphinxcontrib.bibtex',
144-
'sphinxcontrib.fulltoc',
145144
'sphinx.ext.ifconfig',
146145
'sphinx.ext.intersphinx',
147146
'sphinx.ext.mathjax',
@@ -172,7 +171,7 @@ def yaml_to_rst(path):
172171

173172
# General information about the project.
174173
project = 'C-PAC'
175-
copyright = '2012‒2022, C-PAC Developers. C-PAC is licensed under LGPL-3' \
174+
copyright = '2012‒2023, C-PAC Developers. C-PAC is licensed under LGPL-3' \
176175
'.0-or-later'
177176
# The version info for the project you're documenting, acts as replacement for
178177
# |version| and |release|, also used in various other places throughout the
@@ -408,25 +407,7 @@ def _unireplace(release_note, unireplace):
408407

409408
# The theme to use for HTML and HTML Help pages. See the documentation for
410409
# a list of builtin themes.
411-
html_theme = 'classic'
412-
413-
# Theme options are theme-specific and customize the look and feel of a theme
414-
# further. For a list of options available for each theme, see the
415-
# documentation.
416-
html_theme_options = {
417-
'relbarbgcolor': '#0067a0',
418-
'sidebarbgcolor': '#f0f0f0',
419-
'sidebartextcolor': '#000000',
420-
'sidebarlinkcolor': '#0067a0',
421-
'headbgcolor': '#919d9d',
422-
'headtextcolor': '#e4e4e4'
423-
}
424-
425-
# Add any paths that contain custom themes here, relative to this directory.
426-
html_theme_path = ['../Themes']
427-
html_css_files = [
428-
'custom.css',
429-
]
410+
html_theme = 'furo'
430411

431412
# The name for this set of Sphinx documents. If None, it defaults to
432413
# '<project> v<release> documentation'.
@@ -449,6 +430,14 @@ def _unireplace(release_note, unireplace):
449430
# so a file named 'default.css' will overwrite the builtin 'default.css'.
450431
html_static_path = ['_static']
451432

433+
# These paths are either relative to html_static_path
434+
# or fully qualified paths (eg. https://...)
435+
html_css_files = [
436+
'custom.css',
437+
]
438+
html_js_files = [
439+
('versionList.js', {'defer': 'defer'})]
440+
452441
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
453442
# using the given strftime format.
454443
# html_last_updated_fmt = '%b %d, %Y'
@@ -457,15 +446,6 @@ def _unireplace(release_note, unireplace):
457446
# typographically correct entities.
458447
# html_use_smartypants = True
459448

460-
# Custom sidebar templates, maps document names to template names.
461-
html_sidebars = {
462-
'**': [
463-
'localtoc.html',
464-
# 'globaltoc.html',
465-
'searchbox.html'
466-
]
467-
}
468-
469449
# Additional templates that should be rendered to pages, maps page names to
470450
# template names.
471451
# html_additional_pages = {}

docs/_sources/developer/continuous_integration.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Continuous Integration
33

44
Our continous integration flow relies on GitHub Actions, GitHub Container Registry, CircleCI and Docker Hub. GitHub Actions builds staging images based on changes to Dockerfiles and pushes those images to GitHub Container Registry. On each push, once staging images are built or determined to be up to date, GitHub Actions installs C-PAC into a development image for each variant (standard, lite, fMRIPrep-LTS, and ABCD-HCP). CircleCI runs tests in both Docker and Singularity for each of these images and generates a coverage report if all tests pass. On release, CircleCI also pushes production images to Docker Hub.
55

6-
.. raw:: html
6+
.. container:: svg-flowchart
77

8-
<div class="flowchart-container"><object data="../_static/flowcharts/CI-flow.svg" type="image/svg+xml"></object></div>
8+
.. raw:: html
9+
:file: ../_static/flowcharts/CI-flow.svg
10+
11+
`Open image <../_static/flowcharts/CI-flow.svg>`_

docs/_sources/developer/logging.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ Logging
33

44
Most C-PAC logging is handled by the built-in Python ``logging`` library. When logging, take care to choose an appropriate ``getLogger`` function or method. While :py:func:`CPAC.utils.monitoring.custom_logging.getLogger` and ``nipype.utils.logger.Logging.getLogger`` each fall back on ``logging.getLogger``,
55

6-
.. raw:: html
6+
.. container:: svg-flowchart
77

8-
<div class="flowchart-container"><object data="../_static/flowcharts/getLogger.svg" type="image/svg+xml"></object></div>
8+
.. raw:: html
9+
:file: ../_static/flowcharts/getLogger.svg
10+
11+
`Open image <../_static/flowcharts/getLogger.svg>`_
912

1013

1114
each have their own intended use cases.

docs/_sources/user/anat.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
Anatomical Preprocessing
22
------------------------
33

4-
.. raw:: html
4+
.. container:: svg-flowchart
55

6-
<div class="flowchart-container"><object data="../_static/flowcharts/anatomical.svg" type="image/svg+xml"></object></div>
6+
.. raw:: html
7+
:file: ../_static/flowcharts/anatomical.svg
8+
9+
`Open image <../_static/flowcharts/anatomical.svg>`_
710

811
Surface Analysis
912
^^^^^^^^^^^^^^^^
@@ -294,9 +297,12 @@ Configuring CPAC to Run Anatomical Registration
294297
Anatomical Tissue Segmentation
295298
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296299

297-
.. raw:: html
300+
.. container:: svg-flowchart
301+
302+
.. raw:: html
303+
:file: ../_static/flowcharts/segmentation.svg
298304

299-
<div class="flowchart-container"><object data="../_static/flowcharts/segmentation.svg" type="image/svg+xml"></object></div>
305+
`Open image <../_static/flowcharts/segmentation.svg>`_
300306

301307
C-PAC uses `FSL/FAST <http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FAST>`_ to automatically segment brain images into white matter, gray matter, and CSF. This is done using probability maps that contain information about the likelihood that a given voxel will be of a particular tissue type. Users specify a probability threshold such that voxels meeting a minimum probability of being a particular tissue will be classified as such. This results in masks containing voxels of only a single tissue type.
302308

docs/_sources/user/compute_config.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ Computer Settings
1313

1414
#. **Observed Usage:** The resource usage of each node depends on many factors, including the data, the pipeline configuration, and the system. To run many subjects with optimimzed resource estimation, first run a single subject with the desired number of cores and with a generous memory limit. Then, provide the ``callback.log`` generated from that initial run when you run the rest of the subjects.
1515

16-
.. raw:: html
16+
.. container:: svg-flowchart
1717

18-
<object data="../_static/flowcharts/observed-usage.svg" type="image/svg+xml"></object>
18+
.. raw:: html
19+
:file: ../_static/flowcharts/observed-usage.svg
20+
21+
`Open image <../_static/flowcharts/observed-usage.svg>`_
1922

2023
#. **Callback log - [text]:** The path to a callback log file from a previous run, including any resource-management parameters that will be applied in this run, like ``n_cpus`` and ``num_ants_threads``. This file is used override memory estimates with previously observed memory usage. Can be overridden with the commandline flag ``--runtime_usage``.
2124
#. **Buffer - [percent]:** A percent of the previously observed memory usage that is to be added to the memory estimate. Default: 10. Can be overridden with the commandline flag ``--runtime_buffer``.

docs/_sources/user/func.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
Functional Preprocessing
22
-------------------------
33

4-
.. raw:: html
4+
.. container:: svg-flowchart
55

6-
<div class="flowchart-container"><object data="../_static/flowcharts/functional.svg" type="image/svg+xml"></object></div>
6+
.. raw:: html
7+
:file: ../_static/flowcharts/functional.svg
8+
9+
`Open image <../_static/flowcharts/functional.svg>`_
710

811
Initial Preprocessing
912
^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)