Skip to content

Commit e945d7e

Browse files
Merge pull request #10794 from jorisvandenbossche/doc-dev-versionadded
DOC: add guideline to use versionadded directive to contributing docs (GH10215)
2 parents 490b940 + 5149e8c commit e945d7e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

doc/source/contributing.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ just checked out. There are two primary methods of doing this.
247247
from your development directory. Thus, you can always be using the development
248248
version on your system without being inside the clone directory.
249249

250+
.. _contributing.documentation:
251+
250252
Contributing to the documentation
251253
=================================
252254

@@ -543,10 +545,23 @@ Documenting your code
543545
Changes should be reflected in the release notes located in `doc/source/whatsnew/vx.y.z.txt`.
544546
This file contains an ongoing change log for each release. Add an entry to this file to
545547
document your fix, enhancement or (unavoidable) breaking change. Make sure to include the
546-
GitHub issue number when adding your entry.
548+
GitHub issue number when adding your entry (using `` :issue:`1234` `` where `1234` is the
549+
issue/pull request number).
550+
551+
If your code is an enhancement, it is most likely necessary to add usage
552+
examples to the existing documentation. This can be done following the section
553+
regarding documentation :ref:`above <contributing.documentation>`.
554+
Further, to let users know when this feature was added, the ``versionadded``
555+
directive is used. The sphinx syntax for that is:
556+
557+
.. code-block:: rst
558+
559+
.. versionadded:: 0.17.0
547560
548-
If your code is an enhancement, it is most likely necessary to add usage examples to the
549-
existing documentation. This can be done following the section regarding documentation.
561+
This will put the text *New in version 0.17.0* wherever you put the sphinx
562+
directive. This should also be put in the docstring when adding a new function
563+
or method (`example <https://github.com/pydata/pandas/blob/v0.16.2/pandas/core/generic.py#L1959>`__)
564+
or a new keyword argument (`example <https://github.com/pydata/pandas/blob/v0.16.2/pandas/core/frame.py#L1171>`__).
550565

551566
Contributing your changes to *pandas*
552567
=====================================

0 commit comments

Comments
 (0)