textlint

ルールの追加

quantopian-doc.yml に追記します。

<例>

version: 1
rules:
  - pattern: 取引アルゴリズム
    expected: トレーディングアルゴリズム

インストール

Docker(後述)から実行する場合は不要です。

npm install --save-dev \
textlint \
textlint-rule-preset-ja-technical-writing \
textlint-rule-preset-jtf-style \
textlint-rule-prh \
textlint-plugin-rst

pip install docutils-ast-writer

実行

.rstファイルの場合

textlint <path_to_rst>

.ipynbファイルの場合

jupyter nbconvert <path_to_ipynb> \
  --to rst --stdout \
  --TemplateExporter.exclude_code_cell=True | \
  textlint --stdin

Dockerから実行する場合 textlint コマンドのpathの先頭に /work をつけます

docker run --rm -v $PWD:/work driller/textlint-rst textlint /work/<path_to_rst>