Closed gosyujin closed 10 years ago
togglateに対する提案ありがとうございます!Github上で翻訳をする上で、あったらかなり便利そうですね。
問題はtogglate側で何処までの機能を担うのがいいのかという議論があると思います。2つあると思います。
1についてはcommentout
コマンドを実装するときにも考えたのですが、そのときの自分の答えとしては「togglateは最小の機能を保ってdiffのことはdiffでやるべき」でした。これはtogglate側でdiffのすべてのオプションを持つのは現実的でないし、別実装のdiff(colordiffとか)を使いたいユーザもいると思ったからです。
@gosyujin さんからの提案を頂いて、便利そうと思う一方でdiffの取り込みに躊躇しているくらいなので、さらに2の機能を含んでいるものをtogglateに取り込むのはちょっと難しいかな、というのが率直な意見です。
ですので、折角のユニークな提案を頂けて喜んでいるのですが、現状のtogglateの方向性としては別レイヤーのほうが収まりがいいと考えています。
ありがとうございます。 やっぱりTogglateに役割を持たせすぎですよね :cry:
現状やりたいこととしては既に Rake
でできているので特に問題ないのですが、
(Rakefile の中での Togglate の役割は togglate commentout
でローカルにある文書のピックアップに使うものとしている)
もっと汎用化して組み込めないかなーと思った次第です。
issueとしてはcloseしておきます。
折角のいい提案すいません :disappointed:
ローカルにcloneした文書(Togglateで原文コメントアウト済、翻訳文章追加済)と、特定リビジョンの原文を比較し、 原文に差異がないか確認するコマンドが欲しいので作成してみました。
https://github.com/gosyujin/togglate/commit/8d66b935e496d0fd032e1fd015781926bc5dfe84
大まかな動作としては、
git remote add togglate
で原文取得用のリモートリポジトリをGitに登録するtogglate diff
コマンドに比較したいファイル
特定のリビジョン
を渡す比較したいファイル
をtogglate commentout
で原文だけにするtogglate
から特定のリビジョン
の比較したいファイル
を取得してくるこんな感じになります。(Jekyllの原文ドキュメントに対してdiffをとる) 翻訳したリビジョンを対象とする場合。
時間がたち、原文のリポジトリの
master
がかなり進んでNGとなる場合。良い案が思いつかなかったため
diff
という一般的すぎるコマンドで拡張してしまいましたが、commentout
コマンドの拡張とすべきとか 別のレイヤーでやるべき(元々はRake
で作っていました)とか 意見いただけたらと思います。 (ソース自体はもうちょっと整理しようと思っています)