Giter Club home page Giter Club logo

togglate's People

Contributors

hanachin avatar melborne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

hanachin gosyujin

togglate's Issues

sequential liquid tags blocks handling

Sequential liquid tag blocks, like following, have not wrapped correctly.

{% highlight ruby %}
{% raw %}{% include sig.md %}{% endraw %}
{% endhighlight %}

原文との比較を行う方法

ローカルにcloneした文書(Togglateで原文コメントアウト済、翻訳文章追加済)と、特定リビジョンの原文を比較し、
原文に差異がないか確認するコマンドが欲しいので作成してみました。

gosyujin@8d66b93

大まかな動作としては、

  1. git remote add togglate で原文取得用のリモートリポジトリをGitに登録する
  2. togglate diff コマンドに 比較したいファイル 特定のリビジョン を渡す
    1. ローカルの 比較したいファイルtogglate commentout で原文だけにする
    2. リモートリポジトリ togglate から 特定のリビジョン比較したいファイル を取得してくる
    3. i. ii. のファイルのdiffを取る

こんな感じになります。(Jekyllの原文ドキュメントに対してdiffをとる)
翻訳したリビジョンを対象とする場合。

$ git remote -v
(略)
togglate    https://github.com/jekyll/jekyll.git (push)
$ bundle exec togglate diff docs/configuration.md --revision 5daf987 --difference site
Local doc: docs/configuration.md
Original doc url: https://raw.githubusercontent.com/jekyll/jekyll/5daf987/site/docs/configuration.md
 GitHub user: jekyll
 GitHub repository: jekyll
 Revision: 5daf987
Diff result: OK

時間がたち、原文のリポジトリの master がかなり進んでNGとなる場合。

$ bundle exec togglate diff docs/configuration.md --revision master --difference site
Local doc: docs/configuration.md
Original doc url: https://raw.githubusercontent.com/jekyll/jekyll/master/site/docs/configuration.md
 GitHub user: jekyll
 GitHub repository: jekyll
 Revision: master
--- docs/configuration.md_togglate_local    2014-04-28 01:29:52.138137854 +0900
+++ docs/configuration.md_togglate_original 2014-04-28 01:29:52.240138863 +0900
(略)
 markdown:      kramdown
-markdown_ext:  markdown,mkd,mkdn,md
+markdown_ext:  markdown,mkdown,mkdn,mkd,md
 textile_ext:   textile

 excerpt_separator: "\n\n"
Diff result: NG

良い案が思いつかなかったため diff という一般的すぎるコマンドで拡張してしまいましたが、
commentout コマンドの拡張とすべきとか
別のレイヤーでやるべき(元々は Rake で作っていました)とか
意見いただけたらと思います。
(ソース自体はもうちょっと整理しようと思っています)

Javascriptを埋め込まないオプション

togglate create のオプションとして、

1. 原文をHTMLのコメントタグ <!--original --!> で囲む
2. トグル用のJavascriptを埋め込まない

モードがあるといいな、と思いました(コメントモードの意で -c 、もしくはプレーンモードの意で -p とか)。

背景

自分が取り組んでいる Pro Git の翻訳では、

1. 原文をコードブロックで囲む
2. 本文にない Javascript コードを訳文に埋め込む

のいずれも受け入れられないはずです。本家サイト公開用に変換するHTMLに、望まない影響が出るためです。Sinatra のドキュメントも同様かと思いますがいかがでしょうか…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.