Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch tutorial infrastructure to use Sphinx #153

Merged
merged 116 commits into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
f5f0669
add astropy-helpers
adrn Sep 22, 2017
d5ee582
move tutorials to docs subdir
adrn Sep 22, 2017
8e7c119
add sphinx template files
adrn Sep 22, 2017
156f459
copy in setup files
adrn Sep 22, 2017
0d5566b
move readme to RST
adrn Sep 22, 2017
cd5cca7
remove grabbing version from package
adrn Sep 22, 2017
0411dc7
remove old html dir
adrn Sep 22, 2017
798d099
ignore generated stuff
adrn Sep 22, 2017
e2e5a42
rename conesearch tutorial
adrn Sep 22, 2017
ee18d3b
add all tutorials to index
adrn Sep 22, 2017
902ea00
change timeout for nbconvert
adrn Sep 22, 2017
5f1c3a7
fix section header level
adrn Sep 22, 2017
a95ddaf
change search region and fix column names
adrn Sep 22, 2017
b344bca
change to md so sphinx doesn't collect
adrn Sep 22, 2017
086a556
try to resolve title level warnings
adrn Sep 22, 2017
5625206
Renaming for consistency
adrn Sep 28, 2017
86519e9
fix links in index
adrn Sep 28, 2017
098987c
add link to tutorials in docs dir
adrn Sep 28, 2017
fd3947a
hide in/out prompts
adrn Sep 28, 2017
f3c5acb
add astropy-helpers
adrn Sep 22, 2017
8662b8a
move tutorials to docs subdir
adrn Sep 22, 2017
5873989
add sphinx template files
adrn Sep 22, 2017
1b8930f
copy in setup files
adrn Sep 22, 2017
0fe3467
move readme to RST
adrn Sep 22, 2017
d03c41a
remove grabbing version from package
adrn Sep 22, 2017
d7685fc
remove old html dir
adrn Sep 22, 2017
17f0e94
ignore generated stuff
adrn Sep 22, 2017
8bf776f
rename conesearch tutorial
adrn Sep 22, 2017
052ee89
add all tutorials to index
adrn Sep 22, 2017
a582b0e
change timeout for nbconvert
adrn Sep 22, 2017
9391a7a
fix section header level
adrn Sep 22, 2017
284d9ce
change search region and fix column names
adrn Sep 22, 2017
0182091
change to md so sphinx doesn't collect
adrn Sep 22, 2017
570fc01
try to resolve title level warnings
adrn Sep 22, 2017
bcbb8af
Renaming for consistency
adrn Sep 28, 2017
caf5c44
fix links in index
adrn Sep 28, 2017
9f5710e
add link to tutorials in docs dir
adrn Sep 28, 2017
403faa6
set prompt width to 0
adrn Oct 3, 2017
abe2dd4
ah bootstrap file was missing
adrn Oct 3, 2017
74c7a6c
the most hacky of hacks to monkey-patch the RST template hard-coded i…
adrn Oct 10, 2017
c586954
added a link
adrn Oct 10, 2017
bd3da1d
fix css, link, and conf
adrn Oct 10, 2017
f400ab1
fix astropy-helpers url
adrn Oct 10, 2017
2d1a2f1
modify deploy script
adrn Oct 10, 2017
a7a4478
no longer need prepare deploy script
adrn Oct 10, 2017
6142f6f
move text to index
adrn Oct 10, 2017
1880c52
clean up section on nbsphinx
adrn Oct 10, 2017
94b2440
add header above list of tutorials
adrn Oct 10, 2017
751ebd6
Merge remote-tracking branch 'origin/sphinx' into sphinx
adrn Oct 20, 2017
da14bc1
script to execute and convert notebook
adrn Oct 21, 2017
c39893c
add skeleton of test
adrn Oct 21, 2017
ee77cef
comments
adrn Oct 21, 2017
ef0620f
walk through path, if a path is specified
adrn Oct 21, 2017
73263e0
add a simple test of the nbconvert machinery
adrn Oct 21, 2017
99a24f1
add option to remove the executed notebook
adrn Oct 21, 2017
960c9d6
add raises-exception tag to cell metadata
adrn Oct 21, 2017
e44858e
skip any notebook files in a checkpoints directory
adrn Oct 21, 2017
769bff2
also skip notebooks that have already been executed
adrn Oct 21, 2017
8cc186f
very rough, zeroth draft of developer docs
adrn Oct 21, 2017
f67bafa
added raises-exception tags where needed
adrn Oct 21, 2017
010020e
ignore executed notebooks
adrn Oct 21, 2017
9ec162c
remove nbsphinx
adrn Oct 21, 2017
7716d2b
remove link
adrn Oct 21, 2017
2cac97a
add option to specify output path
adrn Oct 21, 2017
f682a4e
add option to specify a template and move tutorials
adrn Oct 21, 2017
d0b08e9
added makefile option
adrn Oct 21, 2017
77bf998
use posixpath
adrn Oct 22, 2017
f532142
remove scripts from setup.py
adrn Oct 22, 2017
c659b3f
ignore generated tutorials
adrn Oct 22, 2017
1dd89e5
generate toctree from generated rst files
adrn Oct 22, 2017
ae09207
don't specify full path to nboutput for plots
adrn Oct 22, 2017
336140e
travis config
adrn Oct 22, 2017
3212caa
also install nbconvert
adrn Oct 22, 2017
2932b5a
add scipy to requirements - needed in coordinates cross-matching
adrn Oct 22, 2017
e052501
install dev version of nbconvert
adrn Oct 22, 2017
cdbac48
add nb->rst build to conf.py
adrn Oct 22, 2017
7abb090
add readthedocs config
adrn Oct 22, 2017
7f1f903
argh typo
adrn Oct 22, 2017
00007dc
update rtd environment to include nbconvert
adrn Oct 22, 2017
239c0ab
add jupyter and notebook to requirements
adrn Oct 22, 2017
1425686
ensure output dir exists
adrn Oct 22, 2017
5e8bf75
cleaning up old deploy scripts
adrn Oct 22, 2017
e6c5148
added some developer documentation
adrn Oct 22, 2017
55f751f
add binder link to each rendered page
adrn Oct 22, 2017
d198451
add note about nbconv version in rtd env
eteq Nov 2, 2017
d0780be
Add README section on building the tutorials
eteq Nov 2, 2017
fd032da
fixed env check
eteq Nov 2, 2017
94c5ec6
add missing requriements for vo
eteq Nov 2, 2017
092bcd1
add nosdiebar
eteq Nov 2, 2017
1ffa409
add kernelspec option
eteq Nov 2, 2017
e7fe198
add default nbfile_or_path to be sensible
eteq Nov 2, 2017
07fcd3e
Update description of build workflow in README
eteq Nov 3, 2017
1e02586
supressed nonlocal uri warnings
eteq Nov 3, 2017
9b3a380
rename dir structure
eteq Nov 3, 2017
7dc2751
add static path
eteq Nov 3, 2017
2883cf2
Merge pull request #7 from eteq/sphinx
adrn Nov 3, 2017
5cf4766
add pinned scipy version to pip req
adrn Nov 3, 2017
04ef725
rename class
adrn Nov 3, 2017
2d3dc39
fix travis execute path
adrn Nov 3, 2017
779e187
we renamed the docs dir
adrn Nov 3, 2017
76bf86a
possible fix for static nbs
eteq Nov 6, 2017
632a5f2
Add custom stylesheet to change text width
adrn Nov 13, 2017
b517e82
Merge branch 'sphinx' of github.com:adrn/astropy-tutorials into sphinx
adrn Nov 13, 2017
d612584
move Makefile to base with correct directories
eteq Nov 14, 2017
91a01ef
also move make.bat (not tested)
eteq Nov 14, 2017
5643b97
change path add to use the supplied helpers regardless of import success
eteq Nov 15, 2017
0a53993
make useful error message to help with what to do with missing helpers
eteq Nov 15, 2017
5c35023
add mismatch helpers warning
eteq Nov 15, 2017
75064ac
remove setups
eteq Nov 16, 2017
226581f
rewrite readme to defer to 'documentation'
adrn Nov 17, 2017
e2f1ba8
clean up landing page
adrn Nov 17, 2017
cc08da1
add make html instructions
adrn Nov 17, 2017
0801873
add back in cfg with metadata for the tutorials
eteq Nov 17, 2017
a1693a0
remove unnecessary ah_bootstrap.py
eteq Nov 17, 2017
3d32db3
add additional dev info
eteq Nov 17, 2017
ee479d0
use sensible dev versions
eteq Nov 17, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only these and not all EVENT_TYPEs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eteq - I would suggest to skip reviewing the travis setup as I plan to open a follow-up PR to set up the stages anyway once this is merged.


- 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
# - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these commented sections need to be there?

# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on the answer to my question above, you may need to also add these to the pip-requirements.txt file

- jupyter=1.0
- notebook=5.0
Loading