Skip to content

Docs: split user and dev docs #8751

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- run: tox -e lint
- run: tox -e docs-lint
- run: tox -e docs
- run: tox -e docs-dev
- run: tox -e eslint

workflows:
Expand Down
5 changes: 0 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ build:
python: "3.8"

search:
ignore:
# Internal documentation
- development/design/*
- search.html
- 404.html
ranking:
# Deprecated content
api/v1.html: -1
Expand Down
42 changes: 37 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
"""
Shared Sphinx configuration.

Each docset corresponds to a directory containing several rst/md files,
sharing this same conf.py file. To build a docset an environment variable
is used, ``RTD_DOCSET``, values given in the settings are relative to this
conf.py file, if you want to give a different value for a docset, use the
``docsets`` dictionary, or if you want to extend the current value,
use f'{docset}/setting' as value on the setting, for example::

html_static_path = ['_static', f'{docset}/_static']
"""

import os
import sys
from configparser import RawConfigParser
Expand All @@ -14,6 +27,24 @@
django.setup()


# Set here the variables you want for each docset.
docsets = {
'user': {
'project': 'Read the Docs user documentation',
},
'dev': {
'project': 'Read the Docs developer documentation',
},
}
docset = os.environ.get('RTD_DOCSET', 'user')
if docset not in docsets:
print(f'Invalid RTD_DOCSET value: "{docset}"')
exit(1)

for k, v in docsets[docset].items():
locals()[k] = v


def get_version():
"""Return package version from setup.cfg."""
config = RawConfigParser()
Expand Down Expand Up @@ -41,7 +72,6 @@ def get_version():
templates_path = ['_templates']

master_doc = 'index'
project = 'Read the Docs'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
timezone.now().year
)
Expand All @@ -66,6 +96,8 @@ def get_version():
'jupyterbook': ('https://jupyterbook.org/', None),
'myst-parser': ('https://myst-parser.readthedocs.io/en/v0.15.1/', None),
'rst-to-myst': ('https://rst-to-myst.readthedocs.io/en/stable/', None),
'rtd': ('https://docs.readthedocs.io/en/stable/', None),
'rtd-dev': ('https://dev.readthedocs.io/en/stable/', None),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally I'm testing this with

Suggested change
'rtd-dev': ('https://dev.readthedocs.io/en/stable/', None),
'rtd-dev': ('https://dev.readthedocs.io/en/separate-dev-docs/', None),

}
myst_enable_extensions = [
"deflist",
Expand Down Expand Up @@ -95,13 +127,13 @@ def get_version():
language = 'en'

locale_dirs = [
'locale/',
f'{docset}/locale/',
]
gettext_compact = False

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_css_files = ['css/custom.css']
html_static_path = ['_static', f'{docset}/_static']
html_css_files = ['css/custom.css', 'css/sphinx_prompt_css.css']
html_js_files = ['js/expand_tabs.js']
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_logo = 'img/logo.svg'
Expand Down Expand Up @@ -162,4 +194,4 @@ def get_version():


def setup(app):
app.add_css_file('css/sphinx_prompt_css.css')
app.srcdir += '/' + docset
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions docs/contribute.rst → docs/dev/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Contributing to development

If you want to deep dive and help out with development on Read the Docs, then
first get the project installed locally according to the
:doc:`installation guide </development/install>`. After that is done we
:doc:`installation guide </install>`. After that is done we
suggest you have a look at tickets in our issue tracker that are labelled `Good
First Issue`_. These are meant to be a great way to get a smooth start and
won't put you in front of the most complex parts of the system.
Expand All @@ -38,7 +38,8 @@ They are simply things that are explained.
If you still didn't find something to work on, search for the `Sprintable`_ label.
Those tickets are meant to be standalone and can be worked on ad-hoc.

You can read all of our :doc:`/development/index` to understand more the development of Read the Docs. When contributing code, then please follow the standard Contribution Guidelines set forth at `contribution-guide.org`_.
You can read all of our :doc:`/index` to understand more the development of Read the Docs.
When contributing code, then please follow the standard Contribution Guidelines set forth at `contribution-guide.org`_.

.. _Feature: https://github.com/readthedocs/readthedocs.org/issues?direction=desc&labels=Feature&page=1&sort=updated&state=open
.. _Improvement: https://github.com/readthedocs/readthedocs.org/issues?q=is%3Aopen+is%3Aissue+label%3AImprovement
Expand All @@ -54,7 +55,7 @@ Contributing to documentation
Documentation for Read the Docs itself is hosted by Read the Docs at https://docs.readthedocs.io (likely the website you are currently reading).

There are guidelines around writing and formatting documentation for the project.
For full details, including how to build it, see :doc:`/development/docs`.
For full details, including how to build it, see :doc:`/docs`.


Triaging tickets
Expand Down Expand Up @@ -196,7 +197,7 @@ few more at hand to further categorize issues.
handled during a sprint. They are very focused and encapsulated.

For a full list of available labels and their meanings, see
:doc:`/development/issue-labels`.
:doc:`/issue-labels`.

Helpful links for triaging
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/development/design.rst → docs/dev/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ time and design skills to Read the Docs? That's
a few features available to ease the process of
working with Read the Doc's CSS and static assets.

To start, you should follow the :doc:`/development/install` instructions
To start, you should follow the :doc:`/install` instructions
to get a working copy of the Read the Docs repository locally.

.. TODO: update to match the new ext-theme
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ and remove some quirkiness that makes it hard to maintain and difficult to use.
Current implementation
----------------------

The current implementation of the API is partially documented in :doc:`/guides/embedding-content`.
The current implementation of the API is partially documented in :doc:`rtd:guides/embedding-content`.
It has some known problems:

* There are different ways of querying the API: ``?url=`` (generic) and ``?doc=`` (relies on Sphinx's specific concept)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ This is a GSoC'19 project.

The final result may look something like this:

.. figure:: ../../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
.. figure:: /_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
:align: center
:target: ../../_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif
:target: /_static/images/design-docs/in-doc-search-ui/in-doc-search-ui-demo.gif

Short demo

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Note that this dictionary is injected under the main key `readthedocs`:
so it's your responsibility to use this context in a proper way.

In case you want *fresh data* at the moment of reading your documentation,
you should consider using the :doc:`Read the Docs Public API </api/index>` via Javascript.
you should consider using the :doc:`Read the Docs Public API <rtd:api/index>` via Javascript.


Using Read the Docs context in your theme
Expand Down
File renamed without changes.
12 changes: 11 additions & 1 deletion docs/development/docs.rst → docs/dev/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Building and Contributing to Documentation

As one might expect,
the documentation for Read the Docs is built using Sphinx and hosted on Read the Docs.
The docs are kept in the ``docs/`` directory at the top of the source tree.
The docs are kept in the ``docs/`` directory at the top of the source tree,
and are divided into developer and user-facing documentation.

Contributing through the Github UI
----------------------------------
Expand Down Expand Up @@ -51,11 +52,20 @@ you may want to verify those changes locally before pushing upstream.

#. build the documents

To build the user-facing documentation:

.. code-block:: console

(.venv) $ cd docs
(.venv) $ make livehtml

To build the developer documentation:

.. code-block:: console

(.venv) $ cd docs
(.venv) $ RTD_DOCSET=dev make livehtml

#. the documents will be available at http://127.0.0.1:4444/ and will rebuild each time you edit and save a file.

Guidelines
Expand Down
2 changes: 1 addition & 1 deletion docs/development/front-end.rst → docs/dev/front-end.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ in.
Getting Started
---------------

You will need to follow our :doc:`guide to install a development Read the Docs instance </development/install>` first.
You will need to follow our :doc:`guide to install a development Read the Docs instance </install>` first.

The sources for our bundles are found in the per-application path
``static-src``, which has the same directory structure as ``static``. Files in
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
30 changes: 30 additions & 0 deletions docs/dev/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Read the Docs developer documentation
=====================================

Documentation for running your own local version of Read the Docs for development,
or taking the open source Read the Docs codebase for your own custom installation.

.. toctree::
:caption: General
:maxdepth: 1

contribute
code-of-conduct
issue-labels
roadmap
design/index

.. toctree::
:caption: Development
:maxdepth: 1

install
design
docs
front-end
i18n
search
search-integration
settings
tests
architecture
8 changes: 4 additions & 4 deletions docs/development/install.rst → docs/dev/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,21 @@ debugging currently.
Configuring connected accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These are optional steps to setup the :doc:`connected accounts </connected-accounts>`
These are optional steps to setup the :doc:`connected accounts <rtd:connected-accounts>`
(GitHub, GitLab, and BitBucket) in your development environment.
This will allow you to login to your local development instance
using your GitHub, Bitbucket, or GitLab credentials
and this makes the process of importing repositories easier.

However, because these services will not be able to connect back to your local development instance,
:doc:`incoming webhooks </integrations>` will not function correctly.
:doc:`incoming webhooks <rtd:integrations>` will not function correctly.
For some services, the webhooks will fail to be added when the repository is imported.
For others, the webhook will simply fail to connect when there are new commits to the repository.

.. figure:: ../_static/images/development/bitbucket-oauth-setup.png
.. figure:: /_static/images/development/bitbucket-oauth-setup.png
:align: center
:figwidth: 80%
:target: ../_static/images/development/bitbucket-oauth-setup.png
:target: /_static/images/development/bitbucket-oauth-setup.png

Configuring an OAuth consumer for local development on Bitbucket

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Server Side Search Integration
==============================

Read the Docs provides :doc:`server side search (SSS) </server-side-search>`
Read the Docs provides :doc:`server side search (SSS) <rtd:server-side-search>`
in replace of the default search engine of your site.
To accomplish this, Read the Docs parses the content directly from your HTML pages [*]_.

Expand Down Expand Up @@ -309,7 +309,7 @@ Supporting more themes and static site generators
-------------------------------------------------

Currently, Read the Docs supports building documentation from
:doc:`Sphinx </intro/getting-started-with-sphinx>` and :doc:`MkDocs </intro/getting-started-with-mkdocs>`.
:doc:`Sphinx <rtd:intro/getting-started-with-sphinx>` and :doc:`MkDocs <rtd:intro/getting-started-with-mkdocs>`.
All themes that follow these conventions should work as expected.
If you think other generators or other conventions should be supported,
or content that should be ignored or have an especial treatment,
Expand Down
2 changes: 1 addition & 1 deletion docs/development/search.rst → docs/dev/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Currently we are using `Elasticsearch 6.3`_.
Local Development Configuration
-------------------------------

Elasticsearch is installed and run as part of the :doc:`development installation guide </development/install>`.
Elasticsearch is installed and run as part of the :doc:`development installation guide </install>`.

Indexing into Elasticsearch
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions docs/development/index.rst

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/about.rst → docs/user/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We have built something that we expect to last a long time,
and we are able to make decisions based only on the best interest of our community and customers.

All of the source code for Read the Docs is open source.
You are welcome to :doc:`contribute </contribute>` the features you want or run your own instance.
You are welcome to :doc:`contribute <rtd-dev:contribute>` the features you want or run your own instance.
We should note that we generally only support our hosted versions as a matter of :doc:`our philosophy </open-source-philosophy>`.

We owe a great deal to the open source community that we are a part of,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/changelog.rst → docs/user/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

.. include:: ../CHANGELOG.rst
.. include:: ../../CHANGELOG.rst

Previous releases
-----------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/features.rst → docs/user/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Read the Docs cares deeply about our customers and our community.
As part of that commitment,
all of the source code for Read the Docs is open source.
This means there's no vendor lock-in,
and you are welcome to :doc:`contribute </contribute>` the features you want or run your own instance.
and you are welcome to :doc:`contribute <rtd-dev:contribute>` the features you want or run your own instance.

Our bootstrapped company is owned and controlled by the founders,
and fully funded by our customers and advertisers.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/gsoc.rst → docs/user/gsoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ the more likely we are to choose your application!
Getting Started
---------------

The :doc:`/development/install` doc is probably the best place to get going.
The :doc:`rtd-dev:install` doc is probably the best place to get going.
It will walk you through getting a basic environment for Read the Docs setup.

Then you can look through our :doc:`/contribute` doc for information on how to get started contributing to RTD.
Then you can look through our :doc:`rtd-dev:contribute` doc for information on how to get started contributing to RTD.

People who have a history of submitting pull requests will be prioritized in our Summer of Code selection process.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Read the Docs uses :doc:`/server-side-search` to power our search.
This guide explains how to add a "search as you type" feature to your documentation,
and how to use advanced query syntax to get more accurate results.

You can find information on the search architecture and how we index documents in our
:doc:`Search </development/search>` docs.

.. contents:: Table of contents
:local:
:backlinks: none
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
Loading