Skip to content

Commit 652457b

Browse files
authored
docs(dev): add meta docs on writing docs (#18163)
1 parent 01ab4ac commit 652457b

File tree

3 files changed

+127
-32
lines changed

3 files changed

+127
-32
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#############
2+
Documentation
3+
#############
4+
5+
Developer documentation
6+
=======================
7+
8+
The developer documentation is hosted at `warehouse.pypa.io`_. It's written in
9+
`reStructuredText`_ or `Markdown`_ (via `MyST`_) and built using
10+
`Sphinx`_.
11+
12+
.. _warehouse.pypa.io: https://warehouse.pypa.io
13+
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
14+
.. _Markdown: https://www.markdownguide.org/
15+
.. _MyST: https://myst-parser.readthedocs.io/en/latest/
16+
.. _Sphinx: https://www.sphinx-doc.org/
17+
18+
.. _dev-docs-layout:
19+
20+
Layout
21+
------
22+
23+
The developer documentation is located in the ``docs/dev`` directory.
24+
25+
.. _dev-docs-local-dev:
26+
27+
Local development
28+
-----------------
29+
30+
To run a single local build of the dev docs, you can use the ``dev-docs``
31+
Makefile target:
32+
33+
.. code-block:: console
34+
35+
make dev-docs
36+
37+
That will produce a local build under ``docs/dev/_build/``.
38+
39+
To run a local development server, you can use ``docker compose``:
40+
41+
.. code-block:: console
42+
43+
docker compose up dev-docs
44+
45+
Once running, you can visit a local build of the pages at `localhost:10002`_.
46+
47+
.. _localhost\:10002: http://localhost:10002
48+
49+
User documentation
50+
==================
51+
52+
The user documentation is hosted at `docs.pypi.org`_. It's written in
53+
`Markdown`_ and built using `MkDocs`_.
54+
55+
.. _docs.pypi.org: https://docs.pypi.org
56+
.. _MkDocs: https://www.mkdocs.org/
57+
58+
.. _user-docs-layout:
59+
60+
Layout
61+
------
62+
63+
The user documentation is located in the ``docs/user`` directory.
64+
65+
.. _user-docs-local-dev:
66+
67+
Local development
68+
-----------------
69+
70+
To run a single local build of the user docs, you can use the ``user-docs``
71+
Makefile target:
72+
73+
.. code-block:: console
74+
75+
make user-docs
76+
77+
That will produce a local build under ``docs/user-site/``.
78+
79+
To run a local development server, you can use ``docker compose``:
80+
81+
.. code-block:: console
82+
83+
docker compose up user-docs
84+
85+
Once running, you can visit a local build of the user documentation at `localhost:10000`_.
86+
87+
.. _localhost\:10000: http://localhost:10000
88+
89+
PyPI blog
90+
=========
91+
92+
The PyPI blog is hosted at `blog.pypi.org`_. Like the user documentation,
93+
it's written in `Markdown`_ and built using `MkDocs`_.
94+
95+
.. _blog.pypi.org: https://blog.pypi.org
96+
97+
.. _blog-layout:
98+
99+
Layout
100+
------
101+
102+
The blog is located in the ``docs/blog`` directory.
103+
104+
.. _blog-local-dev:
105+
106+
Local development
107+
-----------------
108+
109+
To run a single local build of the blog, you can use the ``blog``
110+
Makefile target:
111+
112+
.. code-block:: console
113+
114+
make blog
115+
116+
That will produce a local build under ``docs/blog-site/``.
117+
118+
To run a local development server, you can use ``docker compose``:
119+
120+
.. code-block:: console
121+
122+
docker compose up blog
123+
124+
Once running, you can visit a local build of the blog at `localhost:10001`_.
125+
126+
.. _localhost\:10001: http://localhost:10001

docs/dev/development/getting-started.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -747,38 +747,6 @@ formatting and linting. You can reformat with:
747747
748748
make reformat
749749
750-
.. _build-docs:
751-
752-
Building documentation
753-
----------------------
754-
755-
The Warehouse documentation is stored in the :file:`docs/`
756-
directory with three subdirectories: blog, dev and user.
757-
Development docs (in the dev directory) are written in
758-
`reStructured Text`_ and rendered using `Sphinx`_. User docs ``/user``
759-
are written in markdown and rendered using ``mkdocs``. The blog is
760-
also written in markdown.
761-
762-
Use :command:`make` to build the documentation. For example:
763-
764-
.. code-block:: console
765-
766-
make user-docs dev-docs
767-
768-
The HTML index for the user documentation can now be found at
769-
:file:`docs/user-site/index.html`, and the index for the developer
770-
documentation at :file:`docs/dev/_build/html/index.html`.
771-
772-
Building the docs requires Python 3.8. If it is not installed, the
773-
:command:`make` command will give the following error message:
774-
775-
.. code-block:: console
776-
777-
make: python3.8: Command not found
778-
Makefile:53: recipe for target '.state/env/pyvenv.cfg' failed
779-
make: *** [.state/env/pyvenv.cfg] Error 127
780-
781-
782750
.. _building-translations:
783751

784752
Building translations

docs/dev/development/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Get involved or find help using:
3838
cloud
3939
email
4040
token-scanning
41+
documentation
4142

4243
.. _`GitHub`: https://github.com/pypi/warehouse
4344
.. _`"What to put in your bug report"`: https://www.contribution-guide.org/#what-to-put-in-your-bug-report

0 commit comments

Comments
 (0)