Skip to content

Commit f320bd4

Browse files
authored
Merge pull request #59 from ocefpaf/docs
Build and publish documentation...
2 parents 8e44b73 + a103527 commit f320bd4

40 files changed

+436
-509
lines changed

.travis.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ language: minimal
22

33
sudo: false
44

5+
env:
6+
global:
7+
- secure: "c1HxpvYvasSjycR2iejkLxtlFzMvR8Gmf2GQDPJfIkEftQGvXOt+m91Wy26e819eHeXiQUuoNQwnp6RgOW8woNrlqfro4GX6pgLZlmr4K5Plum1KLa/xs8wk+bN/XpgRbcOqwAFbWfoPbfbm3oP1/QoFiwT38KbGWONlYVGKlKM="
8+
59
matrix:
610
fast_finish: true
711
include:
812
- name: default
913
env: TEST_TARGET=default PY=3.7
10-
- python: coding_standards
14+
- name: coding_standards
1115
env: TEST_TARGET=coding_standards PY=3.7
16+
- name: docs
17+
env: TEST_TARGET=docs PY=3.7
1218

1319
before_install:
1420
- wget http://bit.ly/miniconda -O miniconda.sh
@@ -36,3 +42,30 @@ script:
3642
- if [[ $TEST_TARGET == 'coding_standards' ]]; then
3743
flake8 --max-line-length=105 oceans --exclude=_version.py ;
3844
fi
45+
46+
- if [[ $TEST_TARGET == 'docs' ]]; then
47+
set -e ;
48+
conda install doctr ;
49+
pushd docs ;
50+
make clean html linkcheck ;
51+
popd ;
52+
python -m doctr deploy --built-docs docs/build/html . ;
53+
fi
54+
55+
doctr:
56+
require-master: true
57+
sync: False
58+
59+
deploy:
60+
skip_cleanup: true
61+
provider: pypi
62+
user: ocefpaf
63+
password:
64+
secure: "HifofjCDgTUP3hv0C8xD411JBCIp7VziSE5SiD9ZXo9CGo/rnr2rxtIcA9QDHfwO0n1iK26AhUbmeUURecn7+GjvvwCsbN3y21zfx0/D6KCSCvfEuJBJG2uAZqbNBFkT5//96umsavVngp0vNzOASDCljBgC9t5X0r1JnybQUro="
65+
distributions: sdist bdist_wheel
66+
upload_docs: no
67+
on:
68+
repo: pyoceans/python-oceans
69+
tags: true
70+
all_branches: master
71+
condition: '$TEST_TARGET == "default"'

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
SOURCEDIR = source
8+
BUILDDIR = build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/RPSstuff.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:mod:`oceans.RPSstuff`
2+
----------------------
3+
4+
.. automodule:: oceans.RPSstuff
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/_static/logo.png

8.83 KB
Loading

docs/source/colormaps.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:mod:`oceans.colormaps`
2+
-----------------------
3+
4+
.. automodule:: oceans.colormaps
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/conf.py

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'oceans'
23+
copyright = '2018, Filipe Fernandes'
24+
author = 'Filipe Fernandes'
25+
26+
from oceans._version import get_versions
27+
version = release = get_versions()['version']
28+
del get_versions
29+
30+
# -- General configuration ---------------------------------------------------
31+
32+
# If your documentation needs a minimal Sphinx version, state it here.
33+
#
34+
# needs_sphinx = '1.0'
35+
36+
# Add any Sphinx extension module names here, as strings. They can be
37+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
38+
# ones.
39+
extensions = [
40+
'sphinx.ext.autodoc',
41+
'sphinx.ext.mathjax',
42+
'sphinx.ext.githubpages',
43+
'sphinx.ext.viewcode',
44+
'sphinx.ext.napoleon',
45+
'nbsphinx',
46+
]
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
templates_path = ['_templates']
50+
51+
# The suffix(es) of source filenames.
52+
# You can specify multiple suffix as a list of string:
53+
#
54+
# source_suffix = ['.rst', '.md']
55+
source_suffix = '.rst'
56+
57+
# The master toctree document.
58+
master_doc = 'index'
59+
60+
# The language for content autogenerated by Sphinx. Refer to documentation
61+
# for a list of supported languages.
62+
#
63+
# This is also used if you do content translation via gettext catalogs.
64+
# Usually you set "language" from the command line for these cases.
65+
language = None
66+
67+
# List of patterns, relative to source directory, that match files and
68+
# directories to ignore when looking for source files.
69+
# This pattern also affects html_static_path and html_extra_path.
70+
exclude_patterns = []
71+
72+
# The name of the Pygments (syntax highlighting) style to use.
73+
pygments_style = None
74+
75+
76+
# -- Options for HTML output -------------------------------------------------
77+
78+
# The theme to use for HTML and HTML Help pages. See the documentation for
79+
# a list of builtin themes.
80+
#
81+
html_theme = 'alabaster'
82+
83+
# Theme options are theme-specific and customize the look and feel of a theme
84+
# further. For a list of options available for each theme, see the
85+
# documentation.
86+
#
87+
html_theme_options = {
88+
'logo': 'logo.png',
89+
'logo_name': 'oceans',
90+
'github_user': 'pyoceans',
91+
'github_repo': 'oceans',
92+
'github_banner': True,
93+
'travis_button': True,
94+
'fixed_sidebar': True,
95+
}
96+
97+
# Add any paths that contain custom static files (such as style sheets) here,
98+
# relative to this directory. They are copied after the builtin static files,
99+
# so a file named "default.css" will overwrite the builtin "default.css".
100+
html_static_path = ['_static']
101+
102+
# Custom sidebar templates, must be a dictionary that maps document names
103+
# to template names.
104+
#
105+
# The default sidebars (for documents that don't match any pattern) are
106+
# defined by theme itself. Builtin themes are using these templates by
107+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
108+
# 'searchbox.html']``.
109+
#
110+
html_sidebars = {
111+
'**': [
112+
'about.html',
113+
'navigation.html',
114+
'relations.html', # needs 'show_related': True theme option to display
115+
'searchbox.html',
116+
'donate.html',
117+
]
118+
}
119+
120+
121+
# -- Options for HTMLHelp output ---------------------------------------------
122+
123+
# Output file base name for HTML help builder.
124+
htmlhelp_basename = 'oceansdoc'
125+
126+
127+
# -- Options for LaTeX output ------------------------------------------------
128+
129+
latex_elements = {
130+
# The paper size ('letterpaper' or 'a4paper').
131+
#
132+
# 'papersize': 'letterpaper',
133+
134+
# The font size ('10pt', '11pt' or '12pt').
135+
#
136+
# 'pointsize': '10pt',
137+
138+
# Additional stuff for the LaTeX preamble.
139+
#
140+
# 'preamble': '',
141+
142+
# Latex figure (float) alignment
143+
#
144+
# 'figure_align': 'htbp',
145+
}
146+
147+
# Grouping the document tree into LaTeX files. List of tuples
148+
# (source start file, target name, title,
149+
# author, documentclass [howto, manual, or own class]).
150+
latex_documents = [
151+
(master_doc, 'oceans.tex', 'oceans Documentation',
152+
'Filipe Fernandes', 'manual'),
153+
]
154+
155+
156+
# -- Options for manual page output ------------------------------------------
157+
158+
# One entry per manual page. List of tuples
159+
# (source start file, name, description, authors, manual section).
160+
man_pages = [
161+
(master_doc, 'oceans', 'oceans Documentation',
162+
[author], 1)
163+
]
164+
165+
166+
# -- Options for Texinfo output ----------------------------------------------
167+
168+
# Grouping the document tree into Texinfo files. List of tuples
169+
# (source start file, target name, title, author,
170+
# dir menu entry, description, category)
171+
texinfo_documents = [
172+
(master_doc, 'oceans', 'oceans Documentation',
173+
author, 'oceans', 'One line description of project.',
174+
'Miscellaneous'),
175+
]
176+
177+
178+
# -- Options for Epub output -------------------------------------------------
179+
180+
# Bibliographic Dublin Core info.
181+
epub_title = project
182+
183+
# The unique identifier of the text. This can be a ISBN number
184+
# or the project homepage.
185+
#
186+
# epub_identifier = ''
187+
188+
# A unique identification for the text.
189+
#
190+
# epub_uid = ''
191+
192+
# A list of files that should not be packed into the epub file.
193+
epub_exclude_files = ['search.html']
194+
195+
196+
# -- Extension configuration -------------------------------------------------

docs/source/datasets.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:mod:`oceans.datasets`
2+
----------------------
3+
4+
.. automodule:: oceans.datasets
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/filters.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:mod:`oceans.filters`
2+
---------------------
3+
4+
.. automodule:: oceans.filters
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/index.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. oceans documentation master file, created by
2+
sphinx-quickstart on Fri Nov 2 15:42:53 2018.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Misc helper functions for ocean sciences
7+
========================================
8+
9+
Most of the functions here are Python versions of some common Matlab functions.
10+
They are untested and probably buggy. Use with caution!
11+
12+
.. toctree::
13+
:maxdepth: 3
14+
:caption: Contents:
15+
16+
datasets
17+
colormaps
18+
plotting
19+
ocfis
20+
filters
21+
RPSstuff
22+
23+
Indices and tables
24+
==================
25+
26+
* :ref:`genindex`
27+
* :ref:`modindex`
28+
* :ref:`search`

docs/source/ocfis.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:mod:`oceans.ocfis`
2+
-------------------
3+
4+
.. automodule:: oceans.ocfis
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)