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

Already on GitHub? Sign in to your account

Docs: Split Subprojects in Explanation and How-to (Diátaxis) #9785

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fe1834d
Existing text refactored into howto and explanation
benjaoming Dec 7, 2022
98405ef
Improve subproject explanation with some cases of when it's useful
benjaoming Dec 7, 2022
b5a0b28
Apply suggestions from code review by @humitos
benjaoming Dec 13, 2022
dcfd850
Merge branch 'diataxis/main' of github.com:readthedocs/readthedocs.or…
benjaoming Dec 15, 2022
a7f620b
Merge branch 'diataxis/main' of github.com:readthedocs/readthedocs.or…
benjaoming Dec 15, 2022
51f0b65
Really spell out the alias of a subproject vs. its name
benjaoming Dec 15, 2022
06d66bf
Lowercase foo and bar
benjaoming Dec 15, 2022
88539ab
Describe common searching as a main objective of using subprojects, a…
benjaoming Dec 15, 2022
91b6093
Update docs/user/subprojects.rst
benjaoming Dec 16, 2022
7d646ff
Apply suggestions from code review @ericholscher
benjaoming Dec 16, 2022
671268d
Update docs/user/guides/subprojects.rst
benjaoming Dec 16, 2022
6ec729e
Updates to Subprojects Explanation and How-to from @ericholscher feed…
benjaoming Dec 16, 2022
9c558ba
Update introduction, improvents pending...
benjaoming Dec 16, 2022
36d1518
Adds another intro paragraph
benjaoming Dec 16, 2022
be54e81
Also make *main website* emphasized
benjaoming Dec 16, 2022
b2f15c8
Update docs/user/guides/subprojects.rst
benjaoming Dec 16, 2022
0e60438
Update docs/user/guides/subprojects.rst
benjaoming Dec 16, 2022
e2152f6
Apply suggestions from code review @ericholscher
benjaoming Dec 16, 2022
5ccd208
Add mentions of subprojects in Intersphinx how-to and vice versa
benjaoming Dec 20, 2022
56ab513
Thanks PyCharm for the lovely emoji support 📝️📝️📝️
benjaoming Dec 20, 2022
87dc2cd
Make it possible to see from the main example that example-project-pl…
benjaoming Dec 20, 2022
4bff449
Rename all occurrences of foo and bar to example-project and example-…
benjaoming Dec 20, 2022
b08f8ba
Add precision to subproject create/edit form
benjaoming Dec 20, 2022
0abc008
Apply suggestions from code review by @humitos :tada: :+1:
benjaoming Dec 21, 2022
29b9006
Update docs/user/subprojects.rst
benjaoming Dec 22, 2022
f7cbdb7
Merge branch 'diataxis/main' into diataxis/relabel-subprojects
benjaoming Dec 22, 2022
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
36 changes: 21 additions & 15 deletions docs/user/guides/subprojects.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
How To Add a Subproject
=======================
How to manage subprojects
=========================

This guide shows you how to add a subproject to your main project.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -14,24 +14,30 @@ Adding a subproject
In the admin dashboard for your project, select :guilabel:`Subprojects` from the menu.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
From this page you can add a subproject by typing in the project slug.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Immediately after adding the subproject, its default version will be visible from the link displayed in the list of subprojects.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

.. note::

* On |org_brand|, you need to be maintainer of a subproject in order to choose it from your main project.
* On |com_brand|, you need to have admin access to the subproject in order to choose it from your main project.

Subproject aliases
~~~~~~~~~~~~~~~~~~
Editing a subproject
--------------------

You can edit a subproject at any time by clicking :guilabel:`|:memo:|` in the list of subprojects.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
On the following page, it's possible to both change the alias and source project.
Click :guilabel:`Update subproject` to save your changes.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

What is visible in ``/projects/<subproject-alias>/`` will be updated immediately when you save your changes.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved


Deleting a subproject
---------------------

You can choose an alias for the subproject when it is created.
This allows you to override the URL that is used to access it,
giving more control over how you want to structure your projects.
You can edit a subproject at any time by clicking :guilabel:`|:memo:|` in the list of subprojects.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
On the edit page, click :guilabel:`Delete subproject`.

You can set your subproject's project name and :term:`slug` however you want,
but we suggest prefixing it with the name of the main project.
Your subproject will be removed immediately and it will stop redirecting from its own domain.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Typically, a subproject is created with a ``<mainproject>-`` prefix,
for instance if the main project is called ``foo`` and the subproject is called ``bar``,
then the subproject's Read the Docs project name will be ``foo-bar``.
When adding the subproject,
the alias is set to ``bar`` and the project's URL becomes
``foo.readthedocs.io/projects/bar``.
Deleting a subproject does not mean to completely remove that project.
It is solely about removing the reference from the main project.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
74 changes: 53 additions & 21 deletions docs/user/subprojects.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
Subprojects: host multiple projects on a single domain
=====================================================
======================================================

Projects can be configured in a nested manner, by configuring a project as a
*subproject* of another project. This allows for documentation projects to share
a search index and a namespace or custom domain, but still be maintained
independently.
In this article, you can learn more about how several documentation projects can be combined and presented to the reader on the same website.

Read the Docs projects can be configured to make other *subprojects* available on the website of the *main project*.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
This allows for documentation projects to share a search index and a namespace or custom domain,
but still be maintained independently.

This is useful for:

* Organizations that need all their projects visible in one documentation portal or landing page
* Projects that document and release several packages or extensions
* Organizations or projects that want to have a common search function for several sets of documentation

For example, a parent project, ``foo`` is set up with a subproject, ``bar``. The
documentation for ``foo`` will be available at:
For example, a parent project, ``example-project`` is set up with a subproject, ``plugin``. The
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
documentation for ``example-project`` will be available at:

https://foo.readthedocs.io/en/latest/
https://example-project.readthedocs.io/en/latest/

The documentation for ``bar`` will be available under this same path:
The documentation for ``plugin`` will be available under this same path:

https://foo.readthedocs.io/projects/bar/en/latest/
https://example-project.readthedocs.io/projects/plugin/en/latest/

.. seealso::

:doc:`/guides/subprojects`


Sharing a custom domain
-----------------------

Projects and subprojects can also be used to share a custom domain with a number
of projects. To configure this, one project should be established as the parent
project. This project will be configured with a custom domain. Projects can then
be added as subprojects to this parent project.
Projects and subprojects can be used to share a custom domain.
To configure this, one project should be established as the main project.
This project will be configured with a custom domain.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
Other projects are then added as subprojects to the main project.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

If the example project ``foo`` was set up with a custom domain,
``docs.example.com``, the URLs for projects ``foo`` and ``bar`` would
respectively be at:
respectively be at:

* `foo`: https://docs.example.com/en/latest/
* `bar`: https://docs.example.com/projects/bar/en/latest/

.. note::

The terms "parent" and "child" are also used,
where the main project is the parent and all subprojects are a child.
You can **not** have a child of a child,
meaning that you cannot add a subproject to a subproject.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Using aliases
-------------

You can choose an alias for the subproject when it is created.
This allows you to override the URL that is used to access it,
giving more control over how you want to structure your projects.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

You can set your subproject's project name and :term:`slug` however you want,
but we suggest prefixing it with the name of the main project.

Typically, a subproject is created with a ``<mainproject>-`` prefix,
for instance if the main project is called ``foo`` and the subproject is called ``bar``,
then the subproject's Read the Docs project name will be ``foo-bar``.
When adding the subproject,
the alias is set to ``bar`` and the project's URL becomes
``foo.readthedocs.io/projects/bar``.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

When you add a subproject,
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
the subproject will not be directly available anymore from its own domain.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved
For instance, ``subproject.readthedocs.io/`` will redirect to ``mainproject.readthedocs.io/projects/subproject``.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

Custom domain on subprojects
----------------------------

Expand All @@ -51,14 +79,18 @@ the domain of the parent project.
Separate release cycles
-----------------------

When several projects are documented in the same space, it's common that they follow separate release cycles.
By using subprojects,
you can present the documentation of several projects
even though they have separate release cycles.

We recommend that the documentation follows the release cycle of whatever it is documenting.
By using subprojects, you can present your documentation for several projects with separate release cycles.
This is solved by having the :term:`flyout menu` active for the project that's viewed.
Your main project may have its own versions and releases,
while all of its subprojects maintain their own individual versions and releases.
We recommend that documentation follows the release cycle of whatever it is documenting,
meaning that your subprojects should be free to follow their own release cycle.
benjaoming marked this conversation as resolved.
Show resolved Hide resolved

This is solved by having an individual :term:`flyout menu` active for the project that's viewed.
When the user navigates to a subproject,
they are presented with a :term:`flyout menu` matching the subproject's versions and :doc:`/downloadable-documentation`.
they are presented with a flyout menu matching the subproject's versions and :doc:`/downloadable-documentation`.

Search
------
Expand Down