[clipMenu] GitHubのCopy pathボタンから得られたパスをブログ用gist-itパスに変換
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
/** | |
* ClipMenu用スクリプト | |
* gist-itのパス表現はここを参照した | |
* http://ryoichi0102.hatenablog.com/entry/2015/11/13/091803 | |
* 適当に書き換えて使ってください | |
*/ | |
clipText = clipText.trim(); | |
var myPath = clipText.split("/"); | |
var txt = '<script src="http://gist-it.appspot.com/http://github.com/[user]/'; //[user]の部分がユーザー名 | |
txt += myPath.shift(); | |
txt += "/blob/master/"; | |
txt += myPath.join("/") + '"></script>'; | |
return txt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment