Show More
@@ -1,8 +1,11 | |||
|
1 | .. _documenting-ipython: | |
|
2 | ||
|
3 | ===================== | |
|
1 | 4 | Documenting IPython |
|
2 | =================== | |
|
5 | ===================== | |
|
3 | 6 | |
|
4 | 7 | Standalone documentation |
|
5 | ------------------------ | |
|
8 | ======================== | |
|
6 | 9 | |
|
7 | 10 | All standalone documentation should be written in plain text (``.txt``) files |
|
8 | 11 | using `reStructuredText`_ for markup and formatting. All such documentation |
@@ -12,31 +15,32 documentation in this location will serve as the main source for IPython | |||
|
12 | 15 | documentation and all existing documentation should be converted to this |
|
13 | 16 | format. |
|
14 | 17 | |
|
15 | In the future, the text files in the ``docs`` directory will be used to | |
|
16 | generate all forms of documentation for IPython. This include documentation on | |
|
17 | the IPython website as well as *pdf* documentation. | |
|
18 | The actual HTML and PDF docs are built using the Sphinx_ documentation | |
|
19 | generation tool. Sphinx has been adopted as the default documentation tool for | |
|
20 | Python itself as of version 2.6, as well as by a number of projects that | |
|
21 | IPython is related with, such as numpy, scipy, matplotlib, sage and nipy. | |
|
18 | 22 | |
|
19 | 23 | .. _reStructuredText: http://docutils.sourceforge.net/rst.html |
|
24 | .. _Sphinx: http://sphinx.pocoo.org/ | |
|
20 | 25 | |
|
21 | A bit of shell code: | |
|
22 | 26 | |
|
23 | .. code-block:: bash | |
|
27 | The rest of this document is mostly taken from the `matploblib | |
|
28 | documentation`__; we are using a number of Sphinx tools and extensions written | |
|
29 | by the matplotlib team and will mostly follow their conventions, which are | |
|
30 | nicely spelled out in their guide. What follows is thus a lightly adapted | |
|
31 | version of the matplotlib documentation guide, taken with permission from the | |
|
32 | MPL team. | |
|
24 | 33 | |
|
25 | cd /tmp | |
|
26 | echo "My home directory is: $HOME" | |
|
27 | ls | |
|
34 | .. __: http://matplotlib.sourceforge.net/doc/html/devel/documenting_mpl.html | |
|
28 | 35 | |
|
29 | A bit of Python code: | |
|
30 | 36 | |
|
31 | .. code-block:: python | |
|
37 | A bit of Python code:: | |
|
32 | 38 | |
|
33 | 39 | for i in range(10): |
|
34 | 40 | print i, |
|
35 | 41 | print "A big number:",2**34 |
|
36 | 42 | |
|
37 | An interactive Python session: | |
|
38 | ||
|
39 | .. code-block:: python | |
|
43 | An interactive Python session:: | |
|
40 | 44 | |
|
41 | 45 | >>> from IPython import genutils |
|
42 | 46 | >>> genutils.get_ipython_dir() |
@@ -47,15 +51,27 An IPython session: | |||
|
47 | 51 | |
|
48 | 52 | .. code-block:: ipython |
|
49 | 53 | |
|
50 |
In [ |
|
|
54 | In [7]: import IPython | |
|
51 | 55 | |
|
52 |
In [ |
|
|
56 | In [8]: print "This IPython is version:",IPython.__version__ | |
|
53 | 57 | This IPython is version: 0.9.1 |
|
54 | 58 | |
|
59 | In [9]: 2+4 | |
|
60 | Out[9]: 6 | |
|
61 | ||
|
62 | ||
|
63 | A bit of shell code: | |
|
64 | ||
|
65 | .. code-block:: bash | |
|
66 | ||
|
67 | cd /tmp | |
|
68 | echo "My home directory is: $HOME" | |
|
69 | ls | |
|
70 | ||
|
55 | 71 | |
|
56 | 72 | |
|
57 | 73 | Docstring format |
|
58 | ---------------- | |
|
74 | ================ | |
|
59 | 75 | |
|
60 | 76 | Good docstrings are very important. All new code will use `Epydoc`_ for |
|
61 | 77 | generating API docs, so we will follow the `Epydoc`_ conventions. More |
General Comments 0
You need to be logged in to leave comments.
Login now