Skip to content

Commit 7c09610

Browse files
committed
Commit and updating documentation syntax and capitalization for folder doc/source/development
Updating script validate_rst_title_capitalization.py to avoid taking into account titles beginning with ':'
1 parent 5ba464c commit 7c09610

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

doc/source/development/code_style.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ consistent code format throughout the project. For details see the
1818
Patterns
1919
========
2020

21-
Foo.class
22-
-------------
21+
Using foo.__class__
22+
-------------------
2323

2424

2525
pandas uses 'type(foo)' instead 'foo.__class__' as it is making the code more
@@ -47,8 +47,8 @@ String formatting
4747
Concatenated strings
4848
--------------------
4949

50-
F-strings
51-
~~~~~~~~~
50+
Using f-strings
51+
~~~~~~~~~~~~~~~
5252

5353
pandas uses f-strings formatting instead of '%' and '.format()' string formatters.
5454

doc/source/development/extending.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ on :ref:`ecosystem.extensions`.
9595

9696
The interface consists of two classes.
9797

98-
Class:~pandas.API.extensions.ExtensionDtype
98+
:class:`~pandas.api.extensions.ExtensionDtype`
9999
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100100

101101
A :class:`pandas.api.extensions.ExtensionDtype` is similar to a ``numpy.dtype`` object. It describes the
@@ -115,7 +115,7 @@ example ``'category'`` is a registered string accessor for the ``CategoricalDtyp
115115

116116
See the `extension dtype dtypes`_ for more on how to register dtypes.
117117

118-
Class:~pandas.API.extensions.ExtensionArray
118+
:class:`~pandas.api.extensions.ExtensionArray`
119119
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120120

121121
This class provides all the array-like functionality. ExtensionArrays are
@@ -139,7 +139,7 @@ and comments contain guidance for properly implementing the interface.
139139

140140
.. _extending.extension.operator:
141141

142-
Class:~pandas.API.extensions.ExtensionArray operator support
142+
:class:`~pandas.api.extensions.ExtensionArray` operator support
143143
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144144

145145
.. versionadded:: 0.24.0

scripts/validate_rst_title_capitalization.py

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ def find_titles(rst_file: str) -> Generator[Tuple[str, int], None, None]:
177177
len(line_chars) == 1
178178
and line_chars.pop() in symbols
179179
and len(line) == len(previous_line)
180+
and previous_line[0] != ':'
180181
):
181182
yield re.sub(r"[`\*_]", "", previous_line), i
182183
previous_line = line
@@ -233,6 +234,8 @@ def main(source_paths: List[str], output_format: str) -> bool:
233234

234235
for filename in find_rst_files(source_paths):
235236
for title, line_number in find_titles(filename):
237+
if ":class" in title:
238+
print(title)
236239
if title != correct_title_capitalization(title):
237240
print(
238241
f"""{filename}:{line_number}:{err_msg} "{title}" to "{

0 commit comments

Comments
 (0)