Skip to content

Commit 2709f5c

Browse files
authored
Merge pull request #198 from adrn/better-header
Better header
2 parents d396ce2 + 33d020d commit 2709f5c

File tree

4 files changed

+51
-26
lines changed

4 files changed

+51
-26
lines changed

CONTRIBUTING.rst

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ Overview
2828
* Each tutorial should have 3–5 explicit `Learning Goals
2929
<http://tll.mit.edu/help/intended-learning-outcomes>`_, demonstrate ~2–3
3030
pieces of functionality relevant to astronomy, and 2–3 demonstrations of
31-
generic but commonly used functionality (e.g., numpy, matplotlib)
31+
generic but commonly used functionality (e.g., ``numpy``, ``matplotlib``)
3232
* Roughly follow this progression:
33-
* *Intput/Output*: read in some data (use `astroquery
34-
<https://astroquery.readthedocs.io/en/latest/>`_ where possible
35-
* *Analysis*: do something insightful/useful with the data
33+
* *Input/Output*: read in some data (use `astroquery
34+
<https://astroquery.readthedocs.io/en/latest/>`_ where possible to query
35+
real astronomical datasets)
36+
* *Analysis*: do something insightful / useful with the data
3637
* *Visualization*: make a pretty figure (use `astropy.visualization
3738
<http://docs.astropy.org/en/stable/visualization/>`_ where possible)
3839
* The tutorials must be compatible with the versions supported by the last major
@@ -72,9 +73,9 @@ Narrative
7273
formatting, links, latex, and code snippets.
7374
* Title should be short yet descriptive and emphasize the learning goals of the
7475
tutorial. Try to make the title appeal to a broad audience and avoid
75-
referencing a specefic instrument, catalog, or anything wavelength dependent.
76-
* List all author's full names (comma separated) and link to github profile
77-
and/or `ORCID iD <https://orcid.org/>`_.
76+
referencing a specific instrument, catalog, or anything wavelength dependent.
77+
* List all author's full names (comma separated) and link to GitHub profile
78+
and/or `ORCID iD <https://orcid.org/>`_ when relevant.
7879
* Include `Learning Goals <http://tll.mit.edu/help/intended-learning-outcomes>`_
7980
at the top as a bulleted list.
8081
* Include Keywords as a comma separated list of topics, packages, and functions
@@ -97,22 +98,23 @@ Template intro
9798

9899
.. code-block:: none
99100
100-
# Doing a thing with things
101+
# Title name
101102
102103
## Authors
103104
Jane Smith, Jose Jones
104105
105-
## Leaning Goals
106-
- Query..
107-
- Calculate..
108-
- Display..
106+
## Learning Goals
107+
* Query the ... dataset
108+
* Calculate ...
109+
* Display ...
109110
110111
## Keywords
111112
Example, example, example
112113
113114
## Companion Content
114115
Carroll & Ostlie 10.3, Binney & Tremaine 1.5
115116
117+
## Summary
116118
In this tutorial, we download a data file, do something to it, and then
117119
visualize it.
118120
@@ -126,7 +128,7 @@ concepts `branch, push, pull request <https://help.github.com/articles/proposing
126128

127129
To contribute a new tutorial, first fork the ``astropy-tutorials`` repository.
128130
Then, clone your fork locally to your machine (replace <GITHUB USERNAME> with
129-
your github username)::
131+
your GitHub username)::
130132

131133
git clone [email protected]:<GITHUB USERNAME>/astropy-tutorials.git
132134

@@ -148,8 +150,8 @@ notebook file itself -- should go in this directory.
148150

149151
Specify the python packages the tutorial depends on by creating a text file
150152
called ``requirements.txt`` in the same notebook directory. For example, if your
151-
tutorial requires scipy version 1.0 and numpy version 1.13 or greater, your
152-
``requirements.txt`` file would look like:
153+
tutorial requires ``scipy`` version 1.0 and ``numpy`` version 1.13 or greater,
154+
your ``requirements.txt`` file would look like:
153155

154156
.. code-block:: none
155157
@@ -158,15 +160,15 @@ tutorial requires scipy version 1.0 and numpy version 1.13 or greater, your
158160
159161
To see an example, have a look at the FITS-header `requirements.txt file <https:
160162
//github.com/astropy/astropy-tutorials/blob/master/tutorials/notebooks/FITS-head
161-
er/requirements.json>`_.
163+
er/requirements.txt>`_.
162164

163165
Push the notebook and other files from your local branch up to your fork of the
164166
repository on GitHub (by default, named 'origin')::
165167

166168
git push origin Spectral-Line-Fitting
167169

168170
When the tutorial is ready for broader community feedback, `open a pull request
169-
<https://help.github.com/articles/creating-a-pull-request/>`_against the main
171+
<https://help.github.com/articles/creating-a-pull-request/>`_ against the main
170172
``astropy-tutorials`` repository in order for the community to review the new
171173
tutorial.
172174

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ clean:
3737
-rm -rf $(BUILDDIR)
3838
-rm -rf api
3939
-rm -rf generated
40+
-rm -rf tutorials/rst-tutorials
4041

4142
html:
4243
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

tutorials/_static/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ div.body {
77

88
div.body p {
99
font-size: 15px;
10+
line-height: 20px;
1011
}
1112

1213
span.inputnumrole {
@@ -16,3 +17,18 @@ span.inputnumrole {
1617
span.outputnumrole {
1718
color: #D84315
1819
}
20+
21+
button {
22+
border-radius: 5px;
23+
border-width: 0;
24+
padding: 6px 10px 6px 10px;
25+
cursor: pointer;
26+
margin-right: 12px;
27+
color: #ffffff;
28+
font-size: 10pt;
29+
background-image: linear-gradient(to bottom, #FFA47D 0%, #FF7D45 100%)
30+
}
31+
32+
#spacer {
33+
margin-top: 24px;
34+
}

tutorials/astropy.tpl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,30 @@
55
{# Remove the exec_ prefix #}
66
{% set nb_name = resources.metadata.name[5:] %}
77

8-
.. note::
9-
10-
This tutorial was generated from a Jupyter notebook that can be downloaded `here
11-
<../_static/{{ nb_name }}/{{ nb_name }}.ipynb>`_.
12-
13-
You can interact with a live version of the source notebook through binder:
8+
.. raw:: html
149

15-
|binder{{ nb_name }}|
10+
<a href="../_static/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="download">Download tutorial notebook</button></a>
11+
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>
1612

17-
.. |binder{{ nb_name }}| image:: http://mybinder.org/badge.svg
18-
:target: https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb
13+
<div id="spacer"></div>
1914

2015
.. role:: inputnumrole
2116
.. role:: outputnumrole
2217

2318
.. _{{nb_name}}:
2419
{% endblock %}
2520

21+
{% block footer %}
22+
23+
.. raw:: html
24+
25+
<div id="spacer"></div>
26+
27+
<a href="../_static/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="download">Download tutorial notebook</button></a>
28+
<a href="https://beta.mybinder.org/v2/gh/astropy/astropy-tutorials/master?filepath=/tutorials/notebooks/{{ nb_name }}/{{ nb_name }}.ipynb"><button id="binder">Interactive tutorial notebook</button></a>
29+
30+
{% endblock %}
31+
2632
{% block in_prompt %}
2733

2834
:inputnumrole:`In[{{ cell['execution_count'] }}]:`

0 commit comments

Comments
 (0)