You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2018. It is now read-only.
@@ -25,7 +25,7 @@ To request a new feature, or guidance on how to implement it yourself, please op
25
25
Using Git and Github
26
26
========================
27
27
28
-
To contribute to the source code of the model you will need to fork the repository and place a pull request on GitHub. The two following sections describe this process in different levels of detail. If you are unfamiliar with git, you may wish to skip the quickstart guide and use the detailed instructions. All contributions are expected to conform with the :ref:`sec_code_style_guide`.
28
+
To contribute to the source code of the model you will need to fork the repository and place a pull request on GitHub. The two following sections describe this process in different levels of detail. If you are unfamiliar with git, you may wish to skip the quickstart guide and use the detailed instructions. All contributions to the source code are expected to conform with the :ref:`sec_code_style_guide`. Contributions to the manual should follow the same procedure and conform with :numref:`contrib_manual`.
29
29
30
30
31
31
Quickstart Guide
@@ -204,19 +204,15 @@ The MITgcm uses the continuous integration service Travis-CI to test code before
204
204
205
205
**Detailed instructions or link to be added.**
206
206
207
+
.. _contrib_manual:
207
208
208
209
Contributing to the manual
209
210
==========================
210
211
211
-
Whether you are correcting typos or describing currently undocumented packages, we welcome all contributions to the manual. The following information will help you make sure that your contribution is consistent with the style of the MITgcm documentation. (We know that not all of the current documentation follows these guidelines - we're working on it)
212
+
Whether you are simply correcting typos or describing undocumented packages, we welcome all contributions to the manual. The following information will help you make sure that your contribution is consistent with the style of the MITgcm documentation. (We know that not all of the current documentation follows these guidelines - we're working on it)
212
213
213
-
Once you've made your changes to the manual, you should build it locally to verify that it works as expected. To do this you will need a working python installation with the following modules installed (use :code:`pip install MODULE` in the terminal):
214
-
215
-
- sphinx
216
-
- sphinxcontrib-bibtex
217
-
- sphinx_rtd_theme
218
-
219
-
Then, run :code:`make html` in the :code:`docs` directory.
214
+
The manual is written in **rst** format, which is short for ReStructuredText directives. rst offers many wonderful features: it automatically does much of the formatting for you, it is reasonably well documented on the web (e.g. primers available `here <http://www.sphinx-doc.org/en/stable/rest.html>`_ and
215
+
`here <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_), it can accept raw latex syntax and track equation labelling for you, in addition to numerous other useful features. On the down side however, it can be very fussy about formatting, requiring exact spacing and indenting, and seemingly innocuous things such as blank spaces at ends of lines can wreak havoc. We suggest looking at the existing rst files in the manual to see exactly how something is formatted, along with the syntax guidelines specified in this section, prior to writing and formatting your own manual text.
220
216
221
217
222
218
Section headings
@@ -231,67 +227,109 @@ Section headings
231
227
N.B. all underlinings should be the same length as the heading. If they are too short an error will be produced.
232
228
233
229
234
-
Cross referencing
235
-
-----------------
230
+
Internal document references
231
+
----------------------------
232
+
233
+
rst allows internal referencing of figures, tables, section headings, and equations, i.e. clickable links that bring the reader to the respective figure etc. in the manual.
234
+
To be referenced, a unique label is required. To reference figures, tables, or section headings by number,
235
+
the rst (inline) directive is ``:numref:`LABELNAME```. For example, this syntax would write out ``Figure XX`` on a line. and when clicked, would relocate your position
236
+
in the manual to figure XX. Section Headings can also be referenced so that the name is written out instead of the section number, instead using this
237
+
directive ``:ref:`LABELNAME```.
238
+
239
+
Equation references have a slightly different inline syntax: ``:eq:`LABELNAME``` will produce a clickable equation number reference, surrounded by parentheses.
236
240
237
-
Labels go above the section they refer to, with the format ``.. _LABELNAME:``. The leading underscore is important.
241
+
For instructions how to assign a label to tables and figures, see below. To label a section heading, labels go above the section they refer to, with the format ``.. _LABELNAME:``.
242
+
Note the necessary leading underscore.
238
243
239
-
To reference sections/figures/tables/equations by number use this format for the reference: ``:numref:`sec_eg_baro```
240
244
241
-
To reference sections by name use this format: ``:ref:`sec_eg_baro```
245
+
External references
246
+
--------------------
242
247
248
+
hyperlinks
249
+
filelink
250
+
varlink
243
251
244
-
Maths
245
-
-----
252
+
Symbolic Notation
253
+
-----------------
246
254
247
-
Inline maths is done with ``:math:`LATEX_HERE```
255
+
Inline math is done with ``:math:`LATEX_HERE```
248
256
249
257
Separate equations, which will be typeset on their own lines, are produced with::
250
258
251
259
.. math::
252
-
:label: eqn_label_here
260
+
LATEX_HERE
261
+
:label: EQN_LABEL_HERE
253
262
254
-
LATEX_HERE
255
263
264
+
Labelled separate equations are assigned an equation number, which may be referenced elsewhere in the document (see :numref:`referencing`). Omitting the ``:label:`` above
265
+
will still produce an equation on its own line, except without an equation label.
266
+
Note that using using latex formatting ``\begin{aligned}`` ... ``\end{aligned}`` across multiple lines of equations will not work in conjunction with unique equation labels for each separate line.
256
267
257
-
.. _subsec_manual_style_guide:
258
268
269
+
Figures and tables
270
+
------------------
259
271
260
-
Units
261
-
-----
272
+
provide example syntax of each
262
273
263
-
Units should be typeset in normal text, and exponents added with the ``:sup:`` command.
264
274
265
-
::
275
+
Other text blocks
276
+
-----------------
266
277
267
-
100 N m\ :sup:`--2`
278
+
To set several lines apart in an whitespace box, e.g. useful for showing lines in from a terminal session, rst uses ``::`` to set off a ‘literal block’.
279
+
For example::
268
280
269
-
If the exponent is negative use two dashes ``--`` to make the minus sign long enough. The backslash removes the space between the unit and the exponent.
281
+
::
270
282
283
+
% unix_command_foo
284
+
% unix_command_fum
271
285
272
286
273
287
274
-
Describing subroutine inputs and outputs
275
-
----------------------------------------
288
+
A splashier way to outline a block, including a box label, is to employ what is termed in rst as an ‘admonition block’.
289
+
In the manual these are used to show calling trees and for describing subroutine inputs and outputs. An example of
290
+
a subroutine input/output block is as follows:
276
291
277
-
This information should go in an 'adominition' block. The source code to achieve this is:
278
292
279
-
::
293
+
.. admonition:: This is an admonition block showing subroutine in/out syntax
An example of a calling tree syntax is :filelink:`here </doc/discrete_algorithm/discret_algorithm.rst>`.
289
306
290
-
:math:`\sigma_z`: **SlopeY** (argument)
291
307
292
-
:math:`S_x`: **SlopeX** (argument on exit)
293
308
294
-
:math:`S_y`: **SlopeY** (argument on exit)
309
+
310
+
.. _subsec_manual_style_guide:
311
+
312
+
313
+
Other style conventions
314
+
-----------------------
315
+
316
+
double quotes for inline literal computer output, variables, typing etc.
317
+
how to break up into smaller files
318
+
probably want to add more to this subsection; maybe add another subsection “other useful rst syntax”
319
+
320
+
321
+
Building the manual
322
+
-------------------
323
+
324
+
Once you've made your changes to the manual, you should build it locally to verify that it works as expected. To do this you will need a working python installation with the following modules installed (use :code:`pip install MODULE` in the terminal):
325
+
326
+
- sphinx
327
+
- sphinxcontrib-bibtex
328
+
- sphinx_rtd_theme
329
+
330
+
Then, run :code:`make html` in the :code:`docs` directory.
331
+
332
+
295
333
296
334
.. _sec_pullreq:
297
335
@@ -332,3 +370,40 @@ and switch to the desired branch
332
370
You now have a local copy of the code from the pull request and can run tests locally. If you have write access to the main repository you can push fixes or changes directly to the pull request.
333
371
334
372
None of these steps, apart from pushing fixes back to the pull request, require write access to either the main repository or the repository of the person proposing the pull request. This means that anyone can review pull requests. However, unless you are one of the core developers you won't be able to directly push changes. You will instead have to make a comment describing any problems you find.
373
+
374
+
375
+
Old Stuff to remove:
376
+
377
+
Units should be typeset in normal text, and exponents added with the ``:sup:`` command.
378
+
379
+
::
380
+
381
+
100 N m\ :sup:`--2`
382
+
383
+
If the exponent is negative use two dashes ``--`` to make the minus sign long enough. The backslash removes the space between the unit and the exponent.
384
+
385
+
386
+
387
+
388
+
Describing subroutine inputs and outputs
389
+
----------------------------------------
390
+
391
+
This information should go in an 'adminition' block. The source code to achieve this is:
0 commit comments