From 4a0dfd28905e02ce623372b4a98405381f6cc741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=B5=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=20=D0=9E=D0=BB=D1=8C=D0=B3=D0=B0?= Date: Sat, 27 Mar 2021 14:12:44 +0300 Subject: [PATCH] Add spelling version --- docs/Makefile | 15 +++++++++++---- docs/source/conf.py | 19 +++++++++++++++++-- docs/source/overview.rst | 3 +-- docs/source/spelling_wordlist.txt | 0 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 docs/source/spelling_wordlist.txt diff --git a/docs/Makefile b/docs/Makefile index e2faff5..827600b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,14 +3,17 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build +ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +SPHINXOPTS = +SPHINXBUILD = sphinx-build SOURCEDIR = source BUILDDIR = build + # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @echo " spelling to check for typos in documentation" .PHONY: help Makefile @@ -19,6 +22,10 @@ help: %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + spelling: - $(SPHINXBUILD) -b spelling -W $(ALLSPHINXOPTS) $(BUILDDIR)/spelling -# $(SPHINXBUILD) -b spelling 'docs/source' 'docs/build' + $(SPHINXBUILD) -b spelling -W $(SOURCEDIR) $(BUILDDIR)/spelling + @echo + @echo "Check finished. Wrong words can be found in " \ + "build/spelling/output.txt." + diff --git a/docs/source/conf.py b/docs/source/conf.py index 972970b..c963176 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,6 +15,7 @@ import sys import importlib import inspect import enchant +from enchant import checker sys.path.insert(0, os.path.abspath('../../')) @@ -114,12 +115,24 @@ def skip_queryset(app, what, name, obj, skip, options): return True return skip +# def process_signature(app): +# if app != 'module': +# return lines +# from enchant.checker import SpellChecker +# for line in lines: +# chkr = SpellChecker("ru_RU", line) +# for err in chkr: +# print(err) +# print('cheked') + def setup(app): # Register the docstring processor with sphinx app.connect('autodoc-process-docstring', process_django_models) app.connect('autodoc-skip-member', skip_queryset) app.connect('autodoc-process-docstring', process_modules) + # process_signature(app) + print('app') @@ -183,10 +196,12 @@ intersphinx_mapping = { autodoc_default_flags = ['members'] # spell checking -print(enchant.list_languages()) + + + spelling_lang = 'ru_RU' tokenizer_lang = 'ru_RU' -spelling_word_list_filename = ['spelling_wordlist.txt', 'another_list.txt'] +spelling_word_list_filename = ['spelling_wordlist', None] spelling_exclude_patterns=['ignored_*'] spelling_show_suggestions = True spelling_show_whole_line=True diff --git a/docs/source/overview.rst b/docs/source/overview.rst index 731da94..84766d5 100644 --- a/docs/source/overview.rst +++ b/docs/source/overview.rst @@ -30,8 +30,7 @@ **После авторизации пользователь может выбрать из следующих разделов меню:** * **"Профиль"** - просмотреть свои данные и запросить права доступа -* **"Запрос прав"** - получение прав для работы с тикетами или -**"Управление"** - доступно для администратора и предоставляет возможность группового назначения ролей пользователям +* **"Запрос прав"** - получение прав для работы с тикетами или **"Управление"** - доступно для администратора и предоставляет возможность группового назначения ролей пользователям .. image:: _static/main_logined_agent.png diff --git a/docs/source/spelling_wordlist.txt b/docs/source/spelling_wordlist.txt new file mode 100644 index 0000000..e69de29