Skip to content
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

[feature] Added spell check #199 #204

Merged
merged 15 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
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
67 changes: 35 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,36 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " build to build the documentation in all formats (PDF, HTML and ePUB)"
@echo " build_html to build the documentation in HTML format only"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " build to build the documentation in all formats (PDF, HTML and ePUB)"
@echo " build_html to build the documentation in HTML format only"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
@echo " version_map to generate a data strucutre which holds a map of all the pages"
@echo " spellcheck to perform a spell check"

.PHONY: clean
clean:
Expand All @@ -58,7 +60,7 @@ build:
# the version map, so we remove it before building.
rm versions_map.json &> /dev/null || true

#If the build is successful, the version map is stored in the
# If the build is successful, the version map is stored in the
# _build/ directory, allowing re-use of the version map when sphinx uses cache
# in subsequent builds and only builds the changed files.
mv _build/versions_map.json versions_map.json &> /dev/null || true
Expand Down Expand Up @@ -260,8 +262,9 @@ dummy:

.PHONY: version_map
version_map:
$(SPHINXBUILD) -Q -b version_map $(ALLSPHINXOPTS) $(BUILDDIR)/version_map
$(SPHINXBUILD) --quiet --fresh-env -b version_map $(ALLSPHINXOPTS) $(BUILDDIR)/version_map

.PHONY: format
format:
docstrfmt -l 74 .
.PHONY: spellcheck
spellcheck:
$(SPHINXBUILD) -W -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)
@echo "Spell check completed."
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ instead of HTTPS. For example:

SSH=1 make build

Spell check
~~~~~~~~~~~

.. code-block:: shell

make spellcheck

Need help?
----------

Expand Down
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def main():
if os.environ.get('PRODUCTION', False):
docs_root = '/docs'
html_base_url = 'https://openwisp.io'
build_dir = f'{build_dir}/{docs_root}'
build_dir = f'{build_dir}{docs_root}'

for version in build_versions:
version_name = version['name']
Expand Down Expand Up @@ -341,7 +341,7 @@ def main():
)
module_dirs.append(module['dir_name'])
sphinx_src_dir = version.get('sphinx_src_dir', '.')
for format in args.formats:
for format in ['spellcheck'] + args.formats:
subprocess.run(
[
'make',
Expand Down
11 changes: 7 additions & 4 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'sphinx.ext.githubpages',
'notfound.extension',
'openwisp.sphinx.theme',
'sphinxcontrib.spelling',
'version_switcher',
]

Expand Down Expand Up @@ -175,10 +176,8 @@
#
# html_last_updated_fmt = None

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#
# html_use_smartypants = 4True
# This has to be disabled because it messes with spell-check
smartquotes = False

# Custom sidebar templates, maps document names to template names.
#
Expand Down Expand Up @@ -442,6 +441,10 @@
),
}

spelling_word_list_filename = 'spelling_wordlist.txt'
spelling_filters = ['sphinxcontrib.spelling.filters.ContractionFilter']
spelling_exclude_patterns = ['_build', 'requirements.txt']

# Configuration for generating comprehensive docs
import os
import sys
Expand Down
7 changes: 3 additions & 4 deletions developer/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ github issue, don't hesitate to ask questions in our `general chat
<https://gitter.im/openwisp/general>`_.

**You don't need to wait for the issue to be assigned to you.** Just check
if there is anyone else actively working on it (eg: an open pull request
if there is anyone else actively working on it (e.g.: an open pull request
with recent activity). If nobody else is actively working on it, **just
announce your intention to work on it by leaving a comment in the issue**.

Expand Down Expand Up @@ -94,7 +94,7 @@ on github).
1. Branch naming guidelines
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Create a new branch for your patch, use a self-descriptive name, eg:
Create a new branch for your patch, use a self-descriptive name, e.g.:

.. code-block::

Expand Down Expand Up @@ -185,8 +185,7 @@ now on we will shorten it often to just *PR*):
Keep your contribution focused and change the least amount of lines of
code as possible needed to reach the goal you're working on.

**Avoid changes unrelated** to the feature/bugfix/change you're working
on.
**Avoid changes unrelated** to the feature/fix/change you're working on.

**Avoid changes related to white-space** (spaces, tabs, blank lines) by
setting your editor as follows:
Expand Down
14 changes: 7 additions & 7 deletions developer/google-code-in.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Google Code-in

.. note::

Google Code-in was a contest that introduced pre-university students
Google Code-in was a contest that introduced preuniversity students
(ages 13-17) to open source software development. OpenWISP has been a
mentoring organization in this program for 3 years:

Expand Down Expand Up @@ -103,7 +103,7 @@ Be patient

Mentors are volunteers and they have their own obligations to attend.

Avoid asking them continously to review your task. You are in a queue and
Avoid asking them continuously to review your task. You are in a queue and
you need to wait at least 24 hours as indicated in the GCI guidelines

**Hint**: optimize your time!
Expand Down Expand Up @@ -274,11 +274,11 @@ don't feel comfortable discussing in public, please get in touch with an
organization administrator, the organization admins for the 2019 edition
are:

- 2stacks
- hispanico
- atb00ker
- cappe87
- nemesisdesign
- ``2stacks``
- ``hispanico``
- ``atb00ker``
- ``cappe87``
- ``nemesisdesign``

How can I apply as mentor?
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion developer/google-summer-of-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Here's a few quick tricks you can use to become a star in our community:
idea about how to improve it, **please let us know!**
- start using OpenWISP 2: install it, run it, play with it; understand its
structure
- start contributing (eg: fix easy bugs, write documentation, improve
- start contributing (e.g.: fix easy bugs, write documentation, improve
tests); look for open issues in our most used repositories on
`github.com/openwisp <https://github.com/openwisp>`_ (ask in our support
channels before starting to code please! we have many legacy
Expand Down
Loading