-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add sphinx spelling extension #21109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
615d007
f6481aa
fc9a960
4117a9c
a2fe8b9
39482e0
c99a15d
18dc19c
d929098
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ doc: | |
cd doc; \ | ||
python make.py clean; \ | ||
python make.py html | ||
python make.py spellcheck | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,6 +436,25 @@ the documentation are also built by Travis-CI. These docs are then hosted `here | |
<http://pandas-docs.github.io/pandas-docs-travis>`__, see also | ||
the :ref:`Continuous Integration <contributing.ci>` section. | ||
|
||
Spell checking documentation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
When contributing to documentation to **pandas** it's good to check if your work | ||
contains any spelling errors. Sphinx provides an easy way to spell check documentation | ||
and docstrings. | ||
|
||
Running the spell check is easy. Just navigate to your local ``pandas/doc/`` directory and run:: | ||
|
||
python make.py spellcheck | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we alternately add a rule to the Makefile so that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't think about this my apologies I'll add the spellcheck on the makefile 👍 |
||
|
||
The spellcheck will take a few minutes to run (between 1 to 6 minutes). Sphinx will alert you | ||
with warnings and misspelt words - these misspelt words will be added to a file called | ||
``output.txt`` and you can find it on your local directory ``pandas/doc/build/spelling/``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not saying this is a bad thing but any reason you chose to output to a text file instead of to STDOUT? All of the other checks I can think of off the top of my head would write to the latter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, I didn't choose such approach. The spelling library is coded in this way (I checked the source code), it will always output a text file with all the misspelt words. To be honest I would much rather work with STDOUT and avoid calling open on a file to check if it was empty |
||
|
||
The Sphinx spelling extension uses an EN-US dictionary to correct words, what means that in | ||
some cases you might need to add a word to this dictionary. You can do so by adding the word to | ||
the bag-of-words file named ``spelling_wordlist.txt`` located in the folder ``pandas/doc/``. | ||
|
||
.. _contributing.code: | ||
|
||
Contributing to the code base | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm well I was thinking with would be a separate rule but the way you've done it doc is fine and may even be preferable. Just calling out here in case another reviewer has a differing opinion