0
|
1 |
.. _getting_started:
|
|
2 |
|
|
3 |
|
|
4 |
***************
|
|
5 |
Getting started
|
|
6 |
***************
|
|
7 |
|
|
8 |
.. _installing-rocks
|
|
9 |
|
|
10 |
Installing Rocks on the frontend - node (q.rz-berlin.mpg.de, 141.14.128.18)
|
|
11 |
|
|
12 |
ToDo: rz->fhi
|
|
13 |
|
|
14 |
Access to iDrac service interface
|
|
15 |
=================================
|
|
16 |
|
|
17 |
Access via http to 141.14.128.17 (q-sp.rz-berlin.mpg.de)
|
|
18 |
|
|
19 |
Initial password can be found at extendable label.
|
|
20 |
|
|
21 |
Root password changed to PP&B default remote access.
|
|
22 |
|
|
23 |
You may already have sphinx `sphinx <http://sphinx.pocoo.org/>`_
|
|
24 |
installed -- you can check by doing::
|
|
25 |
|
|
26 |
python -c 'import sphinx'
|
|
27 |
|
|
28 |
If that fails grab the latest version of and install it with::
|
|
29 |
|
|
30 |
> sudo easy_install -U Sphinx
|
|
31 |
|
|
32 |
Now you are ready to build a template for your docs, using
|
|
33 |
sphinx-quickstart::
|
|
34 |
|
|
35 |
> sphinx-quickstart
|
|
36 |
|
|
37 |
accepting most of the defaults. I choose "sampledoc" as the name of my
|
|
38 |
project. cd into your new directory and check the contents::
|
|
39 |
|
|
40 |
home:~/tmp/sampledoc> ls
|
|
41 |
Makefile _static conf.py
|
|
42 |
_build _templates index.rst
|
|
43 |
|
|
44 |
The index.rst is the master ReST for your project, but before adding
|
|
45 |
anything, let's see if we can build some html::
|
|
46 |
|
|
47 |
make html
|
|
48 |
|
|
49 |
If you now point your browser to :file:`_build/html/index.html`, you
|
|
50 |
should see a basic sphinx site.
|
|
51 |
|
|
52 |
.. image:: _static/basic_screenshot.png
|
|
53 |
|
|
54 |
.. _fetching-the-data:
|
|
55 |
|
|
56 |
Fetching the data
|
|
57 |
-----------------
|
|
58 |
|
|
59 |
Now we will start to customize out docs. Grab a couple of files from
|
|
60 |
the `web site <https://github.com/matplotlib/sampledoc>`_
|
|
61 |
or git. You will need :file:`getting_started.rst` and
|
|
62 |
:file:`_static/basic_screenshot.png`. All of the files live in the
|
|
63 |
"completed" version of this tutorial, but since this is a tutorial,
|
|
64 |
we'll just grab them one at a time, so you can learn what needs to be
|
|
65 |
changed where. Since we have more files to come, I'm going to grab
|
|
66 |
the whole git directory and just copy the files I need over for now.
|
|
67 |
First, I'll cd up back into the directory containing my project, check
|
|
68 |
out the "finished" product from git, and then copy in just the files I
|
|
69 |
need into my :file:`sampledoc` directory::
|
|
70 |
|
|
71 |
home:~/tmp/sampledoc> pwd
|
|
72 |
/Users/jdhunter/tmp/sampledoc
|
|
73 |
home:~/tmp/sampledoc> cd ..
|
|
74 |
home:~/tmp> git clone https://github.com/matplotlib/sampledoc.git tutorial
|
|
75 |
Cloning into 'tutorial'...
|
|
76 |
remote: Counting objects: 87, done.
|
|
77 |
remote: Compressing objects: 100% (43/43), done.
|
|
78 |
remote: Total 87 (delta 45), reused 83 (delta 41)
|
|
79 |
Unpacking objects: 100% (87/87), done.
|
|
80 |
Checking connectivity... done
|
|
81 |
home:~/tmp> cp tutorial/getting_started.rst sampledoc/
|
|
82 |
home:~/tmp> cp tutorial/_static/basic_screenshot.png sampledoc/_static/
|
|
83 |
|
|
84 |
The last step is to modify :file:`index.rst` to include the
|
|
85 |
:file:`getting_started.rst` file (be careful with the indentation, the
|
|
86 |
"g" in "getting_started" should line up with the ':' in ``:maxdepth``::
|
|
87 |
|
|
88 |
Contents:
|
|
89 |
|
|
90 |
.. toctree::
|
|
91 |
:maxdepth: 2
|
|
92 |
|
|
93 |
getting_started.rst
|
|
94 |
|
|
95 |
and then rebuild the docs::
|
|
96 |
|
|
97 |
cd sampledoc
|
|
98 |
make html
|
|
99 |
|
|
100 |
|
|
101 |
When you reload the page by refreshing your browser pointing to
|
|
102 |
:file:`_build/html/index.html`, you should see a link to the
|
|
103 |
"Getting Started" docs, and in there this page with the screenshot.
|
|
104 |
`Voila!`
|
|
105 |
|
|
106 |
Note we used the image directive to include to the screenshot above
|
|
107 |
with::
|
|
108 |
|
|
109 |
.. image:: _static/basic_screenshot.png
|
|
110 |
|
|
111 |
|
|
112 |
Next we'll customize the look and feel of our site to give it a logo,
|
|
113 |
some custom css, and update the navigation panels to look more like
|
|
114 |
the `sphinx <http://sphinx.pocoo.org/>`_ site itself -- see
|
|
115 |
:ref:`custom_look`.
|
|
116 |
|