forked from webdoky/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check of markdown, readme, rich customization (webdoky#14)
Co-authored-by: Vitalii Perehonchuk <[email protected]> Actually done by Vitalii Perehonchuk
- Loading branch information
Showing
14 changed files
with
147 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,39 @@ | ||
//TODO | ||
# WebDoky - контент | ||
|
||
## LanguageTool перевірка | ||
|
||
У репозиторій вбудована перевірка тексту (в форматі HTML або Markdown) в репозиторії за допомогою докеризованого LanguageTool. Наразі працює лише на Unix-подібних ОС [https://github.com/webdoky/content/issues/12] | ||
|
||
### Передумови | ||
1. [Docker](https://www.docker.com/) | ||
2. [Node.js](https://nodejs.org/uk/) >= 14 | ||
3. [Yarn](https://yarnpkg.com/) | ||
|
||
### Налаштування | ||
Команда `yarn` у директорії проєкту встановить JavaScript-залежності та підготує Docker-образ. | ||
|
||
### Використання | ||
Запуск команди `yarn run check` у директорії проєкту: | ||
1. Запустить Docker-контейнер із LanguageTool. | ||
2. Дочекається доступності LanguageTool. | ||
3. Перевірить наявні файли перекладу у форматах HTML та Markdown. | ||
4. Виведе результати перевірки у консоль. | ||
5. Зупинить Docker-контейнер із LanguageTool. | ||
6. Завершиться із кодом виходу 0 у випадку успіху, інакше - 1. | ||
|
||
Також команда приймає шлях до певного файлу у вигляді аргументу командного рядка. Наприклад: | ||
``` | ||
yarn run check README.md | ||
``` | ||
|
||
### Винятки | ||
Щоб додати слово незнайоме LanguageTool, але котре LanguageTool мусить використовувати для створення пропозицій виправлень - додайте його окремим рядком у файл `uk_spelling_additions.txt`. | ||
|
||
Щоб додати слово незнайоме LanguageTool, котре слід просто ігнорувати - додайте його окремим рядком у файл `uk_ignore_additions.txt` (у більшості випадків слід віддавати перевагу `uk_spelling_additions.txt`). | ||
|
||
Щоб заборонити слово, котре LanguageTool обробляє як нормативне - додайте його окремим рядком у файл `uk_prohibited_additions.txt`. | ||
|
||
Щоб зміни у вищеназваних текстових файлах почали діяти, слід запустити команду `yarn rebuild`. | ||
|
||
### Вимкнення правила | ||
Щоб вимкнути певне правило LanguageTool - додайте його окремим рядком у файл `disabled_rules.txt`. Така зміна не вимагає повторного збирання Docker-образу. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
UK_SIMPLE_REPLACE_SOFT | ||
WHITESPACE_RULE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import fs from "fs"; | ||
|
||
const disabledRules = fs | ||
.readFileSync("disabled_rules.txt", { encoding: "utf8", flag: "r" }) | ||
.split("\n"); | ||
|
||
export default disabledRules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
фронтенд | ||
фронтенд | ||
докеризованого | ||
Unix-подібних | ||
веб-API | ||
повностекові |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,11 @@ ansi-styles@^4.1.0: | |
dependencies: | ||
color-convert "^2.0.1" | ||
|
||
argparse@^2.0.1: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" | ||
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== | ||
|
||
[email protected]: | ||
version "0.21.1" | ||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" | ||
|
@@ -112,6 +117,11 @@ entities@^2.0.0: | |
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" | ||
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== | ||
|
||
entities@~2.1.0: | ||
version "2.1.0" | ||
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" | ||
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== | ||
|
||
follow-redirects@^1.10.0: | ||
version "1.14.1" | ||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" | ||
|
@@ -179,6 +189,29 @@ inherits@2: | |
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" | ||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | ||
|
||
linkify-it@^3.0.1: | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" | ||
integrity sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ== | ||
dependencies: | ||
uc.micro "^1.0.1" | ||
|
||
markdown-it@~12.2.0: | ||
version "12.2.0" | ||
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.2.0.tgz#091f720fd5db206f80de7a8d1f1a7035fd0d38db" | ||
integrity sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg== | ||
dependencies: | ||
argparse "^2.0.1" | ||
entities "~2.1.0" | ||
linkify-it "^3.0.1" | ||
mdurl "^1.0.1" | ||
uc.micro "^1.0.5" | ||
|
||
mdurl@^1.0.1: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" | ||
integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= | ||
|
||
minimatch@^3.0.4: | ||
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" | ||
|
@@ -258,6 +291,11 @@ supports-color@^7.1.0: | |
dependencies: | ||
has-flag "^4.0.0" | ||
|
||
uc.micro@^1.0.1, uc.micro@^1.0.5: | ||
version "1.0.6" | ||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" | ||
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== | ||
|
||
wrappy@1: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" | ||
|