Skip to content

Commit 1a56667

Browse files
authored
gh-1145: Add an overview of Diátaxis to the style guide (#1177)
1 parent ce77c74 commit 1a56667

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164

165165
intersphinx_mapping = {
166166
'python': ('https://docs.python.org/3', None),
167+
'diataxis': ('https://diataxis.fr/', None),
167168
}
168169

169170
todo_include_todos = True

documentation/style-guide.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,48 @@ Unix
106106
The name of the operating system developed at AT&T Bell Labs in the early
107107
1970s.
108108

109+
Diátaxis
110+
========
111+
112+
Python's documentation strives to follow the `Diátaxis <https://diataxis.fr/>`_
113+
framework. This means adapting the writing style according to the nature of
114+
the documentation that is being written. The framework splits
115+
documentation into four distinct types: tutorials, how-to guides, reference, and
116+
explanation.
117+
118+
* :ref:`python:tutorial-index` should
119+
be explicit and avoid making assumptions about the
120+
reader's knowledge. The goal of a tutorial is to get the user writing
121+
Python code as quickly as possible with clear logical steps. Explanations
122+
and abstract concepts should be avoided. Please consult the Diátaxis guide on
123+
:ref:`diataxis:tutorials` for more detail.
124+
125+
* `Python how-to guides <https://docs.python.org/3/howto/index.html>`_ are
126+
designed to guide a user through a problem-field.
127+
Both tutorials and how-to guides are instructional rather than explanatory
128+
and should provide logical steps on how to complete a task. However,
129+
how-to guides make more assumptions about the user's knoweldge and
130+
focus on the user finding the best way to solve their own
131+
particular problem.
132+
133+
* :ref:`python:reference-index` should
134+
be factual and succinct. The purpose of reference documentation is
135+
to describe rather than to explain. Accuracy and consistency are key as
136+
this type of documentation should be seen as an authoritative source.
137+
:ref:`Code-examples` can be a useful way of achieving these
138+
objectives.
139+
140+
* Python explanations provide
141+
a deeper level of understanding and are naturally more discursive. They aim
142+
to deepen the reader's understanding and answer 'why' questions. They should
143+
provide context, make connections between topics, and discuss alternative
144+
opinions. There is no section dedicated to explanations but these can be
145+
found throughout Python's documentation, for example the
146+
:ref:`python:unicode-howto`
147+
148+
Please consult the `Diátaxis <https://diataxis.fr/>`_ guide for more
149+
detail.
150+
109151
Affirmative tone
110152
================
111153

@@ -163,6 +205,8 @@ module (e.g. OS level pipe buffers filling up and stalling child processes),
163205
these can be documented in a "Common Errors" section and cross-referenced
164206
rather than repeated for every affected interface.
165207

208+
.. _code-examples:
209+
166210
Code examples
167211
=============
168212

0 commit comments

Comments
 (0)