Skip to content

Commit d95d028

Browse files
authored
Merge pull request #53 from SaraOgaz/sphinx_setup
first pass at getting sphinx and automodapi running
2 parents c4324a1 + aa88a23 commit d95d028

File tree

6 files changed

+236
-1
lines changed

6 files changed

+236
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
utils/config.json
55
build/
66
dist/
7-
jwql.egg-info/
7+
jwql.egg-info/
8+
docs/build/
9+
docs/source/api/

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 = jwql
8+
SOURCEDIR = source
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/source/api_docs.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Preview Image Test
2+
==================
3+
.. automodapi:: jwql.preview_image.preview_image
4+
5+
Utils Test
6+
==========
7+
.. automodapi:: jwql.utils.utils

docs/source/conf.py

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# jwql documentation build configuration file, created by
5+
# sphinx-quickstart on Wed Apr 4 10:30:20 2018.
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+
import stsci_rtd_theme
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 = ['sphinx_automodapi.automodapi',
35+
'sphinx_automodapi.automodsumm',
36+
'numpydoc',
37+
'sphinx.ext.autodoc',
38+
'sphinx.ext.mathjax',
39+
'sphinx.ext.viewcode']
40+
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
# The suffix(es) of source filenames.
45+
# You can specify multiple suffix as a list of string:
46+
#
47+
# source_suffix = ['.rst', '.md']
48+
source_suffix = '.rst'
49+
50+
# The master toctree document.
51+
master_doc = 'index'
52+
53+
# Numpy doc setting, right now this supresses some warnings, not exactly sure why?
54+
numpydoc_show_class_members = False
55+
56+
# General information about the project.
57+
project = 'jwql'
58+
copyright = '2018, STScI'
59+
author = 'STScI'
60+
61+
# The version info for the project you're documenting, acts as replacement for
62+
# |version| and |release|, also used in various other places throughout the
63+
# built documents.
64+
#
65+
# The short X.Y version.
66+
version = '0.4.1'
67+
# The full version, including alpha/beta/rc tags.
68+
release = '0.4.1'
69+
70+
# The language for content autogenerated by Sphinx. Refer to documentation
71+
# for a list of supported languages.
72+
#
73+
# This is also used if you do content translation via gettext catalogs.
74+
# Usually you set "language" from the command line for these cases.
75+
language = None
76+
77+
# List of patterns, relative to source directory, that match files and
78+
# directories to ignore when looking for source files.
79+
# This patterns also effect to html_static_path and html_extra_path
80+
exclude_patterns = []
81+
82+
# The name of the Pygments (syntax highlighting) style to use.
83+
pygments_style = 'sphinx'
84+
85+
# If true, `todo` and `todoList` produce output, else they produce nothing.
86+
todo_include_todos = False
87+
88+
89+
# -- Options for HTML output ----------------------------------------------
90+
91+
# The theme to use for HTML and HTML Help pages. See the documentation for
92+
# a list of builtin themes.
93+
#
94+
html_theme = 'stsci_rtd_theme'
95+
96+
# Theme options are theme-specific and customize the look and feel of a theme
97+
# further. For a list of options available for each theme, see the
98+
# documentation.
99+
#
100+
# html_theme_options = {}
101+
102+
# Add any paths that contain custom static files (such as style sheets) here,
103+
# relative to this directory. They are copied after the builtin static files,
104+
# so a file named "default.css" will overwrite the builtin "default.css".
105+
html_static_path = ['_static']
106+
html_theme_path = [stsci_rtd_theme.get_html_theme_path()]
107+
108+
# Custom sidebar templates, must be a dictionary that maps document names
109+
# to template names.
110+
#
111+
# This is required for the alabaster theme
112+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
113+
#html_sidebars = {}
114+
115+
116+
# -- Options for HTMLHelp output ------------------------------------------
117+
118+
# Output file base name for HTML help builder.
119+
htmlhelp_basename = 'jwqldoc'
120+
121+
122+
# -- Options for LaTeX output ---------------------------------------------
123+
124+
latex_elements = {
125+
# The paper size ('letterpaper' or 'a4paper').
126+
#
127+
# 'papersize': 'letterpaper',
128+
129+
# The font size ('10pt', '11pt' or '12pt').
130+
#
131+
# 'pointsize': '10pt',
132+
133+
# Additional stuff for the LaTeX preamble.
134+
#
135+
# 'preamble': '',
136+
137+
# Latex figure (float) alignment
138+
#
139+
# 'figure_align': 'htbp',
140+
}
141+
142+
# Grouping the document tree into LaTeX files. List of tuples
143+
# (source start file, target name, title,
144+
# author, documentclass [howto, manual, or own class]).
145+
latex_documents = [
146+
(master_doc, 'jwql.tex', 'jwql Documentation',
147+
'STScI', 'manual'),
148+
]
149+
150+
151+
# -- Options for manual page output ---------------------------------------
152+
153+
# One entry per manual page. List of tuples
154+
# (source start file, name, description, authors, manual section).
155+
man_pages = [
156+
(master_doc, 'jwql', 'jwql Documentation',
157+
[author], 1)
158+
]
159+
160+
161+
# -- Options for Texinfo output -------------------------------------------
162+
163+
# Grouping the document tree into Texinfo files. List of tuples
164+
# (source start file, target name, title, author,
165+
# dir menu entry, description, category)
166+
texinfo_documents = [
167+
(master_doc, 'jwql', 'jwql Documentation',
168+
author, 'jwql', 'One line description of project.',
169+
'Miscellaneous'),
170+
]
171+
172+
173+

docs/source/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. jwql documentation master file, created by
2+
sphinx-quickstart on Wed Apr 4 10:30:20 2018.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to jwql's documentation!
7+
================================
8+
9+
General JWQL description here.
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
:caption: Contents:
14+
15+
API documentation
16+
=================
17+
18+
.. toctree::
19+
:maxdepth: 1
20+
:caption: Contents:
21+
22+
api_docs.rst
23+
24+
25+
Indices and tables
26+
==================
27+
28+
* :ref:`genindex`
29+
* :ref:`modindex`
30+
* :ref:`search`

environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ dependencies:
88
- jwst=0.7.8rc9
99
- matplotlib=2.1.1
1010
- numpy=1.14.0
11+
- numpydoc=0.8.0
1112
- postgresql=9.6.6
1213
- python=3.6.4
1314
- python-dateutil=2.6.1
1415
- sphinx=1.6.6
16+
- sphinx_rtd_theme=0.1.9
1517
- sqlalchemy=1.2.0
18+
- stsci_rtd_theme=0.0.1
1619
- pip:
1720
- sphinx-automodapi==0.7

0 commit comments

Comments
 (0)