Skip to content

Instantly share code, notes, and snippets.

@vvakame

vvakame/next.sh Secret

Last active August 22, 2017 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvakame/ffe3c55b58032d63e68090bac1474a6c to your computer and use it in GitHub Desktop.
Save vvakame/ffe3c55b58032d63e68090bac1474a6c to your computer and use it in GitHub Desktop.
prhをasciinemaでデモするためのスクリプト
#! /bin/bash -eu
case "$1" in
"1" ) echo "校正支援ツール prh のデモ http://npmjs.com/package/prh" ;;
"2" ) echo "実戦的な校正環境を作ります" ;;
"3" ) echo "校正ルールにひっかかる項目をリストアップする" ;;
"4" ) echo "prh:disableプラグマで段落ごとに警告を抑制することができる" ;;
"5" ) echo "unified diff形式で校正差分を出力する" ;;
"6" ) echo "標準出力に校正後のテキストを出力する" ;;
"7" ) echo "ファイルの内容を直接書き換える" ;;
"8" ) echo "変更差分の有無をexit codeで表現する" ;;
"end" ) echo "続きはWebで! https://www.npmjs.com/package/prh VSCodeの拡張とかもあるよ" ;;
esac

デモ手順

  1. git clone https://gist.github.com/ffe3c55b58032d63e68090bac1474a6c.git prh-demo-script
  2. cp prh-demo-script/* ./
  3. Ctrl + L で画面クリア
  4. asciinema rec
  5. ./next.sh 1
  6. npm install -g prh
  7. prh --help
  8. mkdir prh-demo
  9. cd prh-demo
  10. git init
  11. ../next.sh 2
  12. prh init
  13. git submodule add https://github.com/prh/rules.git prh-rules
  14. vi prh.yml で imports のコメントアウト外して、下部全部削る
  15. ../next.sh 3
  16. cp ../target.md ./
  17. cat target.md
  18. prh target.md
  19. ../next.sh 4
  20. vi target.md prh:disable を追加する
  21. prh target.md
  22. ../next.sh 5
  23. prh --diff target.md | colordiff
  24. ../next.sh 6
  25. prh --stdout target.md
  26. ../next.sh 7
  27. prh --replace target.md
  28. ../next.sh 8
  29. prh --verify target.md
  30. echo $?
  31. ../next.sh end

prhで校正作業を楽しよう!

てっくぶーすたーが今までの同人誌作成で培ってきた様々なノウハウを利用しよう! 良い文章を書いても読みにくいともったいないです。

校正作業は根気のいる作業で、漢字の閉じや開き、文言の統一、誤字の発見を人力でやるのは大変です。 prhと校正ルールを活用しましょう。

以下にあげるような、プログラムのコードブロックにも対応しています。

console.log("Hello prh!");

悪い文を徐々に良い文に育てていきましょう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment