Skip to content

Commit 7935478

Browse files
committed
ENH: User and developer guide as RestructedText **WIP**
[ci skip]
1 parent 2d1112c commit 7935478

19 files changed

+630
-29
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ tags
1919

2020
# Ignore pyc files ...
2121
*.pyc
22+
23+
# Documentation
24+
Docs/_build

AUTHORS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Please see the GitHub project page at https://github.com/Slicer/Slicer/graphs/contributors

CONTRIBUTING.md renamed to CONTRIBUTING.rst

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,117 @@
1+
======================
12
Contributing to Slicer
23
======================
34

45
There are many ways to contribute to Slicer, with varying levels of effort. Do try to
5-
look through the [documentation](https://www.slicer.org/wiki/Documentation/Nightly/Developers) first if something is unclear, and let us know how we can
6+
look through the `documentation <https://www.slicer.org/wiki/Documentation/Nightly/Developers>`_ first if something is unclear, and let us know how we can
67
do better.
78

8-
* Ask a question on the [slicer-devel email list](http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel)
9-
* Submit a feature request or bug, or add to the discussion on the [Slicer issue tracker](http://na-mic.org/Mantis)
10-
* Submit a [Pull Request](https://github.com/Slicer/Slicer/pulls) to improve Slicer or its documentation
9+
* Ask a question on the `slicer-devel email list <http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel>`_
10+
* Submit a feature request or bug, or add to the discussion on the `Slicer issue tracker <http://na-mic.org/Mantis>`_
11+
* Submit a `Pull Request <https://github.com/Slicer/Slicer/pulls>`_ to improve Slicer or its documentation
1112

1213
We encourage a range of Pull Requests, from patches that include passing tests and
1314
documentation, all the way down to half-baked ideas that launch discussions.
1415

1516
The PR Process, Circle CI, and Related Gotchas
1617
----------------------------------------------
1718

18-
#### How to submit a PR ?
19+
How to submit a PR ?
20+
~~~~~~~~~~~~~~~~~~~~
1921

2022
If you are new to Slicer development and you don't have push access to the Slicer
2123
repository, here are the steps:
2224

23-
1. [Fork and clone](https://help.github.com/articles/fork-a-repo/) the repository.
25+
1. `Fork and clone <https://help.github.com/articles/fork-a-repo/>`_ the repository.
2426
3. Create a branch.
25-
4. [Push](https://help.github.com/articles/pushing-to-a-remote/) the branch to your GitHub fork.
26-
5. Create a [Pull Request](https://github.com/Slicer/Slicer/pulls).
27+
4. `Push <https://help.github.com/articles/pushing-to-a-remote/>`_ the branch to your GitHub fork.
28+
5. Create a `Pull Request <https://github.com/Slicer/Slicer/pulls>`_.
2729

28-
This corresponds to the `Fork & Pull Model` mentioned in the [GitHub flow](https://guides.github.com/introduction/flow/index.html)
30+
This corresponds to the ``Fork & Pull Model`` mentioned in the `GitHub flow <https://guides.github.com/introduction/flow/index.html>`_
2931
guides.
3032

3133
When submitting a PR, the developers following the project will be notified. That
32-
said, to engage specific developers, you can add `Cc: @<username>` comment to notify
34+
said, to engage specific developers, you can add ``Cc: @<username>`` comment to notify
3335
them of your awesome contributions.
3436
Based on the comments posted by the reviewers, you may have to revisit your patches.
3537

3638

37-
#### How to efficiently contribute ?
39+
How to efficiently contribute ?
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3841

3942
We encourage all developers to:
4043

4144
* review and follow the style guidelines described
42-
[on the wiki](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Style_Guide#Commits).
45+
`on the wiki <https://www.slicer.org/wiki/Documentation/Nightly/Developers/Style_Guide#Commits>`_.
4346

4447
* add or update tests. There are plenty of existing tests to inspire from. The
45-
testing [how-tos](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Testing) are
48+
testing `how-tos <https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Testing>`_ are
4649
also resourceful.
4750

4851
* consider potential backward compatibility breakage and discuss these on the
4952
mailing list. For example, update of ITK, Python, Qt or VTK version, change to
5053
core functionality, should be carefully reviewed and integrated. Ideally, several
5154
developers would test that the changes don't break extensions.
5255

53-
#### How to integrate a PR ?
56+
How to integrate a PR ?
57+
~~~~~~~~~~~~~~~~~~~~~~~
5458

5559
Getting your contributions integrated is relatively straightforward, here
5660
is the checklist:
5761

5862
* All tests pass
5963
* Consensus is reached. This usually means that at least two reviewers approved
60-
the changes (or added a `LGTM` comment) and at least one business day passed
61-
without anyone objecting. `LGTM` is an acronym for _Looks Good to Me_.
64+
the changes (or added a ``LGTM`` comment) and at least one business day passed
65+
without anyone objecting. `LGTM` is an acronym for `Looks Good to Me`.
6266
* To accommodate developers explicitly asking for more time to test the
6367
proposed changes, integration time can be delayed by few more days.
6468

6569
Next, there are two scenarios:
70+
6671
* You do NOT have push access: A Slicer core developer will integrate your PR. If
6772
you would like to speed up the integration, do not hesitate to send a note on
6873
the mailing list.
69-
* You have push access: Follow [Integrating topic from external contributor](https://www.slicer.org/wiki/Slicer:git-svn#Integrating_topic_from_external_contributor)
74+
* You have push access: Follow `Integrating topic from external contributor <https://www.slicer.org/wiki/Slicer:git-svn#Integrating_topic_from_external_contributor>`_
7075
instructions on the wiki.
7176

7277

73-
#### Automatic testing of pull requests
78+
Automatic testing of pull requests
79+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7480

7581
Every pull request is tested automatically using CircleCI each time you push a
7682
commit to it. The Github UI will restrict users from merging pull requests until
7783
the CI build has returned with a successful result indicating that all tests have
7884
passed.
7985

8086
The testing infrastructure is described in details in the
81-
[3D Slicer Improves Testing for Pull Requests Using Docker and CircleCI](https://blog.kitware.com/3d-slicer-improves-testing-for-pull-requests-using-docker-and-circleci/)
87+
`3D Slicer Improves Testing for Pull Requests Using Docker and CircleCI <https://blog.kitware.com/3d-slicer-improves-testing-for-pull-requests-using-docker-and-circleci/>`_
8288
blog post.
8389

8490

85-
#### Nightly tests
91+
Nightly tests
92+
~~~~~~~~~~~~~
8693

8794
After changes are integrated, every evening at 10pm EST (3am UTC), Slicer build bots (aka factories)
8895
will build, test and package Slicer application and all its extensions on Linux, MacOSX
89-
and Windows. Results are published daily on [CDash](http://slicer.cdash.org/index.php?project=Slicer4)
96+
and Windows. Results are published daily on `CDash <http://slicer.cdash.org/index.php?project=Slicer4>`_
9097
and developers introducing changes introducing build or test failures are notified by
9198
email.
9299

93100

94-
#### Decision-making process
101+
Decision-making process
102+
~~~~~~~~~~~~~~~~~~~~~~~
95103

96-
1. Given the topic of interest, initiate discussion on the [mailing list](http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel).
104+
1. Given the topic of interest, initiate discussion on the `mailing list <http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel>`_.
97105

98106
2. Identify a small circle of community members that are interested to study the
99107
topic in more depth.
100108

101109
3. Take the discussion off the general list, work on the analysis of options and
102-
alternatives, summarize findings on the wiki or similar. [Labs](https://www.slicer.org/wiki/Documentation/Labs)
110+
alternatives, summarize findings on the wiki or similar. `Labs <https://www.slicer.org/wiki/Documentation/Labs>`_
103111
page are usually a good ground for such summary.
104112

105113
4. Announce on the mailing list the in-depth discussion of the topic for the
106-
[Slicer Community hangout](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Meetings),
114+
`Slicer Community hangout <https://www.slicer.org/wiki/Documentation/Nightly/Developers/Meetings>`_,
107115
encourage anyone that is interested in weighing in on the topic to join the
108116
discussion. If there is someone who is interested to participate in the discussion,
109117
but cannot join the meeting due to conflict, they should notify the leaders of
@@ -112,12 +120,13 @@ email.
112120
5. Hopefully, reach consensus at the hangout and proceed with the agreed plan.
113121

114122

115-
*The initial version of these guidelines was established during the [winter
116-
project week 2017](http://www.na-mic.org/Wiki/index.php/2017_Winter_Project_Week/UpdatingCommunityForums).*
123+
`The initial version of these guidelines was established during the [winter
124+
project week 2017](http://www.na-mic.org/Wiki/index.php/2017_Winter_Project_Week/UpdatingCommunityForums).`
117125

118-
#### Benevolent dictators for life
126+
Benevolent dictators for life
127+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119128

120-
The [benevolent dictators](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life) can
129+
The `benevolent dictators <https://en.wikipedia.org/wiki/Benevolent_dictator_for_life>`_ can
121130
integrate changes to keep the platform healthy and help interpret
122131
or address conflict related to the contribution guidelines.
123132

Docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = 3DSlicer
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Docs/conf.py

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# 3D Slicer documentation build configuration file, created by
5+
# sphinx-quickstart on Tue Mar 21 03:07:30 2017.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
import os
21+
# import sys
22+
# sys.path.insert(0, os.path.abspath('.'))
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = []
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# The suffix(es) of source filenames.
40+
# You can specify multiple suffix as a list of string:
41+
#
42+
# source_suffix = ['.rst', '.md']
43+
source_suffix = '.rst'
44+
45+
# The master toctree document.
46+
master_doc = 'index'
47+
48+
# General information about the project.
49+
project = '3D Slicer'
50+
copyright = '2017, Slicer Community'
51+
author = 'Slicer Community'
52+
53+
# The version info for the project you're documenting, acts as replacement for
54+
# |version| and |release|, also used in various other places throughout the
55+
# built documents.
56+
#
57+
# The short X.Y version.
58+
version = ''
59+
# The full version, including alpha/beta/rc tags.
60+
release = ''
61+
62+
# The language for content autogenerated by Sphinx. Refer to documentation
63+
# for a list of supported languages.
64+
#
65+
# This is also used if you do content translation via gettext catalogs.
66+
# Usually you set "language" from the command line for these cases.
67+
language = None
68+
69+
# List of patterns, relative to source directory, that match files and
70+
# directories to ignore when looking for source files.
71+
# This patterns also effect to html_static_path and html_extra_path
72+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
73+
74+
# The name of the Pygments (syntax highlighting) style to use.
75+
pygments_style = 'sphinx'
76+
77+
# If true, `todo` and `todoList` produce output, else they produce nothing.
78+
todo_include_todos = False
79+
80+
81+
# -- Options for HTML output ----------------------------------------------
82+
83+
# The theme to use for HTML and HTML Help pages. See the documentation for
84+
# a list of builtin themes.
85+
#
86+
html_theme = 'default'
87+
88+
# Theme options are theme-specific and customize the look and feel of a theme
89+
# further. For a list of options available for each theme, see the
90+
# documentation.
91+
#
92+
# html_theme_options = {}
93+
94+
# Add any paths that contain custom static files (such as style sheets) here,
95+
# relative to this directory. They are copied after the builtin static files,
96+
# so a file named "default.css" will overwrite the builtin "default.css".
97+
html_static_path = ['_static']
98+
99+
100+
# -- Options for HTMLHelp output ------------------------------------------
101+
102+
# Output file base name for HTML help builder.
103+
htmlhelp_basename = '3DSlicerdoc'
104+
105+
106+
# -- Options for LaTeX output ---------------------------------------------
107+
108+
latex_elements = {
109+
# The paper size ('letterpaper' or 'a4paper').
110+
#
111+
# 'papersize': 'letterpaper',
112+
113+
# The font size ('10pt', '11pt' or '12pt').
114+
#
115+
# 'pointsize': '10pt',
116+
117+
# Additional stuff for the LaTeX preamble.
118+
#
119+
# 'preamble': '',
120+
121+
# Latex figure (float) alignment
122+
#
123+
# 'figure_align': 'htbp',
124+
}
125+
126+
# Grouping the document tree into LaTeX files. List of tuples
127+
# (source start file, target name, title,
128+
# author, documentclass [howto, manual, or own class]).
129+
latex_documents = [
130+
(master_doc, '3DSlicer.tex', '3D Slicer Documentation',
131+
'Slicer Community', 'manual'),
132+
]
133+
134+
135+
# -- Options for manual page output ---------------------------------------
136+
137+
# One entry per manual page. List of tuples
138+
# (source start file, name, description, authors, manual section).
139+
man_pages = [
140+
(master_doc, '3Dslicer', '3D Slicer Documentation',
141+
[author], 1)
142+
]
143+
144+
145+
# -- Options for Texinfo output -------------------------------------------
146+
147+
# Grouping the document tree into Texinfo files. List of tuples
148+
# (source start file, target name, title, author,
149+
# dir menu entry, description, category)
150+
texinfo_documents = [
151+
(master_doc, '3DSlicer', '3D Slicer Documentation',
152+
author, '3DSlicer', 'One line description of project.',
153+
'Miscellaneous'),
154+
]
155+
156+
157+
# -- Read The Docs -----------------------------------------------------
158+
159+
# on_rtd is whether we are on readthedocs.io
160+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
161+
162+
if not on_rtd: # only import and set the theme if we're building docs locally
163+
import sphinx_rtd_theme
164+
html_theme = 'sphinx_rtd_theme'
165+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
166+

Docs/developer_guide/authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../AUTHORS.rst

Docs/developer_guide/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../CONTRIBUTING.rst

0 commit comments

Comments
 (0)