Skip to content

Commit

Permalink
DOC: Add user and developer documentation as RestructedText and Markd…
Browse files Browse the repository at this point in the history
…own sources

This commit adds a "Docs" folder providing sphinx based infrastructure
allowing to generate html and pdf documentation.

Documentations is organized in two directories

    Docs/user_guide
    Docs/developer_guide

Configuration file is Docs/conf.py

It includes the recommonmark sphinx extension to also support parsing
documentation pages written as .md files.

To install the prerequisites on either Linux, macOS or Windows, run
these commands:

  cd Slicer
  pip install -r requirements-docs.txt

Then, documentation can locally be generated running:

  cd Docs
  make html

Conversion from rst to md can be done using pandoc. See http://pandoc.org/
For example:
  $ sudo apt-get install pandoc
  $ pandoc -f rst -t markdown_github page.rst -o
  page.md

[ci  skip]
  • Loading branch information
jcfr committed May 5, 2020
1 parent 88bff56 commit 13ba1ae
Show file tree
Hide file tree
Showing 18 changed files with 607 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,6 @@ tags

# Ignore pyc files ...
*.pyc

# Documentation
Docs/_build
5 changes: 5 additions & 0 deletions AUTHORS.rst
@@ -0,0 +1,5 @@
=======
Credits
=======

Please see the GitHub project page at https://github.com/Slicer/Slicer/graphs/contributors
20 changes: 20 additions & 0 deletions Docs/Makefile
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = 3DSlicer
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
174 changes: 174 additions & 0 deletions Docs/conf.py
@@ -0,0 +1,174 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 3D Slicer documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 21 03:07:30 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import sys

from recommonmark.parser import CommonMarkParser

# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

source_parsers = {
'.md': CommonMarkParser,
}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = '3D Slicer'
copyright = '2020, Slicer Community'
author = 'Slicer Community'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
# Toc options
'includehidden': False,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = '3DSlicerdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '3DSlicer.tex', '3D Slicer Documentation',
'Slicer Community', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, '3Dslicer', '3D Slicer Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, '3DSlicer', '3D Slicer Documentation',
author, '3DSlicer', 'One line description of project.',
'Miscellaneous'),
]


# -- Read The Docs -----------------------------------------------------

# on_rtd is whether we are on readthedocs.io
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
1 change: 1 addition & 0 deletions Docs/developer_guide/authors.rst
@@ -0,0 +1 @@
.. include:: ../../AUTHORS.rst
3 changes: 3 additions & 0 deletions Docs/developer_guide/contributing.rst
@@ -0,0 +1,3 @@
============
Contributing
============
41 changes: 41 additions & 0 deletions Docs/index.rst
@@ -0,0 +1,41 @@
.. 3D Slicer documentation master file, created by
sphinx-quickstart on Tue Mar 21 03:07:30 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to 3D Slicer's documentation!
=====================================

.. toctree::
:maxdepth: 2

user_guide/getting_started
user_guide/license
user_guide/citing
user_guide/acknowledgments
user_guide/commercial_use

.. toctree::
:maxdepth: 2
:caption: User Guide:

user_guide/user_interface
user_guide/data_loading_and_saving
user_guide/extensions_manager
user_guide/settings


.. toctree::
:maxdepth: 2
:caption: Developer Guide:

developer_guide/contributing
developer_guide/authors


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
40 changes: 40 additions & 0 deletions Docs/make.bat
@@ -0,0 +1,40 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
if "%SOURCEDIR%" == "" (
set SOURCEDIR=.
)
if "%BUILDDIR%" == "" (
set BUILDDIR=_build
)
set SPHINXPROJ=3DSlicer

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
3 changes: 3 additions & 0 deletions Docs/user_guide/acknowledgments.rst
@@ -0,0 +1,3 @@
===============
Acknowledgments
===============
48 changes: 48 additions & 0 deletions Docs/user_guide/citing.rst
@@ -0,0 +1,48 @@
======
Citing
======

3D Slicer as a Platform
-----------------------

To acknowledge 3D Slicer as a platform, please cite the `Slicer web site <http://www.slicer.org/>`_ and the following publications when publishing work that uses or incorporates 3D Slicer:


Slicer 4
^^^^^^^^

Fedorov A., Beichel R., Kalpathy-Cramer J., Finet J., Fillion-Robin J-C., Pujol S., Bauer C., Jennings D., Fennessy F.M., Sonka M., Buatti J., Aylward S.R., Miller J.V., Pieper S., Kikinis R. `3D Slicer as an Image Computing Platform for the Quantitative Imaging Network <http://www.spl.harvard.edu/publications/item/view/2219>`_. Magn Reson Imaging. 2012 Nov;30(9):1323-41. PMID: 22770690. PMCID: PMC3466397.


Slicer 3
^^^^^^^^

Pieper S, Lorensen B, Schroeder W, Kikinis R. `The NA-MIC Kit: ITK, VTK, Pipelines, Grids and 3D Slicer as an Open Platform for the Medical Image Computing Community <http://www.spl.harvard.edu/publications/item/view/68>`_. Proceedings of the 3rd IEEE International Symposium on Biomedical Imaging: From Nano to Macro 2006; 1:698-701.

Pieper S, Halle M, Kikinis R. `3D SLICER <http://www.spl.harvard.edu/publications/item/view/91>`_. Proceedings of the 1st IEEE International Symposium on Biomedical Imaging: From Nano to Macro 2004; 1:632-635.


Slicer 2
^^^^^^^^

Gering D.T., Nabavi A., Kikinis R., Hata N., O'Donnell L., Grimson W.E.L., Jolesz F.A., Black P.M., Wells III W.M. An `Integrated Visualization System for Surgical Planning and Guidance using Image Fusion and an Open MR <http://www.spl.harvard.edu/publications/item/view/156>`_. J Magn Reson Imaging. 2001 Jun;13(6):967-75. PMID: 11382961.

Gering D.T., Nabavi A., Kikinis R., Grimson W.E.L., Hata N., Everett P., Jolesz F.A., Wells III W.M. `An Integrated Visualization System for Surgical Planning and Guidance using Image Fusion and Interventional Imaging <http://www.spl.harvard.edu/publications/item/view/816>`_. Int Conf Med Image Comput Comput Assist Interv. 1999 Sep;2:809-19.


Individual Module
-----------------

To acknowledge individual modules:

.. Acknowledgement-tab.png
.. figure:: https://discourse-cloud-file-uploads.s3.dualstack.us-west-2.amazonaws.com/standard17/uploads/slicer/original/2X/b/b221511c0b42bbce72952525639279cca502c5cc.png

Each module has an acknowledgment tab in the top section. Information about contributors and funding source can be
found there.

.. Help-tab.png
.. figure:: https://discourse-cloud-file-uploads.s3.dualstack.us-west-2.amazonaws.com/standard17/uploads/slicer/original/2X/b/b5ace5fef98c7f1b2d08d6d6c61c62ab52d290a6.png

Additional information (including information about the underlying publications) can be typically found on the
manual pages accessible through the help tab in the top section
28 changes: 28 additions & 0 deletions Docs/user_guide/commercial_use.md
@@ -0,0 +1,28 @@
Commercial Use
==============

We invite commercial entities to use 3D Slicer.

Slicer's License makes Commercial Use Available
-----------------------------------------------

- 3D Slicer is a Free Open Source Software distributed under a BSD style license.
- The license does not impose restrictions on the use of the software.
- 3D Slicer is NOT FDA approved. It is the users responsibility to ensure compliance with applicable rules and regulations.
- For details, please see the 3D Slicer Software License Agreement.

Commercial Partners
-------------------

- [Isomics](http://www.isomics.com/) uses 3D Slicer in a variety of academic and commercial research partnerships in fields such as planning and guidance for neurosurgery, quantitative imaging for clinical trials, clinical image informatics.
- [Kitware](http://www.kitware.com/opensource/slicer.html) Integral to continuing to support the 3D Slicer community, Kitware is also offering consulting services in response to the rapidly growing demand for the development of proprietary applications and commercial products based on 3D Slicer. Kitware has used 3D Slicer to rapidly prototype solutions in nearly every aspect of medical imaging and is also collaborating on the development of commercial pre-clinical and clinical products based on 3D Slicer.

Listed in alphabetical order.

Slicer Based Products
---------------------

- [SonoVol](http://sonovol.com/) is developing a whole-body ultrasound imaging system for small animals. This start-up company arose from research in the Department of Biomedical Engineering at the University of North Carolina at Chapel Hill.
- [Xstrahl](http://www.xstrahl.com/) is developing a Small Animal Radiation Research Platform (SARRP) that uses 3D Slicer as its front-end application for radiation therapy beam placement and system control.

Listed in alphabetical order.
3 changes: 3 additions & 0 deletions Docs/user_guide/data_loading_and_saving.rst
@@ -0,0 +1,3 @@
=======================
Data Loading and Saving
=======================
3 changes: 3 additions & 0 deletions Docs/user_guide/extensions_manager.rst
@@ -0,0 +1,3 @@
==================
Extensions Manager
==================

0 comments on commit 13ba1ae

Please sign in to comment.