2010年6月5日土曜日

Bloggerでソースコードをハイライトする。

Blogger でソースコードに色付けをする - google-code-prettify つぶやく4

http://jutememo.blogspot.com/2008/01/blogger.html



Google Code PrettifyはJavaScript/CSS製のオープンソース・ソフトウェア
Google Codeで使われているソースコードハイライタ「Google Code Prettify」



google-code-prettify - Project Hosting on Google Code
http://code.google.com/p/google-code-prettify/







内に追加







タグを、と変更します。
基本的にはソースコードを
でくくればOKです。

...
or ...




The lang-* class specifies the language file extensions. 
File extensions supported by default include 
"bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", 
"java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", 
"xhtml", "xml", "xsl". 
行No追加
1: /* This is line 1 of my code
2: * and here's line 2 */
3: print("I'm line number 3");
produces ---------------------------------------- README.htmlより。 ●Which languages does it work for? The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages. LISPy languages are supported via an extension: lang-lisp.js. And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText.. If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase. issue 他のコードをハイライトするためのjs? http://code.google.com/p/google-code-prettify/issues/list ---------------------------------------- ms dosコマンドはどうなるのか? msdosは非対応。

0 件のコメント:

コメントを投稿