Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save monsat/1999398 to your computer and use it in GitHub Desktop.
Save monsat/1999398 to your computer and use it in GitHub Desktop.
Changes style of Gist's syntax highlight to paste into some presentation tools like Keynote.
// ==UserScript==
// @name code_highlighter_for_gist.user.js
// @namespace http://www.direct-serarch.jp/
// @description Changes style of Gist's syntax highlight
// @include https://gist.github.com/*
// ==/UserScript==
// forked from https://gist.github.com/1254056
(function () {
var styles = {
// className: 'css',
a: 'color: rgb(200, 200, 200);',
o: 'color: rgb(200, 200, 200);',
p: 'color: rgb(255, 255, 255);',
k: 'color: rgb(222, 49, 103);',
n: 'color: rgb(155, 41, 36);',
x: 'color: rgb(255, 255, 255);',
err: 'color: rgb(233, 180, 200); background: none;',
gd: 'color: rgb(255, 0, 0); background: none;',
gi: 'color: rgb(0, 168, 0); background: none;',
nc: 'color: rgb(168, 247, 141);',
nf: 'color: rgb(233, 180, 200);',
nv: 'color: rgb(109, 184, 255);',
nx: 'color: rgb(229, 133, 38);',
na: 'color: rgb( 66, 255, 135);',
nb: 'color: rgb( 66, 255, 135);',
kc: 'color: rgb(222, 49, 103);',
kd: 'color: rgb(163, 216, 121);',
kp: 'color: rgb(252, 241, 141);',
sd: 'color: rgb(202, 248, 180);',
s1: 'color: rgb(250, 208, 100);',
highlight: 'background: rgb(0, 0, 0); color: rgb(255, 255, 255)',
};
for (var key in styles) {
var elements = document.getElementsByClassName(key);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('style', styles[key]);
}
}
})();
@monsat
Copy link
Author

monsat commented Mar 9, 2012

Install for your Google Chrome

  • Click [raw] link of the code.
  • Reload this page to check it.

@monsat
Copy link
Author

monsat commented Oct 2, 2012

インストール方法が変わってしまったみたいです
http://support.google.com/chrome_webstore/bin/answer.py?hl=ja&answer=2664769&p=crx_warning

他のウェブサイトから拡張機能を追加する手順

信頼できるウェブサイトからのみ拡張機能を追加することをおすすめします。Chrome に他のウェブサイトの拡張機能を追加する手順は次のとおりです:

そのウェブサイトから拡張機能ファイルをダウンロードし、パソコンに保存します。
ブラウザのツールバーにあるレンチ アイコンをクリックします。
[ツール] > [拡張機能] を選択します。
パソコンに保存した拡張機能ファイルを探し、[拡張機能] ページにファイルをドラッグします。
表示されるダイアログで、拡張機能への許可のリストを確認します。インストールする場合は、[インストール] をクリックします。

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