Skip to content

Commit 0f5d979

Browse files
authored
Merge pull request #3631 from stsewd/improve-installation-guide
Improve installation guide
2 parents 9917933 + 58d9701 commit 0f5d979

File tree

4 files changed

+101
-78
lines changed

4 files changed

+101
-78
lines changed

docs/.rstcheck.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[rstcheck]
2-
ignore_directives=automodule,http:get
2+
ignore_directives=automodule,http:get,tabs,tab
33
ignore_roles=djangosetting,setting
44
ignore_messages=(Duplicate implicit target name: ".*")|(Hyperlink target ".*" is not referenced)

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'sphinxcontrib.httpdomain',
2828
'djangodocs',
2929
'doc_extensions',
30+
'sphinx_tabs.tabs',
3031
]
3132
templates_path = ['_templates']
3233

docs/install.rst

+98-77
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,113 @@
11
Installation
22
============
33

4-
Here is a step by step plan on how to install Read the Docs.
4+
Here is a step by step guide on how to install Read the Docs.
55
It will get you to a point of having a local running instance.
66

7+
Requirements
8+
------------
79

8-
First, obtain `Python 3.6`_ and virtualenv_ if you do not already have them. Using a
9-
virtual environment will make the installation easier, and will help to avoid
10-
clutter in your system-wide libraries. You will also need Git_ in order to
11-
clone the repository. If you plan to import Python 2.7 project to your RTD then you'll
12-
need to install Python 2.7 with virtualenv in your system as well.
10+
First, obtain `Python 3.6`_ and virtualenv_ if you do not already have them.
11+
Using a virtual environment is strongly recommended,
12+
since it will help you to avoid clutter in your system-wide libraries.
1313

14+
Additionally Read the Docs depends on:
1415

15-
.. _Python 3.6: http://www.python.org/
16-
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
17-
.. _Git: http://git-scm.com/
18-
.. _Homebrew: http://brew.sh/
19-
.. _Elasticsearch: https://www.elastic.co/products/elasticsearch
20-
.. _PostgreSQL: https://www.postgresql.org/
21-
.. _Redis: https://redis.io/
22-
23-
.. note::
16+
* `Git`_ (version >=2)
17+
* `Mercurial`_ (only if you need to work with mercurial repositories)
18+
* `Pip`_ (version >1.5)
19+
* `Redis`_
20+
* `Elasticsearch`_ (only if you want full support for searching inside the site)
2421

25-
Requires Git version >=2
22+
* Ubuntu users could install this package by following :doc:`/custom_installs/elasticsearch`.
2623

2724
.. note::
2825

29-
If you are having trouble on OS X Mavericks (or possibly other versions of
30-
OS X) with building ``lxml``, you probably might need to use Homebrew_
31-
to ``brew install libxml2``, and invoke the install with::
26+
If you plan to import Python 2 projects to your RTD,
27+
then you'll need to install Python 2 with virtualenv in your system as well.
3228

33-
CFLAGS=-I/usr/local/opt/libxml2/include/libxml2 \
34-
LDFLAGS=-L/usr/local/opt/libxml2/lib \
35-
pip install -r requirements.txt
29+
In order to get all the dependencies successfully installed,
30+
you need these libraries.
3631

37-
.. note::
32+
.. tabs::
33+
34+
.. tab:: Mac OS
3835

39-
Linux users may find they need to install a few additional packages
40-
in order to successfully execute ``pip install -r requirements.txt``.
41-
For example, a clean install of Ubuntu 14.04 LTS will require the
42-
following packages::
36+
If you are having trouble on OS X Mavericks
37+
(or possibly other versions of OS X) with building ``lxml``,
38+
you probably might need to use Homebrew_ to ``brew install libxml2``,
39+
and invoke the install with::
40+
41+
CFLAGS=-I/usr/local/opt/libxml2/include/libxml2 \
42+
LDFLAGS=-L/usr/local/opt/libxml2/lib \
43+
pip install -r requirements.txt
4344

44-
sudo apt-get install build-essential
45-
sudo apt-get install python-dev python-pip python-setuptools
46-
sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
45+
.. tab:: Ubuntu
4746

48-
CentOS/RHEL 7 will require::
47+
Install::
4948

50-
sudo yum install python-devel python-pip libxml2-devel libxslt-devel
49+
sudo apt-get install build-essential
50+
sudo apt-get install python-dev python-pip python-setuptools
51+
sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
5152

52-
Users of other Linux distributions may need to install the equivalent
53-
packages, depending on their system configuration.
53+
If you don't have redis installed yet, you can do it with::
54+
55+
sudo apt-get install redis-server
5456

55-
.. note::
56-
57-
If you want full support for searching inside your Read the Docs
58-
site you will need to install Elasticsearch_.
57+
.. tab:: CentOS/RHEL 7
5958

60-
Ubuntu users could install this package by following :doc:`/custom_installs/elasticsearch`.
61-
62-
.. note::
59+
Install::
6360

64-
Besides the Python specific dependencies, you will also need Redis_.
61+
sudo yum install python-devel python-pip libxml2-devel libxslt-devel
6562

66-
Ubuntu users could install this package as following::
63+
.. tab:: Other OS
6764

68-
sudo apt-get install redis-server
65+
On other operating systems no further dependencies are required,
66+
or you need to find the proper equivalent libraries.
6967

7068

71-
You will need to verify that your pip version is higher than 1.5 you can do this as such::
72-
73-
pip --version
69+
.. _Python 3.6: http://www.python.org/
70+
.. _virtualenv: https://virtualenv.pypa.io/en/stable/
71+
.. _Git: http://git-scm.com/
72+
.. _Mercurial: https://www.mercurial-scm.org/
73+
.. _Pip: https://pip.pypa.io/en/stable/
74+
.. _Homebrew: http://brew.sh/
75+
.. _Elasticsearch: https://www.elastic.co/products/elasticsearch
76+
.. _Redis: https://redis.io/
7477

75-
If this is not the case please update your pip version before continuing::
7678

77-
pip install --upgrade pip
79+
Get and run Read the Docs
80+
-------------------------
7881

79-
Once you have these, create a virtual environment somewhere on your disk, then
80-
activate it::
82+
Clone the repository somewhere on your disk and enter to the repository::
8183

82-
virtualenv rtd
83-
cd rtd
84-
source bin/activate
84+
git clone https://github.com/rtfd/readthedocs.org.git
85+
cd readthedocs.org
8586

86-
Create a folder in here, and clone the repository::
87+
Create a virtual environment and activate it::
8788

88-
mkdir checkouts
89-
cd checkouts
90-
git clone https://github.com/rtfd/readthedocs.org.git
89+
virtualenv venv
90+
source venv/bin/activate
9191

92-
Next, install the dependencies using ``pip`` (included inside of virtualenv_)::
92+
Next, install the dependencies using ``pip``
93+
(make sure you are inside of the virtual environment)::
9394

94-
cd readthedocs.org
9595
pip install -r requirements.txt
9696

97-
This may take a while, so go grab a beverage. When it's done, build your
98-
database::
97+
This may take a while, so go grab a beverage.
98+
When it's done, build the database::
9999

100100
python manage.py migrate
101101

102-
Then please create a superuser account for Django::
102+
Then create a superuser account for Django::
103103

104104
python manage.py createsuperuser
105105

106106
Now let's properly generate the static assets::
107107

108108
python manage.py collectstatic
109109

110-
By now, it is the right time to load in a couple users and a test project::
110+
Now you can optionally load a couple users and test projects::
111111

112112
python manage.py loaddata test_data
113113

@@ -120,35 +120,56 @@ By now, it is the right time to load in a couple users and a test project::
120120
create an ``EmailAddress`` entry for the user, then you can use ``shell_plus`` to
121121
update the object with ``primary=True``, ``verified=True``.
122122

123-
Finally, you're ready to start the webserver::
123+
Finally, you're ready to start the web server::
124124

125125
python manage.py runserver
126126

127-
Visit http://127.0.0.1:8000/ in your browser to see how it looks; you can use
128-
the admin interface via http://127.0.0.1:8000/admin (logging in with the
129-
superuser account you just created).
127+
Visit http://127.0.0.1:8000/ in your browser to see how it looks;
128+
you can use the admin interface via http://127.0.0.1:8000/admin
129+
(logging in with the superuser account you just created).
130130

131-
For builds to properly kick off as expected, it is necessary the port
132-
you're serving on (i.e. ``runserver 0.0.0.0:8080``) match the port defined
133-
in ``PRODUCTION_DOMAIN``. You can utilize ``local_settings.py`` to modify this.
134-
(By default, it's ``localhost:8000``)
131+
For builds to properly work as expected,
132+
it is necessary the port you're serving on
133+
(i.e. ``python manage.py runserver 0.0.0.0:8080``)
134+
match the port defined in ``PRODUCTION_DOMAIN``.
135+
You can use ``readthedocs/settings/local_settings.py`` to modify this
136+
(by default, it's ``localhost:8000``).
135137

136-
While the webserver is running, you can build documentation for the latest version of
137-
a project called 'pip' with the ``update_repos`` command. You can replace 'pip'
138-
with the name of any added project::
138+
While the web server is running,
139+
you can build the documentation for the latest version of any project using the ``update_repos`` command.
140+
For example to update the ``pip`` repo::
139141

140142
python manage.py update_repos pip
141143

144+
.. note::
145+
146+
If you have problems building successfully a project,
147+
probably is because some missing libraries for ``pdf`` and ``epub`` generation.
148+
You can uncheck this on the advanced settings of your project.
149+
142150
What's available
143151
----------------
144152

145153
After registering with the site (or creating yourself a superuser account),
146154
you will be able to log in and view the `dashboard <http://localhost:8000/dashboard/>`_.
147155

148156
Importing your docs
149-
^^^^^^^^^^^^^^^^^^^
157+
~~~~~~~~~~~~~~~~~~~
150158

151159
One of the goals of readthedocs.org is to make it easy for any open source developer to get high quality hosted docs with great visibility!
152160
Simply provide us with the clone URL to your repo, we'll pull your code, extract your docs, and build them!
161+
153162
We make available a post-commit webhook that can be configured to update the docs whenever you commit to your repo.
154-
See :doc:`/intro/import-guide` to learn more.
163+
See our :doc:`/intro/import-guide` page to learn more.
164+
165+
Further steps
166+
-------------
167+
168+
By now you can trigger builds on your local environment,
169+
to encapsulate the build process inside a Docker container,
170+
see :doc:`development/buildenvironments`.
171+
172+
For building this documentation,
173+
see :doc:`docs`.
174+
175+
And for setting up for the front end development, see :doc:`development/standards`.

requirements/pip.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ virtualenv==16.0.0
55
docutils==0.14
66
Sphinx==1.7.8
77
sphinx_rtd_theme==0.4.1
8+
sphinx-tabs==1.1.7
89
# Required to avoid Transifex error with reserved slug
910
# https://github.com/sphinx-doc/sphinx-intl/pull/27
1011
git+https://github.com/agjohnson/sphinx-intl.git@7b5c66bdb30f872b3b1286e371f569c8dcb66de5#egg=sphinx-intl

0 commit comments

Comments
 (0)