Skip to content

Commit 727da6e

Browse files
Clean up Addons & Flyout menu docs (#11706)
* Clean up Addons & Flyout menu docs This cleans up the copy here, adds the DocDiff page, and clarifies as bit more the Custom event language. * Update docs/user/flyout-menu.rst Co-authored-by: Manuel Kaufmann <[email protected]> --------- Co-authored-by: Manuel Kaufmann <[email protected]>
1 parent ad74e78 commit 727da6e

File tree

8 files changed

+103
-54
lines changed

8 files changed

+103
-54
lines changed
-32.8 KB
Binary file not shown.

docs/user/addons.rst

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,36 @@
11
Read the Docs Addons
22
====================
33

4-
**Read the Docs Addons** is a group of features for documentation readers and maintainers that you can add to any documentation set hosted on Read the Docs:
4+
**Read the Docs Addons** is a group of features for documentation readers and maintainers that you can add to any documentation set hosted on Read the Docs.
5+
They are used in the rendered documentation,
6+
and can be accessed via hotkeys or on screen UI elements.
57

68
:doc:`DocDiff </pull-requests>`
7-
highlight changed output from pull requests
9+
Highlight changed output from pull requests
810

911
:doc:`Pull request notification </pull-requests>`
10-
notify readers that they are reading docs from a pull request
12+
Notify readers that they are reading docs from a pull request
1113

1214
:doc:`Flyout </flyout-menu>`
13-
easily switch between versions and translations
15+
Easily switch between versions and translations
1416

1517
:doc:`Non-stable notification </versions>`
16-
notify readers that they are reading docs from a non stable release
18+
Notify readers that they are reading docs from a non stable release
1719

1820
:doc:`Latest version notification </versions>`
19-
notify readers that they are reading docs from a development version
21+
Notify readers that they are reading docs from a development version
2022

2123
:doc:`Search as you type </server-side-search/index>`
22-
get search results faster
24+
Get search results faster
2325

24-
Enabling Read the Docs Addons
25-
-----------------------------
26-
27-
All projects using ``mkdocs`` :ref:`mkdocs <config-file/v2:mkdocs>` or the ``build.command`` :ref:`build command <config-file/v2:build.commands>` are already using the Addons, other projects can enable them by following these steps:
28-
29-
#. Go to the new dashboard:
30-
31-
* `Community <https://app.readthedocs.org>`_
32-
* `Business <https://app.readthedocs.com>`_
33-
34-
#. Click on a project name.
35-
#. Go to :guilabel:`Settings`, then in the left bar, go to :guilabel:`Addons`.
36-
#. Check :guilabel:`Enable Addons`, and then configure each Addon individually.
26+
:doc:`DocDiff </pull-requests>`
27+
Highlight changed output from pull requests
3728

38-
.. note::
29+
:doc:`Traffic analytics </traffic-analytics>`
30+
See what pages your users are reading
3931

40-
Read the Docs Addons will be enabled by default for all Read the Docs projects on October 7th.
41-
Read the full announcement in our `blog post <https://about.readthedocs.com/blog/2024/07/addons-by-default/>`_.
32+
:doc:`Search analytics </search-analytics>`
33+
Understand what your users are searching for
4234

4335
Configuring Read the Docs Addons
4436
--------------------------------
@@ -51,5 +43,19 @@ Individual configuration options for each addon are available in :guilabel:`Sett
5143
* `Business <https://app.readthedocs.com>`_
5244

5345
#. Click on a project name.
54-
#. Go to :guilabel:`Settings`, then in the left bar, go to :guilabel:`Addons`.
46+
#. Go to :guilabel:`Settings`
47+
#. In the left bar, go to :guilabel:`Addons`.
5548
#. Configure each Addon individually.
49+
50+
Addons data and customization
51+
-----------------------------
52+
53+
If you'd like to do a custom integration with the data used to render Addons,
54+
you can learn more about this in our :ref:`flyout-menu:custom event integration` docs.
55+
56+
Diving deeper
57+
-------------
58+
59+
You can read more about all of the Addons functionality by diving into each Addon above.
60+
If you are a developer and would like to integrate with our Addons or use our existing data,
61+
you can :doc:`reach out </support>` to us and we would love to work with you.

docs/user/doc-diff.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
DocDiff
2+
=======
3+
4+
DocDiff allows you to see a visual :term:`diff` on a documentation page,
5+
showing what has changed between the ``latest`` version and the active :doc:`pull request </pull-requests>`.
6+
7+
DocDiff allows you to quickly review changes visually,
8+
and focus your review on what has changed in the current page.
9+
10+
.. figure:: /img/addons-docdiff.gif
11+
:width: 80%
12+
13+
Example of DocDiff
14+
15+
Enabling DocDiff
16+
----------------
17+
18+
DocDiff is only enabled on pull request builds,
19+
and can be toggled on and off with the ``d`` hotkey.
20+
21+
Troubleshooting DocDiff
22+
-----------------------
23+
24+
DocDiff only works if there are changes on the page,
25+
so ensure you are on a page that has changed in the current pull request.
26+
27+
There are also some known issues that currently don't display properly:
28+
29+
* **Tables** are shown to have changes when they may not have changed. This is due to do subtly in how HTML tables are rendered, and will be fixed in a future version.

docs/user/flyout-menu.rst

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,27 @@
33
Flyout menu
44
===========
55

6-
When you are using a Read the Docs site,
7-
you will likely notice that we embed a menu on all the documentation pages we serve.
8-
This is a way to expose the functionality of Read the Docs on the page,
6+
When you use a Read the Docs site,
7+
there is a flyout menu embedded on all the documentation pages.
8+
The flyout menu is a way to expose the functionality of Read the Docs on the page,
99
without having to have the documentation theme integrate it directly.
1010

11-
There are two versions of the flyout menu:
12-
13-
- :ref:`flyout-menu:Addons flyout menu`
14-
- :ref:`flyout-menu:Original flyout menu`
11+
.. tip::
12+
The flyout menu is a default implementation that works for every site.
13+
You can access the full data used to construct the flyout,
14+
and use that to integrate the data directly into your documentation theme for a nicer user experience.
15+
See the :ref:`Custom event integration` for more information.
1516

1617
Addons flyout menu
1718
------------------
1819

19-
The updated :doc:`addons` flyout menu lists available documentation versions and translations, as well as useful links,
20-
offline formats, and a search bar.
20+
The :doc:`addons` flyout provides a place for a number of Read the Docs features:
21+
22+
* A :doc:`version switcher </versions>` that shows users all of the active versions they have access to.
23+
* A :doc:`translation switcher </internationalization>` that shows all the documentation languages provided.
24+
* A list of :doc:`offline formats </downloadable-documentation>` for the current version, including HTML & PDF downloads.
25+
* Links to the Read the Docs dashboard for the project.
26+
* A search bar that gives users access to the :doc:`/server-side-search/index` of the current version.
2127

2228
.. figure:: /_static/images/flyout-addons.png
2329
:align: center
@@ -27,31 +33,34 @@ offline formats, and a search bar.
2733
Customizing the flyout menu
2834
~~~~~~~~~~~~~~~~~~~~~~~~~~~
2935

30-
In your dashboard, you can configure flyout menu options in :guilabel:`Settings`, under :guilabel:`Addons`.
36+
In your dashboard, you can configure flyout menu options in :guilabel:`Settings > Addons > Flyout Menu`.
3137

32-
Sort your versions :guilabel:`Alphabetically`, by :guilabel:`SemVer`, by :guilabel:`Python Packaging`,
33-
by :guilabel:`CalVer`, or define your own pattern.
38+
Version sorting
39+
^^^^^^^^^^^^^^^
3440

35-
Choose whether to list stable versions first or not.
41+
The primary customization currently is the ability to sort versions.
42+
You can sort by:
3643

37-
Customizing the look of the addons flyout menu
38-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
.. TODO: Define how these work better..
3945
40-
The addons flyout exposes all the required data to build the flyout menu via a JavaScript ``CustomEvent``.
41-
Take a look at an example of this approach at https://github.com/readthedocs/sphinx_rtd_theme/pull/1526.
46+
* :guilabel:`SemVer (Read the Docs)` - **Default**. Read the Docs custom implementation of semver.org.
47+
* :guilabel:`Python Packaging` - Sort by Python packaging sorting.
48+
* :guilabel:`CalVer` - Sort by calendar date.
49+
* :guilabel:`Alphabetically` - Only useful if you aren't using numeric versions.
50+
* Or you can define a custom pattern
4251

43-
Original flyout menu
44-
--------------------
52+
You can also choose whether ``latest`` and ``stable`` should be sorted first,
53+
as those are special versions that Read the Docs uses.
4554

46-
The flyout menu provides access to the following bits of Read the Docs functionality:
55+
Custom event integration
56+
------------------------
4757

48-
* A :doc:`version switcher </versions>` that shows users all of the active, unhidden versions they have access to.
49-
* :doc:`Offline formats </downloadable-documentation>` for the current version, including HTML & PDF downloads that are enabled by the project.
50-
* Links to the Read the Docs dashboard for the project.
51-
* Links to your :doc:`Git provider </reference/git-integration>` that allow the user to quickly find the exact file that the documentation was rendered from.
52-
* A search bar that gives users access to our :doc:`/server-side-search/index` of the current version.
53-
54-
.. figure:: /_static/images/flyout-open.png
55-
:align: center
58+
Read the Docs Addons exposes all the data used to construct the flyout menu via a JavaScript ``CustomEvent``.
59+
If you'd like to integrate the data,
60+
you can use the :ref:`mkdocs:Integrate the Read the Docs version menu into your site navigation` example as a starting point.
5661

57-
The opened flyout
62+
.. warning::
63+
We have not formally documented the API response returned from the Addons API,
64+
but you can view the JSON data returned there as a starting point.
65+
Once we document it,
66+
we will commit to supporting that version of the API response going forward.

docs/user/glossary.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ so that you have a reference for how we're using them.
3131
Projects have a *default version*, usually the latest stable version of a project.
3232
The *default version* is the URL that is redirected to when a users loads the `/` URL for your project.
3333

34+
diff
35+
A way to see the changes between two pieces of text,
36+
which shows the added and removed content with a green and red color respectively.
37+
3438
discoverability
3539
A documentation page is said to be *discoverable* when a user that needs it can find it through various methods:
3640
Navigation, search, and links from other pages are the most typical ways of making content *discoverable*.

docs/user/img/addons-docdiff.gif

206 KB
Loading

docs/user/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Read the Docs: documentation simplified
5959
:caption: Reading documentation
6060

6161
/downloadable-documentation
62+
/doc-diff
6263
/guides/embedding-content
6364
/server-side-search/index
6465
/server-side-search/syntax

docs/user/pull-requests.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Pull request notifications
2828
A pull request notifications is shown at the top of preview pages,
2929
which let readers know they aren't viewing an active version of the project.
3030

31-
DocDiff
31+
:doc:`DocDiff </doc-diff>``
3232
DocDiff shows proposed changes by visually highlighting the differences between the current pull request and the latest version of the project's documentation.
3333

3434
Press ``d`` to toggle between DocDiff and normal pull request preview.

0 commit comments

Comments
 (0)