Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal viable docs for addons #11444

Merged
merged 10 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/user/_static/images/addons-analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
54 changes: 40 additions & 14 deletions docs/user/addons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,51 @@ Read the Docs Addons

**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:

- :doc:`Traffic analytics </analytics>`
- :doc:`DocDiff </pull-requests>`
- :doc:`Pull request notification </pull-requests>`
- :doc:`Flyout </flyout-menu>`
- :doc:`Non-stable notification </notifications>`
- :doc:`Latest version notification </notifications>`
- :doc:`Search as you type </server-side-search/index>`
- :ref:`Sponsorship <sponsors:sponsorship information>`
:doc:`Traffic analytics </analytics>`
explore pageviews for your docs

:doc:`DocDiff </pull-requests>`
highlight changed output from pull requests

:doc:`Pull request notification </pull-requests>`
notify readers that they are reading docs from a pull request

:doc:`Flyout </flyout-menu>`
easily switch between versions and translations

:doc:`Non-stable notification </notifications>`
notify readers that they are reading docs from a non stable release

:doc:`Latest version notification </notifications>`
notify readers that they are reading docs from an older version
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
plaindocs marked this conversation as resolved.
Show resolved Hide resolved

:doc:`Search as you type </server-side-search/index>`
get search results faster

Enabling Read the Docs Addons
-----------------------------

All projects using 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:
All projects using 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:

plaindocs marked this conversation as resolved.
Show resolved Hide resolved
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
#. Go to the new dashboard:

* `Community <https://app.readthedocs.org>`_
* `Business <https://app.readthedocs.com>`_

#. Click on a project name.
#. Go to :guilabel:`Settings`, then in the left bar, go to :guilabel:`Addons (Beta)`.
#. Check :guilabel:`Enable Addons`, and then configure each Addon individually.

Configuring Read the Docs Addons
--------------------------------

Individual configuration options for each addon are available in :guilabel:`Settings`.

#. Go to the new beta dashboard:
#. Go to the new dashboard:

* `Community <https://beta.readthedocs.org>`_
* `Business <https://beta.readthedocs.com>`_
* `Community <https://app.readthedocs.org>`_
* `Business <https://app.readthedocs.com>`_

#. Click on a project name.
#. Go to **Settings**, then in the left bar, go to **Addons (Beta)**.
#. Check **Enable Addons**, or enable Addons individually.
#. Go to :guilabel:`Settings`, then in the left bar, go to :guilabel:`Addons (Beta)`.
humitos marked this conversation as resolved.
Show resolved Hide resolved
#. Configure each Addon individually.
11 changes: 0 additions & 11 deletions docs/user/advertising/advertising-details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,6 @@ The developers at Read the Docs understand that different users have different p
and we try to respect the different viewpoints as much as possible while also accomplishing
our own goals.

We have taken steps to address some of the privacy concerns surrounding GA.
These steps apply both to analytics collected by Read the Docs and when
:ref:`authors enable analytics on their docs <analytics:Enabling Google Analytics on your Project>`.

* Users can opt-out of analytics by using the Do Not Track feature of their browser.
* Read the Docs instructs Google to anonymize IP addresses sent to them.
* The cookie set by GA is a session (non-persistent) cookie rather than the default 2 years.
* Project maintainers can completely disable analytics on their own projects.
Follow the steps in :ref:`analytics:Disabling Google Analytics on your project`.
plaindocs marked this conversation as resolved.
Show resolved Hide resolved


Why we use analytics
~~~~~~~~~~~~~~~~~~~~

Expand Down
45 changes: 2 additions & 43 deletions docs/user/analytics.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
How to use traffic analytics
============================

This guide covers traffic analytics for your documentation project, either built-in or provided through Read the Docs Addons. You can also learn how to enable or disable Google Analytics.
This guide covers traffic analytics for your documentation project, either built-in or provided through Read the Docs Addons.
plaindocs marked this conversation as resolved.
Show resolved Hide resolved

Traffic Analytics lets you see *which* documents your users are reading.
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
This allows you to understand how your documentation is being used,
Expand All @@ -11,7 +11,7 @@ To see a list of the top pages from the last month,
go to the :guilabel:`Admin` tab of your project,
and then click on :guilabel:`Traffic Analytics`.

.. figure:: /_static/images/traffic-analytics-demo.png
.. figure:: /_static/images/addons-analytics.png
:width: 50%
:align: center
:alt: Traffic analytics demo
Expand All @@ -27,44 +27,3 @@ You can also access analytics data from :doc:`search results </guides/search-ana
* On the Community site, the last 90 days are stored.
* On the Commercial one, it goes from 30 to infinite storage
(check out `the pricing page <https://readthedocs.com/pricing/>`_).

Enabling Google Analytics on your project
-----------------------------------------

Read the Docs has native support for Google Analytics.
You can enable it by:

#. Going to :guilabel:`Admin` > :guilabel:`Settings` in your project.
#. Fill in the **Analytics code** heading with your Google Tracking ID (example `UA-123456674-1`)

.. figure:: /_static/images/google-analytics-options.png
:width: 80%
:align: center
:alt: Options to manage Google Analytics

Options to manage Google Analytics

Once your documentation rebuilds it will include your Analytics tracking code and start sending data.
Google Analytics usually takes 60 minutes,
and sometimes can take up to a day before it starts reporting data.

.. note::

Read the Docs takes some extra precautions with analytics to protect user privacy.
As a result, users with Do Not Track enabled will not be counted
for the purpose of analytics.

For more details, see the
:ref:`Do Not Track section <privacy-policy:Do Not Track>`
of our privacy policy.

Disabling Google Analytics on your project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Google Analytics can be completely disabled on your own projects.
To disable Google Analytics:

* Going to :guilabel:`Admin` > :guilabel:`Settings` in your project.
* Check the box **Disable Analytics**.

Your documentation will need to be rebuilt for this change to take effect.
130 changes: 11 additions & 119 deletions docs/user/flyout-menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ offline formats, and a search bar.
.. figure:: /_static/images/flyout-addons.png
:align: center

The opened flyout
The opened flyout menu

Customizing the flyout menu
~~~~~~~~~~~~~~~~~~~~~~~~~~~

In your dashboard, you can configure flyout menu options in :guilabel:`Settings`, under :guilabel:`Addons (Beta)`.

Sort your versions :guilabel:`Alphabetically`, by :guilabel:`SemVer`, by :guilabel:`Python Packaging`,
by :guilabel:`CalVer`, or define your own pattern.

Choose whether to list stable versions first or not.

Customizing the look of the addons flyout menu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -45,121 +55,3 @@ The flyout menu provides access to the following bits of Read the Docs functiona
:align: center

The opened flyout

Information for theme authors
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. warning::

The original flyout menu could be themed by injecting code with JavaScript.
This approach is currently deprecated* in favor of the new Read the Docs Addons approach.

People who are making custom documentation themes often want to specify where the flyout is injected,
and also what it looks like.
We support both of these use cases for themes.

[Deprecated] Defining where the flyout menu is injected
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The flyout menu injection looks for a specific selector (``#readthedocs-embed-flyout``),
in order to inject the flyout.
You can add ``<div id="readthedocs-embed-flyout">`` in your theme,
and our JavaScript code will inject the flyout there.
All other themes except for the ``sphinx_rtd_theme`` have the flyout appended to the ``<body>``.

[Deprecated] Styling the flyout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

HTML themes can style the flyout to make it match the overall style of the HTML.
By default the flyout has it's `own CSS file <https://github.com/readthedocs/sphinx_rtd_theme/blob/master/src/sass/_theme_badge.sass>`_,
which you can look at to see the basic CSS class names.

The example HTML that the flyout uses is included here,
so that you can style it in your HTML theme:

.. code:: html

<div class="injected">
<div class="rst-versions rst-badge shift-up" data-toggle="rst-versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book">&nbsp;</span>
v: 2.1.x
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<!-- "Languages" section (``dl`` tag) is not included if the project does not have translations -->
<dl>
<dt>Languages</dt>
<dd class="rtd-current-item">
<a href="https://flask.palletsproject.com/en/2.1.x">en</a>
</dd>
<dd>
<a href="https://flask.palletsproject.com/es/2.1.x">es</a>
</dd>
</dl>

<!-- "Versions" section (``dl`` tag) is not included if the project is single version -->
<dl>
<dt>Versions</dt>
<dd>
<a href="https://flask.palletsprojects.com/en/latest/">latest</a>
</dd>
<dd class="rtd-current-item">
<a href="https://flask.palletsprojects.com/en/2.1.x/">2.1.x</a>
</dd>
</dl>

<!-- "Downloads" section (``dl`` tag) is not included if the project does not have artifacts to download -->
<dl>
<dt>Downloads</dt>
<dd>
<a href="//flask.palletsprojects.com/_/downloads/en/2.1.x/pdf/">PDF</a>
</dd>
<dd>
<a href="//flask.palletsprojects.com/_/downloads/en/2.1.x/htmlzip/">HTML</a>
</dd>
</dl>

<dl>
<dt>On Read the Docs</dt>
<dd>
<a href="//readthedocs.org/projects/flask/">Project Home</a>
</dd>
<dd>
<a href="//readthedocs.org/projects/flask/builds/">Builds</a>
</dd>
<dd>
<a href="//readthedocs.org/projects/flask/downloads/">Downloads</a>
</dd>
</dl>

<dl>
<dt>On GitHub</dt>
<dd>
<a href="https://github.com/pallets/flask/blob/2.1.x/docs/index.rst">View</a>
</dd>
<dd>
<a href="https://github.com/pallets/flask/edit/2.1.x/docs/index.rst">Edit</a>
</dd>
</dl>

<dl>
<dt>Search</dt>
<dd>
<div style="padding: 6px;">
<form id="flyout-search-form" class="wy-form" target="_blank" action="//readthedocs.org/projects/flask/search/" method="get">
<input type="text" name="q" aria-label="Search docs" placeholder="Search docs">
</form>
</div>
</dd>
</dl>

<hr>
<small>
<span>Hosted by <a href="https://readthedocs.org">Read the Docs</a></span>
<span> &middot; </span>
<a href="https://docs.readthedocs.io/page/privacy-policy.html">Privacy Policy</a>
</small>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion docs/user/guides/technical-docs-seo-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Some of the most valuable feedback these provide include:
Analytics tools
~~~~~~~~~~~~~~~

A tool like :ref:`Google Analytics <analytics:Enabling Google Analytics on your Project>`
A tool like Google Analytics
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
can give you feedback about the search terms people use to find your docs,
your most popular pages, and lots of other useful data.

Expand Down
2 changes: 2 additions & 0 deletions docs/user/notifications.rst
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Non-stable notification
Latest version notification
A notification shown on the latest version tells readers they are reading the latest/development version of the documentation that may include features not yet deployed.

Each of these notifcations can be configured in :ref:`addons:Configuring Read the Docs Addons`

16 changes: 3 additions & 13 deletions docs/user/server-side-search/index.rst
plaindocs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ this is powered by Elasticsearch_.
You can search all projects at https://readthedocs.org/search/,
or search only on your project from the :guilabel:`Search` tab of your project.
plaindocs marked this conversation as resolved.
Show resolved Hide resolved

If you're using :doc:`/addons`, you also get :ref:`server-side-search/index:search as you type` built in,
either from the :doc:`/flyout-menu` or from the :guilabel:`Search` tab of your project

.. seealso::

:doc:`/server-side-search/syntax`
Expand Down Expand Up @@ -83,14 +80,7 @@ Analytics
Search as you type
------------------

`readthedocs-sphinx-search`_ is a Sphinx extension that integrates your
documentation more closely with the search implementation of Read the Docs.
It adds a clean and minimal full-page search UI that supports a **search as you type** feature.

To try this feature,
you can press :guilabel:`/` (forward slash) and start typing or just visit these URLs:

- https://docs.readthedocs.io/?rtd_search=contributing
- https://docs.readthedocs.io/?rtd_search=api/v3/projects/
Search as-you-type allows users to quickly find exactly what they are looking for while typing.
It also saves recent searches, for future reference.

.. _readthedocs-sphinx-search: https://readthedocs-sphinx-search.readthedocs.io/
Try it by pressing :guilabel:`/` (forward slash) and typing.
9 changes: 0 additions & 9 deletions docs/user/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,6 @@ You can also download this data in :abbr:`CSV (Comma-Separated Values)` format
To do that, scroll to the bottom of the page
and click the :guilabel:`Download all data` button.

.. note::

You can get more detailed traffic data by
:ref:`enabling Google Analytics <analytics:Enabling Google Analytics on your Project>`.
Notice though that Read the Docs takes extra measures to :ref:`respect user
privacy <advertising/advertising-details:analytics>`
when they visit projects that have Google Analytics enabled,
which might reduce the number of visits counted.

Understanding search analytics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down