Skip to content
Merged
Changes from all 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
31 changes: 31 additions & 0 deletions documentation/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ the footnote reference.

Footnotes may appear in the middle of sentences where appropriate.


Capitalization
==============

Expand Down Expand Up @@ -143,6 +144,7 @@ explanation.
Please consult the `Diátaxis <https://diataxis.fr/>`_ guide for more
detail.


Links
=====

Expand Down Expand Up @@ -171,6 +173,7 @@ documentation for ``map``. You can suppress the link while keeping the
semantic presentation of the function name by adding an exclamation point
prefix: ``:func:`!map```. See :ref:`roles` for more details.


Affirmative tone
================

Expand All @@ -196,6 +199,29 @@ language):
achieve the same effect. This assures that files are flushed and file
descriptor resources are released in a timely manner.


Author attribution
==================

For new documentation, do not use a byline (naming the author of the document).
Explicit attribution tends to discourage other users from updating community
documentation.
Comment on lines +203 to +208
Copy link
Member

Choose a reason for hiding this comment

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

I'd be interested to see background on this, if possible. I've personally never felt deterred by a byline, and it is a nice way to credit someone who's written a major guide or document. However, perhaps there is a more quantitative study that we could reference if introducing this guidance?

Copy link
Member

Choose a reason for hiding this comment

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

I do feel uneasy about changing docs that are attributed to a specific author. It feels like I'm putting words in their mouth that they may not agree with.

Copy link
Member

Choose a reason for hiding this comment

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

I think it depends on the type of document and the type of change. For example, updating module docs is easier than updating a howto, since in the howto the original author might have had a more specific vision and goals.

On the other hand, having a byline is also useful to get in touch with the original author and ask for advice and reviews before making major changes (this could technically be replaced by git blame and CODEOWNERS).

Copy link
Member

Choose a reason for hiding this comment

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

it is a nice way to credit someone who's written a major guide or document

How do we credit someone who has written a major code changes? I don't think we add their name to the top of module name, so why would this be any different? This is an open source documentation not a blog.

having a byline is also useful to get in touch with the original author and ask for advice and reviews before making major changes (this could technically be replaced by git blame and CODEOWNERS)

As you said, this can be done by git blame and codeowners. However I would like for us to rethink the notion that the original author is the only one capable of reviewing/giving advice. Their advice may be sought, but should not be the only advice that matters, and should not be the only advice we rely on. Other contributors' review and advice should be taken into consideration equally.

Copy link
Member

@pitrou pitrou Aug 22, 2024

Choose a reason for hiding this comment

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

My experience in CPython is that personal ownership of areas has sometimes given rise to conflicts when other contributors wanted to meaningfully participate (without always bowing to the original author's preferences). So I'm in favor of this guideline.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with @pitrou.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do feel uneasy about changing docs that are attributed to a specific author

@JelleZijlstra I am supportive of this for existing documentation. However, this PR is concerning new documentation 😄

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd be interested to see background on this, if possible. I've personally never felt deterred by a byline, and it is a nice way to credit someone who's written a major guide or document. However, perhaps there is a more quantitative study that we could reference if introducing this guidance?

@AA-Turner The byline style recommendation is related to new documentation. We have seen that bylines in certain areas of the documentation has caused conflicts where an individual acts as owner of the community resource. We see similar behavior when we look at academic publishing: https://pubmed.ncbi.nlm.nih.gov/31161378/

My general feeling is that reference documentation should not have bylines. As others have mentioned git blame or git log can offer recognition. If someone creates a new "How to", I think it would be reasonable to recognize in release notes/what's new as we do code contributions.

Copy link
Member

Choose a reason for hiding this comment

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

I am supportive of this for existing documentation. However, this PR is concerning new documentation

True. We could also consider removing bylines from existing documentation, or replacing them with something more indefinite like "Originally written by Jelle Zijlstra; maintained by the community". However, that's out of scope for this change.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the suggestion @JelleZijlstra for future wording:

"Originally written by Jelle Zijlstra; maintained by the community"


Existing documentation with bylines will not be changed unless the author
decides to do so. This is subject to change in the future.


Pronunciation of dunder names
=============================

"Dunder names" like ``__init__`` can be awkward in running prose: is it "an
init" or "a dunder init"? Our recommendation is to ignore the underscores and
use the article that is appropriate for the word in the name. A `quick poll`__
backs this up: "an __init__."

__ https://hachyderm.io/@nedbat/112129685322594689


Economy of expression
=====================

Expand All @@ -207,6 +233,7 @@ to understanding and can result in even more ways to misread or misinterpret the
text. Long descriptions full of corner cases and caveats can create the
impression that a function is more complex or harder to use than it actually is.


Security considerations (and other concerns)
============================================

Expand All @@ -228,6 +255,7 @@ module (for example, OS level pipe buffers filling up and stalling child process
these can be documented in a "Common Errors" section and cross-referenced
rather than repeated for every affected interface.


.. _code-examples:

Code examples
Expand All @@ -248,6 +276,7 @@ lines and output lines. Besides contributing visual clutter, it makes it
difficult for readers to cut-and-paste examples so they can experiment with
variations.


Code equivalents
================

Expand All @@ -272,6 +301,7 @@ An example of when not to use a code equivalent is for the :func:`oct` function.
The exact steps in converting a number to octal doesn't add value for a user
trying to learn what the function does.


Audience
========

Expand All @@ -293,6 +323,7 @@ the documentation wasn't consulted until after the error was made. It is
unfortunate, but typically no documentation edit would have saved the user from
making false assumptions about the language ("I was surprised by ...").


Function signatures
===================

Expand Down
Loading