Skip to content

Commit fe629d0

Browse files
committed
Merge tag '6.3.1' into rel
2 parents ceb7ab2 + 1ca22c6 commit fe629d0

33 files changed

+632
-368
lines changed

.readthedocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
version: 2
2+
23
formats: all
4+
35
sphinx:
46
configuration: docs/conf.py
7+
58
python:
69
install:
710
- requirements: requirements/pip.txt
811
- requirements: requirements/docs.txt
912

13+
build:
14+
os: ubuntu-20.04
15+
tools:
16+
python: "3.8"
17+
1018
search:
1119
ignore:
1220
# Internal documentation

CHANGELOG.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
Version 6.3.1
2+
-------------
3+
4+
:Date: December 14, 2021
5+
6+
* `@stsewd <https://github.com/stsewd>`__: Explicit settings for some tests (`#8759 <https://github.com/readthedocs/readthedocs.org/pull/8759>`__)
7+
* `@stsewd <https://github.com/stsewd>`__: Don't run spam rules check after ban action (`#8756 <https://github.com/readthedocs/readthedocs.org/pull/8756>`__)
8+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Add MyST Markdown examples everywhere (`#8752 <https://github.com/readthedocs/readthedocs.org/pull/8752>`__)
9+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Update mambaforge to latest version (`#8749 <https://github.com/readthedocs/readthedocs.org/pull/8749>`__)
10+
* `@stsewd <https://github.com/stsewd>`__: Update django (`#8748 <https://github.com/readthedocs/readthedocs.org/pull/8748>`__)
11+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Remove sphinx-doc.org from external domains (`#8747 <https://github.com/readthedocs/readthedocs.org/pull/8747>`__)
12+
* `@stsewd <https://github.com/stsewd>`__: Fix call to sync_remote_repositories (`#8742 <https://github.com/readthedocs/readthedocs.org/pull/8742>`__)
13+
* `@stsewd <https://github.com/stsewd>`__: Tests: set privacy level explicitly (`#8740 <https://github.com/readthedocs/readthedocs.org/pull/8740>`__)
14+
* `@humitos <https://github.com/humitos>`__: Spam: contact link on template (`#8739 <https://github.com/readthedocs/readthedocs.org/pull/8739>`__)
15+
* `@humitos <https://github.com/humitos>`__: Spam: fix admin filter (`#8738 <https://github.com/readthedocs/readthedocs.org/pull/8738>`__)
16+
* `@stsewd <https://github.com/stsewd>`__: Always clear cache after each test (`#8737 <https://github.com/readthedocs/readthedocs.org/pull/8737>`__)
17+
* `@humitos <https://github.com/humitos>`__: Logging: tweaks and minor improvements (`#8736 <https://github.com/readthedocs/readthedocs.org/pull/8736>`__)
18+
* `@humitos <https://github.com/humitos>`__: Logs: typo on keyname (`#8734 <https://github.com/readthedocs/readthedocs.org/pull/8734>`__)
19+
* `@humitos <https://github.com/humitos>`__: Log: use structlog-sentry to send logs to Sentry (`#8732 <https://github.com/readthedocs/readthedocs.org/pull/8732>`__)
20+
* `@humitos <https://github.com/humitos>`__: docs: use Python 3.8 to build our docs (`#8731 <https://github.com/readthedocs/readthedocs.org/pull/8731>`__)
21+
* `@agjohnson <https://github.com/agjohnson>`__: Release 6.3.0 (`#8730 <https://github.com/readthedocs/readthedocs.org/pull/8730>`__)
22+
* `@stsewd <https://github.com/stsewd>`__: Custom Domain: make cname_target configurable (`#8728 <https://github.com/readthedocs/readthedocs.org/pull/8728>`__)
23+
* `@stsewd <https://github.com/stsewd>`__: Test external serving for projects with `--` in slug (`#8716 <https://github.com/readthedocs/readthedocs.org/pull/8716>`__)
24+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Add guide to migrate from reST to MyST (`#8714 <https://github.com/readthedocs/readthedocs.org/pull/8714>`__)
25+
* `@astrojuanlu <https://github.com/astrojuanlu>`__: Avoid future breakage of `setup.py` invokations (`#8711 <https://github.com/readthedocs/readthedocs.org/pull/8711>`__)
26+
* `@humitos <https://github.com/humitos>`__: structlog: migrate application code to better logging (`#8705 <https://github.com/readthedocs/readthedocs.org/pull/8705>`__)
27+
* `@humitos <https://github.com/humitos>`__: EmbedAPI: log success requests (`#8689 <https://github.com/readthedocs/readthedocs.org/pull/8689>`__)
28+
* `@ericholscher <https://github.com/ericholscher>`__: Add ability to rebuild a specific build (`#6995 <https://github.com/readthedocs/readthedocs.org/pull/6995>`__)
29+
130
Version 6.3.0
231
-------------
332

docs/advertising/ethical-advertising.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Ethical Ads
2-
===========
1+
EthicalAds
2+
==========
33

44
.. meta::
55
:description lang=en: To fund Read the Docs, we built an ad platform that doesn't track users and respects their privacy.
@@ -8,9 +8,9 @@ Ethical Ads
88
Read the Docs is a large, free web service.
99
There is one proven business model to support this kind of site: **Advertising**.
1010
We are building the advertising model we want to exist,
11-
and we're calling it **Ethical Ads**.
11+
and we're calling it **EthicalAds**.
1212

13-
**Ethical Ads respect users while providing value to advertisers.**
13+
**EthicalAds respect users while providing value to advertisers.**
1414
We don't track you, sell your data, or anything else.
1515
We simply show ads to users, based on the content of the pages you look at.
1616
We also give 10% of our ad space to :ref:`community projects <advertising/ethical-advertising:Community Ads>`,

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def get_version():
3535
'hoverxref.extension',
3636
'sphinx_search.extension',
3737
'sphinxemoji.sphinxemoji',
38+
'myst_parser',
3839
]
3940

4041
templates_path = ['_templates']
@@ -63,7 +64,12 @@ def get_version():
6364
'myst-parser': ('https://myst-parser.readthedocs.io/en/v0.15.1/', None),
6465
'writethedocs': ('https://www.writethedocs.org/', None),
6566
'jupyterbook': ('https://jupyterbook.org/', None),
67+
'myst-parser': ('https://myst-parser.readthedocs.io/en/v0.15.1/', None),
68+
'rst-to-myst': ('https://rst-to-myst.readthedocs.io/en/stable/', None),
6669
}
70+
myst_enable_extensions = [
71+
"deflist",
72+
]
6773
hoverxref_intersphinx = [
6874
"sphinx",
6975
"pip",

docs/guides/authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ and :doc:`/intro/getting-started-with-mkdocs`.
1616
cross-referencing-with-sphinx
1717
intersphinx
1818
jupyter
19+
migrate-rest-myst

docs/guides/embedding-content.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,33 @@ and show a modal when the user clicks in a "Help" link.
7979
To avoid that, you can manually define Sphinx references above the sections you don't want to break.
8080
For example,
8181

82-
.. code-block:: rst
83-
:emphasize-lines: 3
82+
.. tabs::
8483

85-
.. in your .rst document file
84+
.. tab:: reStructuredText
8685

87-
.. _unbreakable-section-reference:
86+
.. code-block:: rst
87+
:emphasize-lines: 3
8888
89-
Creating an automation rule
90-
---------------------------
89+
.. in your .rst document file
9190
92-
This is the text of the section.
91+
.. _unbreakable-section-reference:
92+
93+
Creating an automation rule
94+
---------------------------
95+
96+
This is the text of the section.
97+
98+
.. tab:: MyST (Markdown)
99+
100+
.. code-block:: md
101+
:emphasize-lines: 3
102+
103+
.. in your .md document file
104+
105+
(unbreakable-section-reference)=
106+
## Creating an automation rule
107+
108+
This is the text of the section.
93109
94110
To link to the section "Creating an automation rule" you can send ``section=unbreakable-section-reference``.
95111
If you change the title it won't break the embedded content because the label for that title will still be ``unbreakable-section-reference``.

docs/guides/jupyter.rst

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,29 @@ Next, you will need to enable one of the extensions, as follows:
5858
Finally, you can include the notebook in any *toctree*.
5959
For example, add this to your root document:
6060

61-
.. code-block:: rest
61+
.. tabs::
62+
63+
.. tab:: reStructuredText
64+
65+
.. code-block:: rst
66+
67+
.. toctree::
68+
:maxdepth: 2
69+
:caption: Contents:
6270
63-
.. toctree::
64-
:maxdepth: 2
65-
:caption: Contents:
71+
notebooks/Example 1
6672
67-
notebooks/Example 1
73+
.. tab:: MyST (Markdown)
74+
75+
.. code-block:: md
76+
77+
```{toctree}
78+
---
79+
maxdepth: 2
80+
caption: Contents:
81+
---
82+
notebooks/Example 1
83+
```
6884
6985
The notebook will render as any other HTML page in your documentation
7086
after doing ``make html``.
@@ -255,14 +271,29 @@ For example, this reST markup would create a thumbnail gallery
255271
with generic images as thumbnails,
256272
thanks to the Sphinx-Gallery default style:
257273

258-
.. code-block:: rest
274+
.. tabs::
275+
276+
.. tab:: reStructuredText
277+
278+
.. code-block:: rst
279+
280+
Thumbnails gallery
281+
==================
282+
283+
.. nbgallery::
284+
notebooks/Example 1
285+
notebooks/Example 2
286+
287+
.. tab:: MyST (Markdown)
288+
289+
.. code-block:: md
259290
260-
Thumbnails gallery
261-
==================
291+
# Thumbnails gallery
262292
263-
.. nbgallery::
264-
notebooks/Example 1
265-
notebooks/Example 2
293+
```{nbgallery}
294+
notebooks/Example 1
295+
notebooks/Example 2
296+
```
266297
267298
.. figure:: /_static/images/guides/thumbnail-gallery.png
268299
:width: 80%

docs/guides/migrate-rest-myst.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Migrating from reStructuredText to MyST Markdown
2+
3+
Sphinx is usually associated with reStructuredText, the markup language
4+
{pep}`designed for the CPython project in the early '00s <287>`.
5+
However, for quite some time Sphinx has been compatible with Markdown as well,
6+
thanks to a number of extensions.
7+
8+
The most powerful of such extensions is {doc}`MyST-Parser <myst-parser:index>`,
9+
which implements a CommonMark-compliant, extensible Markdown dialect
10+
with support for the Sphinx roles and directives that make it so useful.
11+
In this guide, you will find
12+
how you can start writing Markdown in your existing reStructuredText project,
13+
or migrate it completely.
14+
15+
If, instead of migrating, you are starting a new project from scratch,
16+
have a look at {doc}`myst-parser:sphinx/intro`.
17+
18+
## Writing your content both in reStructuredText and MyST
19+
20+
It is useful to ask whether a migration is necessary in the first place.
21+
Doing bulk migrations of large projects with lots of work in progress
22+
will create conflicts for ongoing changes.
23+
On the other hand, your writers might prefer to have some files in Markdown
24+
and some others in reStructuredText, for whatever reason.
25+
Luckily, Sphinx supports reading both types of markup at the same time without problems.
26+
27+
To start using MyST in your existing Sphinx project,
28+
first {ref}``install the `myst-parser` Python package <myst-parser:sphinx/intro.md#install-the-myst-parser>``
29+
and then {ref}`enable it on your configuration <myst-parser:parse-with-sphinx>`:
30+
31+
```{code-block} py
32+
:caption: conf.py
33+
:emphasize-lines: 4
34+
35+
extensions = [
36+
# Your existing extensions
37+
...,
38+
"myst_parser",
39+
]
40+
```
41+
42+
Your reStructuredText documents will keep rendering,
43+
and you will be able to add MyST documents with the `.md` extension
44+
that will be processed by MyST-Parser.
45+
46+
As an example, _this guide_ is written in MyST
47+
while the rest of the Read the Docs documentation is written in reStructuredText.
48+
49+
```{note}
50+
By default, MyST-Parser registers the `.md` suffix for MyST source files.
51+
If you want to use a different suffix, you can do so by changing your
52+
`source_suffix` configuration value in `conf.py`.
53+
```
54+
55+
## Converting existing reStructuredText documentation to MyST
56+
57+
To convert existing reST documents to MyST, you can use
58+
the `rst2myst` CLI script shipped by {doc}`rst-to-myst:index`.
59+
The script supports converting the documents one by one,
60+
or scanning a series of directories to convert them in bulk.
61+
62+
After {doc}``installing `rst-to-myst` <rst-to-myst:index>``,
63+
you can run the script as follows:
64+
65+
```console
66+
$ rst2myst convert docs/source/index.rst # Converts index.rst to index.md
67+
$ rst2myst convert docs/**/*.rst # Convert every .rst file under the docs directory
68+
```
69+
70+
This will create a `.md` MyST file for every `.rst` source file converted.
71+
72+
### Advanced usage of `rst2myst`
73+
74+
The `rst2myst` accepts several flags to modify its behavior.
75+
All of them have sensible defaults, so you don't have to specify them
76+
unless you want to.
77+
78+
These are a few options you might find useful:
79+
80+
{option}``-d, --dry-run <rst-to-myst:rst2myst-convert.--dry-run>``
81+
: Only verify that the script would work correctly,
82+
without actually writing any files.
83+
84+
{option}``-R, --replace-files <rst-to-myst:rst2myst-convert.--replace-files>``
85+
: Replace the `.rst` files by their `.md` equivalent,
86+
rather than writing a new `.md` file next to the old `.rst` one.
87+
88+
You can read the full list of options in
89+
{doc}``the `rst2myst` documentation <rst-to-myst:cli>``.
90+
91+
## Enabling optional syntax
92+
93+
Some reStructuredText syntax will require you to enable certain MyST plugins.
94+
For example, to write [reST definition lists], you need to add a
95+
`myst_enable_extensions` variable to your Sphinx configuration, as follows:
96+
97+
```{code-block} py
98+
:caption: conf.py
99+
myst_enable_extensions = [
100+
"deflist",
101+
]
102+
```
103+
104+
You can learn more about {doc}`other MyST-Parser plugins <myst-parser:syntax/optional>`
105+
in their documentation.
106+
107+
[reST definition lists]: https://docutils.sourceforge.io/docs/user/rst/quickref.html#definition-lists
108+
109+
## Writing reStructuredText syntax within MyST
110+
111+
There is a small chance that `rst2myst` does not properly understand a piece of reST syntax,
112+
either because there is a bug in the tool
113+
or because that syntax does not have a MyST equivalent yet.
114+
For example, {ref}`as explained in the documentation <myst-parser:howto/autodoc>`,
115+
the `sphinx.ext.autodoc` extension is incompatible with MyST.
116+
117+
Fortunately, MyST supports an `eval-rst` directive
118+
that will parse the content as reStructuredText, rather than MyST.
119+
For example:
120+
121+
````
122+
```{eval-rst}
123+
.. note::
124+
125+
Complete MyST migration.
126+
127+
```
128+
````
129+
130+
will produce the following result:
131+
132+
```{eval-rst}
133+
.. note::
134+
135+
Complete MyST migration.
136+
137+
```
138+
139+
As a result, this allows you to conduct a gradual migration,
140+
at the expense of having heterogeneous syntax in your source files.
141+
In any case, the HTML output will be the same.

0 commit comments

Comments
 (0)