Skip to content

Instantly share code, notes, and snippets.

@UskeS
Created August 23, 2018 09:22
Embed
What would you like to do?
[clipMenu] GitHubのCopy pathボタンから得られたパスをブログ用gist-itパスに変換
/**
* 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