Skip to content

Commit 6435054

Browse files
Refactor downloadable docs (#9768)
* Refactor offline formats docs Refs #9746 Closes #9577 * Apply suggestions from code review Co-authored-by: Benjamin Balder Bach <[email protected]> * Update docs/user/downloadable-documentation.rst Co-authored-by: Benjamin Balder Bach <[email protected]> * Lots of updates from feedback * Fix CI * Move to Explanation * Update docs/user/downloadable-documentation.rst Co-authored-by: Benjamin Balder Bach <[email protected]> * Fix lint Co-authored-by: Benjamin Balder Bach <[email protected]>
1 parent 1fed4f9 commit 6435054

File tree

5 files changed

+119
-29
lines changed

5 files changed

+119
-29
lines changed
Loading
+63-28
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,85 @@
1-
Downloadable Documentation
2-
==========================
1+
Understanding Offline Formats
2+
=============================
33

4-
Read the Docs supports building multiple formats for Sphinx-based projects:
4+
This page will provide an overview of a core Read the Docs feature: building docs in multiple formats.
5+
6+
Read the Docs supports the following formats by default:
57

68
* PDF
79
* ePub
810
* Zipped HTML
911

10-
This means that every commit that you push will automatically update your PDFs as well as your HTML.
12+
This means that every commit that you push will automatically update your offline formats as well as your documentation website.
13+
14+
Use cases
15+
---------
16+
17+
This functionality is great for anyone who needs documentation when they aren't connected to the internet.
18+
Users who are about to get on a plane can grab a single file and have the entire documentation during their trip.
19+
Many academic and scientific projects benefit from these additional formats.
20+
21+
PDF versions are also helpful to automatically **create printable versions of your documentation**.
22+
The source of your documentation will be structured to support both online and offline formats.
23+
This means that a documentation project displayed as a website can be downloaded as a PDF,
24+
ready to be printed as a report or a book.
25+
26+
Offline formats also support having the entire documentation in a single file.
27+
Your entire documentation can now be delivered as an email attachment,
28+
uploaded to an eReader,
29+
or accessed and searched locally without online latency.
30+
This makes your documentation project **easy to redistribute or archive**.
1131

12-
This is enabled by the :ref:`config-file/v2:formats` key in our config file.
13-
A simple example is here:
32+
Accessing offline formats
33+
-------------------------
1434

15-
.. code-block:: yaml
35+
You can download offline formats in the :guilabel:`Project dashboard` > :guilabel:`Downloads`:
1636

17-
# Build PDF & ePub
18-
formats:
19-
- epub
20-
- pdf
37+
.. image:: /_static/images/guides/offline-formats.jpg
38+
:width: 75%
39+
40+
When you are browsing a documentation project,
41+
they can also be accessed directly from the :doc:`/flyout-menu`.
42+
43+
Examples
44+
--------
2145

2246
If you want to see an example,
2347
you can download the Read the Docs documentation in the following formats:
2448

25-
* `PDF`_
26-
* `ePub`_
27-
* `Zipped HTML`_
28-
49+
* `PDF`_
50+
* `ePub`_
51+
* `Zipped HTML`_
52+
2953
.. _PDF: https://docs.readthedocs.io/_/downloads/en/latest/pdf/
3054
.. _ePub: https://docs.readthedocs.io/_/downloads/en/latest/epub/
3155
.. _Zipped HTML: https://docs.readthedocs.io/_/downloads/en/latest/htmlzip/
3256

33-
Use cases
34-
---------
57+
Continue learning
58+
-----------------
3559

36-
This functionality is great for anyone who needs documentation when they aren't connected to the internet.
37-
Users who are about to get on a plane can grab a PDF and have the entire doc set ready for their trip.
60+
Downloadable documentation formats are built by your documentation framework.
61+
They are then published by Read the Docs and included in your :term:`Flyout menu`.
62+
Therefore, it's your framework that decides exactly how each output is built and which formats are supported:
63+
64+
Sphinx
65+
All output formats are built mostly lossless from the documentation source,
66+
meaning that your documentation source (reStructuredText or Markdown/MyST) is built from scratch for each output format.
67+
68+
MkDocs and Docsify + more
69+
The common case for most documentation frameworks is that several alternative extensions exist supporting various output formats.
70+
Most of the extensions export the HTML outputs as another format (for instance PDF) through a conversion process.
3871

39-
The other value is having the entire docset in a single file.
40-
You can send a user an email with a single PDF or ePub and they'll have all the docs in one place.
72+
Because Sphinx supports the generation of downloadable formats through an official process,
73+
we are also able to support it officially.
74+
Other alternatives can also work,
75+
provided that you identify which extension you want to use and configure the environment for it to run.
76+
**Other formats aren't natively supported by Read the Docs,
77+
but support is coming soon.**
4178

42-
Deleting downloadable content
43-
-----------------------------
79+
.. seealso::
4480

45-
The entries in the Downloads section of your project dashboard reflect the
46-
formats specified in your config file for each active version.
81+
Other pages in our documentation are relevant to this feature,
82+
and might be a useful next step.
4783

48-
This means that if you wish to remove downloadable content for a given version,
49-
you can do so by removing the matching :ref:`config-file/v2:formats` key from
50-
your config file.
84+
* :doc:`/guides/enable-offline-formats` - Guide to enabling and disabling this feature.
85+
* :ref:`config-file/v2:formats` - Configuration file options for offline formats.

docs/user/guides/authors.rst

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ and :doc:`/intro/getting-started-with-mkdocs`.
1717
Link to external projects (Intersphinx) <intersphinx>
1818
jupyter
1919
Migrate from rST to MyST <migrate-rest-myst>
20+
enable-offline-formats
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
How to enable offline formats
2+
=============================
3+
4+
This guide provides **step-by-step instructions to enabling offline formats** of your documentation.
5+
6+
They are automatically built by Read the Docs during our default build process,
7+
as long as you have the configuration enabled to turn this on.
8+
9+
Enabling offline formats
10+
------------------------
11+
12+
Offline formats are enabled by the :ref:`config-file/v2:formats` key in our config file.
13+
A simple example is here:
14+
15+
.. code-block:: yaml
16+
17+
# Build PDF & ePub
18+
formats:
19+
- epub
20+
- pdf
21+
22+
Verifying offline formats
23+
-------------------------
24+
25+
You can verify that offline formats are building in your :guilabel:`Project dashboard` > :guilabel:`Downloads`:
26+
27+
.. image:: /_static/images/guides/offline-formats.jpg
28+
:width: 75%
29+
30+
Deleting offline formats
31+
------------------------
32+
33+
The entries in the Downloads section of your project dashboard reflect the
34+
formats specified in your config file for each active version.
35+
36+
This means that if you wish to remove downloadable content for a given version,
37+
you can do so by removing the matching :ref:`config-file/v2:formats` key from
38+
your config file.
39+
40+
41+
Continue learning
42+
-----------------
43+
44+
.. seealso::
45+
46+
Other pages in our documentation are relevant to this feature,
47+
and might be a useful next step.
48+
49+
50+
* :doc:`/downloadable-documentation` - Overview of this feature.
51+
* :ref:`config-file/v2:formats` - Configuration file options for offline formats.
52+
53+
..
54+
TODO: Link to our build customization page on this once we write it.

docs/user/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ to help you create fantastic documentation for your project.
7777
:caption: Explanation
7878

7979
/build-notifications
80+
/downloadable-documentation
8081

8182

8283
.. toctree::
@@ -145,7 +146,6 @@ and some of the core features of Read the Docs.
145146
/integrations
146147
/custom-domains
147148
/versions
148-
/downloadable-documentation
149149
/hosting
150150
/server-side-search/index
151151
/analytics

0 commit comments

Comments
 (0)