Skip to content

Commit

Permalink
Merge pull request #153 from adrn/sphinx
Browse files Browse the repository at this point in the history
Switch tutorial infrastructure to use Sphinx
  • Loading branch information
eteq authored Nov 17, 2017
2 parents 910cc51 + ee479d0 commit 5680c3a
Show file tree
Hide file tree
Showing 66 changed files with 1,728 additions and 1,877 deletions.
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.ipynb_checkpoints/
html/
runipy-*
build/
tutorials/rst-tutorials/
IPython-*
tutorials/*/_run_*
tutorials/*/*.fits
tutorials/*/*.pdf
tutorials/*/*.png
*.fits
*.pdf
*.png
*.jpg
*.pyc
*.tex
exec*.ipynb
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "astropy_helpers"]
path = astropy_helpers
url = https://github.com/astropy/astropy-helpers.git
17 changes: 17 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: tutorials

channels:
- astropy

dependencies:
- python=3.6
- IPython=6.1.0
- astropy=2.0
- astroquery=0.3.6
- matplotlib=2.0.2
- numpy=1.13.1
- scipy=0.19 # needed for coordinates cross-matching
- jupyter=1.0
- notebook=5.0
- pip:
- git+https://github.com/jupyter/nbconvert # this is really >=5.4, but at the time of adding this that wasn't yet available
55 changes: 39 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,52 @@
language: c

sudo: false

os:
- linux

sudo: false

addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng

env:
global:

- PYTHON_VERSION=3.6
- SETUP_XVFB=True
- CONDA_ENVIRONMENT=conda-environment.yml
- CONDA_DEPENDENCIES='jupyter notebook ipython runipy'
- GH_REF: github.com/astropy/astropy-tutorials.git
- secure: "NBZlEg//sDYvJikqXESLsx/WA1Nj7fAH2mJfI8ZVMnolvyjJuLdEMxxEYFP8t6U/iieSSrgUkgP94yy5Oq6iJRjj7ThGCdcjgvgWTQCzoQgEVDc5SzdJGyGs30VC+8t7GTobzMe086HX16SJRvsIumqXdmRcJjAdMCyhMUxLoUg="
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- EVENT_TYPE='pull_request push'

- CONDA_ENVIRONMENT='conda-environment.yml'
- CONDA_DEPENDENCIES='jupyter ipython'
- CONDA_CHANNELS='astropy-ci-extras astropy'

# We need to install the master/latest version of nbconvert because it has support for
# allowing exceptions in individual cells:
- PIP_DEPENDENCIES='git+https://github.com/jupyter/nbconvert'

# matrix:

# # Don't wait for allowed failures
# fast_finish: true

# include:

# - os: linux
# env: SETUP_CMD='test --coverage'

install:
- git clone git://github.com/astropy/ci-helpers.git

- git clone --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh

script:
- python prepare_deploy.py run

deploy:
provider: script
script: ./travis_deploy
on:
repo: astropy/astropy-tutorials
branch: master
# - |
# python scripts/convert.py docs/_static/tutorials/ -v
# --output-path=docs/rst-tutorials
# --template=docs/_static/astropy.tpl
- python scripts/convert.py tutorials/notebooks --exec-only -v

29 changes: 0 additions & 29 deletions DEPLOY.md

This file was deleted.

131 changes: 131 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) tutorials

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " tutorials to convert all tutorials to RST"

clean:
-rm -rf $(BUILDDIR)
-rm -rf api
-rm -rf generated

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Astropy.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Astropy.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/Astropy"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Astropy"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
@echo "Run 'python setup.py test' in the root directory to run doctests " \
@echo "in the documentation."
29 changes: 0 additions & 29 deletions README.md

This file was deleted.

32 changes: 32 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Astropy Tutorials
=================

This repository contains tutorials for the `Astropy <http://astropy.org>`_
project. These are typically longer-form, more narrative presentations of
functionality in the `Astropy core package
<https://github.com/astropy/astropy>`_ and any `affiliated packages
<http://www.astropy.org/affiliated/index.html>`_. The tutorials are therefore
different from the `Astropy core package documentation
<http://docs.astropy.org>`_, which presents a more structured and exhaustive
view of the core package.

To see the tutorials rendered as static web pages, see the `Astropy tutorials
site <http://tutorials.astropy.org>`_.

To run the tutorials interactively, you'll need to make sure you have `Jupyter
notebook <http://jupyter.org/>`_ installed, then clone or download this
repository. The notebook files themselves live in the ``tutorials`` directory
of this repository, organized by the names of the tutorials.

You can also get started quickly using `Binder <http://mybinder.org>`_ to run the tutorials in
your web browser within a remote server:

.. image:: http://mybinder.org/badge.svg
:target: http://mybinder.org/repo/astropy/astropy-tutorials/docs/tutorials

Contributing tutorial material
------------------------------

Please see the "`For contributors
<http://astropy-tutorials.readthedocs.io/en/latest/#for-contributors>`_" section
of the tutorials documentation for information on how to get started.
1 change: 1 addition & 0 deletions astropy_helpers
Submodule astropy_helpers added at aaa450
3 changes: 3 additions & 0 deletions conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ dependencies:
- astroquery=0.3.6
- matplotlib=2.0.2
- numpy=1.13.1
- scipy=0.19 # needed for coordinates cross-matching
- jupyter=1.0
- notebook=5.0
Loading

0 comments on commit 5680c3a

Please sign in to comment.