Skip to content

Commit 3a79c62

Browse files
authored
Merge pull request #45 from oesteban/docs/build-documentation
DOC: Build versioned docs and deploy them to gh-pages
2 parents 59a12cc + 8a61f26 commit 3a79c62

28 files changed

+2843
-196
lines changed

.circleci/config.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
docs_deploy: &docs
2+
docker:
3+
- image: node:8.10.0
4+
steps:
5+
- checkout
6+
- attach_workspace:
7+
at: docs/_build
8+
- run:
9+
name: Disable jekyll builds
10+
command: touch docs/_build/html/.nojekyll
11+
- run:
12+
name: Install and configure dependencies
13+
command: |
14+
npm install -g --silent [email protected]
15+
git config user.email "[email protected]"
16+
git config user.name "ci-build"
17+
- add_ssh_keys:
18+
fingerprints:
19+
- "29:00:83:05:e9:af:5d:0f:3b:18:7a:3f:0a:98:1a:ef"
20+
- run:
21+
name: Deploy docs to gh-pages branch
22+
command: gh-pages --dotfiles --message "doc(update) [skip ci]" --dist docs/_build/html
23+
124
version: 2
225
jobs:
326

@@ -437,6 +460,64 @@ jobs:
437460
steps:
438461
- run: echo Deploying!
439462

463+
build_docs:
464+
docker:
465+
- image: python:3.7.4
466+
environment:
467+
- FSLOUTPUTTYPE: NIFTI
468+
- SUBJECTS_DIR: /tmp/subjects
469+
steps:
470+
- restore_cache:
471+
keys:
472+
- docs-v1-{{ .Branch }}-{{ .Revision }}
473+
- docs-v1-{{ .Branch }}-
474+
- docs-v1-master
475+
- docs-v1-
476+
paths:
477+
- ./docs/_build/_html
478+
- checkout
479+
- run:
480+
name: Create subjects folder
481+
command: mkdir -p $SUBJECTS_DIR
482+
- run:
483+
name: Install Graphviz
484+
command: apt update && apt -y install graphviz
485+
- run:
486+
name: Install deps
487+
command: pip install --no-cache-dir -r docs/requirements.txt
488+
- run:
489+
name: Build only this commit
490+
command: make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html
491+
- store_artifacts:
492+
path: ./docs/_build/no_version_html
493+
- run:
494+
name: Generate Versioned Docs
495+
command: |
496+
set +e
497+
force_versioned="$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[docs?[ _]?versions?\]' )"
498+
set -e
499+
if [[ "x${CIRCLE_TAG}" = "x" && "${CIRCLE_BRANCH}" != "master" && "x${force_versioned}" = "x" ]]; then
500+
echo "Not a tag or master branch - skipping versioned docs."
501+
circleci step halt
502+
else
503+
make -f ./docs/Makefile versioned CURBRANCH=${CIRCLE_TAG:-$CIRCLE_BRANCH}
504+
fi
505+
- save_cache:
506+
key: docs-v1-{{ .Branch }}-{{ .Revision }}
507+
paths:
508+
- ./docs/_build/_html
509+
- persist_to_workspace:
510+
root: docs/_build
511+
paths: html
512+
- store_artifacts:
513+
path: ./docs/_build/html
514+
515+
deploy_docs_tag:
516+
<<: *docs
517+
518+
deploy_docs_master:
519+
<<: *docs
520+
440521
workflows:
441522
version: 2
442523
build_test_deploy:
@@ -490,6 +571,7 @@ workflows:
490571
- deployable:
491572
requires:
492573
- build
574+
- build_docs
493575
- test_deploy_pypi
494576
filters:
495577
branches:
@@ -514,3 +596,31 @@ workflows:
514596
ignore: /.*/
515597
tags:
516598
only: /.*/
599+
600+
- build_docs:
601+
filters:
602+
branches:
603+
ignore:
604+
- /tests?\/.*/
605+
- /THP002\/.*/
606+
tags:
607+
only: /.*/
608+
609+
- deploy_docs_master:
610+
requires:
611+
- build_docs
612+
- test_deploy_pypi
613+
filters:
614+
branches:
615+
only: /master/
616+
tags:
617+
ignore: /.*/
618+
619+
- deploy_docs_tag:
620+
requires:
621+
- deployable
622+
filters:
623+
branches:
624+
ignore: /.*/
625+
tags:
626+
only: /.*/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ instance/
6464

6565
# Sphinx documentation
6666
docs/_build/
67+
docs/api/
6768

6869
# PyBuilder
6970
target/

README.rst

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
========
2-
dmriprep
2+
dMRIPrep
33
========
44

55
.. image:: https://badgen.net/badge/chat/on%20mattermost/blue
@@ -17,10 +17,8 @@ dmriprep
1717
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3392201.svg
1818
:target: https://doi.org/10.5281/zenodo.3392201
1919

20-
.. image:: https://readthedocs.org/projects/dmriprep/badge/?version=latest
21-
:target: https://dmriprep.readthedocs.io/en/latest/?badge=latest
22-
:alt: Documentation Status
23-
20+
[`Documentation <https://nipreps.github.io/dmriprep/>`__]
21+
[`Support at neurostars.org <https://neurostars.org/tags/dmriprep>`__]
2422

2523
The preprocessing of diffusion MRI (dMRI) involves numerous steps to clean and standardize
2624
the data before fitting a particular model.
@@ -36,20 +34,17 @@ dMRIPrep equips neuroscientists with an easy-to-use and transparent preprocessin
3634
workflow, which can help ensure the validity of inference and the interpretability
3735
of results.
3836

39-
The workflow is based on `Nipype <https://nipype.readthedocs.io>`_ and encompases a large
37+
The workflow is based on `Nipype <https://nipype.readthedocs.io>`__ and encompases a large
4038
set of tools from well-known neuroimaging packages, including
41-
`FSL <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/>`_,
42-
`ANTs <https://stnava.github.io/ANTs/>`_,
43-
`FreeSurfer <https://surfer.nmr.mgh.harvard.edu/>`_,
44-
`AFNI <https://afni.nimh.nih.gov/>`_,
45-
and `Nilearn <https://nilearn.github.io/>`_.
39+
`FSL <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/>`__,
40+
`ANTs <https://stnava.github.io/ANTs/>`__,
41+
`FreeSurfer <https://surfer.nmr.mgh.harvard.edu/>`__,
42+
`AFNI <https://afni.nimh.nih.gov/>`__,
43+
and `Nilearn <https://nilearn.github.io/>`__.
4644
This pipeline was designed to provide the best software implementation for each state of
4745
preprocessing, and will be updated as newer and better neuroimaging software becomes
4846
available.
4947

5048
dMRIPrep performs basic preprocessing steps (coregistration, normalization, unwarping,
5149
segmentation, skullstripping etc.) providing outputs that can be
5250
easily submitted to a variety of tractography algorithms.
53-
54-
[Documentation `dmriprep.org <https://dmriprep.readthedocs.io>`_]
55-
[Support `neurostars.org <https://neurostars.org/tags/dmriprep>`_]

dmriprep/cli/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def check_latest():
6060

6161
def is_flagged():
6262
"""Check whether current version is flagged."""
63-
# https://raw.githubusercontent.com/poldracklab/dmriprep/master/.versions.json
63+
# https://raw.githubusercontent.com/nipreps/dmriprep/master/.versions.json
6464
flagged = tuple()
6565
try:
6666
response = requests.get(url="""\
67-
https://raw.githubusercontent.com/poldracklab/dmriprep/master/.versions.json""", timeout=1.0)
67+
https://raw.githubusercontent.com/nipreps/dmriprep/master/.versions.json""", timeout=1.0)
6868
except Exception:
6969
response = None
7070

dmriprep/interfaces/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from nipype.interfaces.base import OutputMultiObject, SimpleInterface
55
from niworkflows.interfaces.bids import (
66
DerivativesDataSink as _DDS,
7-
BIDSDataGrabberOutputSpec as _BIDSDataGrabberOutputSpec,
8-
BIDSDataGrabberInputSpec,
7+
_BIDSDataGrabberOutputSpec,
8+
_BIDSDataGrabberInputSpec,
99
LOGGER as _LOGGER,
1010
)
1111

@@ -21,7 +21,7 @@ class BIDSDataGrabberOutputSpec(_BIDSDataGrabberOutputSpec):
2121

2222

2323
class BIDSDataGrabber(SimpleInterface):
24-
input_spec = BIDSDataGrabberInputSpec
24+
input_spec = _BIDSDataGrabberInputSpec
2525
output_spec = BIDSDataGrabberOutputSpec
2626
_require_dwis = True
2727

0 commit comments

Comments
 (0)