Skip to content

Commit 8e863fb

Browse files
authored
Merge pull request #29 from templateflow/docs/documentation
DOC: Set up versioned documentation (automated build and deploy)
2 parents 72b5529 + 2695056 commit 8e863fb

25 files changed

Lines changed: 2412 additions & 68 deletions

.circleci/config.yml

Lines changed: 103 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 gh-pages@2.0.1
15+
git config user.email "crn.poldracklab@gmail.com"
16+
git config user.name "ci-build"
17+
- add_ssh_keys:
18+
fingerprints:
19+
- "ae:95:0c:cc:09:84:64:99:92:82:b7:b5:f4:a7:e9:23"
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
tests:
@@ -169,6 +192,58 @@ jobs:
169192
paths:
170193
- resources
171194

195+
build_docs:
196+
docker:
197+
- image: python:3.7.4
198+
environment:
199+
- FSLOUTPUTTYPE: NIFTI
200+
- SUBJECTS_DIR: /tmp/subjects
201+
steps:
202+
- restore_cache:
203+
keys:
204+
- docs-v1-{{ .Branch }}-{{ .Revision }}
205+
- docs-v1-{{ .Branch }}-
206+
- docs-v1-master
207+
- docs-v1-
208+
paths:
209+
- ./docs/_build/_html
210+
- checkout
211+
- run:
212+
name: Create subjects folder
213+
command: mkdir -p $SUBJECTS_DIR
214+
- run:
215+
name: Install Graphviz
216+
command: apt update && apt -y install graphviz
217+
- run:
218+
name: Install deps
219+
command: pip install --no-cache-dir -r docs/requirements.txt
220+
- run:
221+
name: Build only this commit
222+
command: make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html
223+
- store_artifacts:
224+
path: ./docs/_build/no_version_html
225+
- run:
226+
name: Generate Versioned Docs
227+
command: |
228+
set +e
229+
force_versioned="$( git log --format=oneline -n 1 $CIRCLE_SHA1 | grep -i -E '\[docs?[ _]?versions?\]' )"
230+
set -e
231+
if [[ "x${CIRCLE_TAG}" = "x" && "${CIRCLE_BRANCH}" != "master" && "x${force_versioned}" = "x" ]]; then
232+
echo "Not a tag or master branch - skipping versioned docs."
233+
circleci step halt
234+
else
235+
make -f ./docs/Makefile versioned CURBRANCH=${CIRCLE_TAG:-$CIRCLE_BRANCH}
236+
fi
237+
- save_cache:
238+
key: docs-v1-{{ .Branch }}-{{ .Revision }}
239+
paths:
240+
- ./docs/_build/_html
241+
- persist_to_workspace:
242+
root: docs/_build
243+
paths: html
244+
- store_artifacts:
245+
path: ./docs/_build/html
246+
172247
update_skel:
173248
machine:
174249
image: circleci/classic:201711-01
@@ -251,12 +326,21 @@ jobs:
251326
twine check dist/*
252327
twine upload dist/*
253328
329+
deploy_docs_tag:
330+
<<: *docs
331+
332+
deploy_docs_master:
333+
<<: *docs
334+
254335
workflows:
255336
version: 2
256337
build_test_deploy:
257338
jobs:
258339
- tests:
259340
filters:
341+
branches:
342+
ignore:
343+
- /docs?\/.*/
260344
tags:
261345
only: /.*/
262346
- deploy_pypi:
@@ -275,3 +359,22 @@ workflows:
275359
only: /master/
276360
tags:
277361
ignore: /.*/
362+
363+
- build_docs:
364+
filters:
365+
branches:
366+
ignore:
367+
- /tests?\/.*/
368+
tags:
369+
only: /.*/
370+
371+
- deploy_docs_master:
372+
requires:
373+
- tests
374+
- update_skel
375+
- build_docs
376+
filters:
377+
branches:
378+
only: /master/
379+
tags:
380+
ignore: /.*/

.gitignore

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

6666
# Sphinx documentation
6767
docs/_build/
68+
docs/api/
6869

6970
# PyBuilder
7071
target/

CHANGES.rst

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Version 0.4.1 (July 22, 2019)
22
=============================
3-
43
First release after a deep revision of the tests and the continuous integration setup.
54
Also includes minor reliability improvements over the previous release and some bugfixes.
65

@@ -14,110 +13,86 @@ Also includes minor reliability improvements over the previous release and some
1413

1514
Version 0.4.0 (July 9, 2019)
1615
============================
17-
1816
* MAINT: Use PyBIDS 0.9.x (#15) @effigies
1917

20-
2118
Version 0.3.0 (June 4, 2019)
2219
============================
23-
24-
* ENH: Add ``MNIInfant`` template
25-
20+
* ENH: Add ``MNIInfant`` template.
2621

2722
Version 0.2.0 (June 4, 2019)
2823
============================
29-
3024
* ENH: Added ``MNIPediatricAsym`` template.
31-
* ENH: Updated spec to allow ``cohort``s.
32-
25+
* ENH: Updated spec to allow several *cohorts* (``cohort-``).
3326

3427
Version 0.1.9 (May 28, 2019)
3528
============================
36-
37-
* ENH: Added the `Schaefer 2018 atlas <https://github.com/ThomasYeoLab/CBIG/tree/master/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal/Parcellations/MNI>`__) to ``MNI152NLin6Asym``
38-
* ENH: Mapped the Schaefer atlas and the Harvard-Oxford atlas into ``MNI152NLin2009cAsym``
39-
29+
* ENH: Added the `Schaefer 2018 atlas <https://github.com/ThomasYeoLab/CBIG/tree/master/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal/Parcellations/MNI>`__) to ``MNI152NLin6Asym``.
30+
* ENH: Mapped the Schaefer atlas and the Harvard-Oxford atlas into ``MNI152NLin2009cAsym``.
4031

4132
Version 0.1.8 (May 9, 2019)
4233
===========================
43-
44-
* ENH: Added FSL's Harvard-Oxford template to ``MNI152NLin6Asym``
45-
34+
* ENH: Added FSL's Harvard-Oxford template to ``MNI152NLin6Asym``.
4635

4736
Version 0.1.7 (April 3, 2019)
4837
=============================
49-
50-
* ENH: New release including bugfixes for `MNI152NLin2009cAsym` (particularly https://github.com/templateflow/tpl-MNI152NLin2009cAsym/commit/6e6d5915c7d8055d4af5efbf5e5457a0ab3246b9)
51-
38+
* ENH: New release including bugfixes for ``MNI152NLin2009cAsym`` (particularly https://github.com/templateflow/tpl-MNI152NLin2009cAsym/commit/6e6d5915c7d8055d4af5efbf5e5457a0ab3246b9)
5239

5340
Version 0.1.6 (March 29, 2019)
5441
==============================
55-
56-
Finish adding ``MNI152NLin6Sym`` after curation of NIfTI volumes and exporting to S3.
42+
* ENH: Finish adding ``MNI152NLin6Sym`` after curation of NIfTI volumes and exporting to S3.
5743

5844
Version 0.1.5 (March 29, 2019)
5945
==============================
60-
61-
Add volumetric data to the ``fsLR`` template, and rename the segmentation of subcortical structures to be consistent with the new files.
46+
* ENH: Add volumetric data to the ``fsLR`` template.
47+
* ENH: Rename the segmentation of subcortical structures to be consistent with the new files.
6248

6349
Version 0.1.4 (March 28, 2019)
6450
==============================
65-
66-
New release to include the new ``MNI152NLin6Asym`` template (the default MNI template of FSL).
51+
* ENH: New release to include the new ``MNI152NLin6Asym`` template (the default MNI template of FSL).
6752

6853
Version 0.1.3 (March 14, 2019)
6954
==============================
70-
71-
Update TemplateFlow skeleton to include ``tpl-fsaverage/tpl-fsaverage_dseg.tsv``, after TemplateFlow update.
55+
* FIX: Update TemplateFlow skeleton to include ``tpl-fsaverage/tpl-fsaverage_dseg.tsv``, after TemplateFlow update.
7256

7357
Version 0.1.2 (March 12, 2019)
7458
==============================
75-
7659
* FIX: ``api.get`` - robuster fetcher algorithm (allows S3 download on DL repos) and better error messages (#10)
7760

7861
Version 0.1.1 (March 12, 2019)
7962
==============================
80-
8163
* FIX: Require environment variable to use DataLad (#8)
8264

8365
Version 0.1.0.post1 (March 05, 2019)
8466
====================================
85-
86-
Testing a better ``.zenodo.json`` settings.
67+
* ENH: Testing a better ``.zenodo.json`` settings.
8768

8869
Version 0.1.0 (March 05, 2019)
8970
==============================
90-
91-
First minimally functional TemplateFlow client release.
71+
* ENH: First minimally functional TemplateFlow client release.
9272

9373
Version 0.0.5.post1 (March 04, 2019)
9474
====================================
75+
Hotfix release to retrieve correct version when pip installed.
9576

96-
Hotfix release to retrieve correct version when pip installed. Adds .zenodo.json file.
77+
* MAINT: Add a ``.zenodo.json`` file.
9778

9879
Version 0.0.5 (March 04, 2019)
9980
==============================
100-
101-
* [ENH] Datalad-free alternative for TemplateFlow (#7)
102-
* [ENH] Use a BIDSLayout to index TemplateFlow (#6)
81+
* ENH: Datalad-free alternative for TemplateFlow (#7)
82+
* ENH: Use a BIDSLayout to index TemplateFlow (#6)
10383

10484
Version 0.0.4 (January 18, 2019)
10585
================================
106-
107-
* Add a ``get_metadata`` utility
86+
* ENH: Add a ``get_metadata`` utility
10887

10988
Version 0.0.3 (January 16, 2019)
11089
================================
111-
112-
* Add ``api.templates()`` + one doctest
90+
* ENH: Add ``api.templates()`` + one doctest
11391

11492
Version 0.0.2 (January 16, 2019)
11593
================================
116-
117-
* Add one doctest
118-
94+
* ENH: Add one doctest
11995

12096
Version 0.0.1 (January 16, 2019)
12197
================================
122-
123-
* First functional release
98+
* ENH: First functional release

0 commit comments

Comments
 (0)