Syntax Colouring

Add some default CSS support for syntax colouring of code blocks.

Try:

	require 'chunks/chunk'
{:lang=ruby html_use_syntax=true}

or

        <div xhtml:class='foo' width='4'>bar<!-- fubar --></div>
{:lang=html html_use_syntax=true}

(Suggested by Casper Gripenberg)
This commit is contained in:
Jacques Distler 2009-07-06 11:07:57 -05:00
parent 7f2e883e12
commit 573af987bc
2 changed files with 55 additions and 0 deletions

View file

@ -40,3 +40,31 @@ span.theorem_label {font-style:normal; font-weight:bold;}
content: " " counter(remark); counter-increment: remark;}
.num_note .theorem_label:after {
content: " " counter(note); counter-increment: note;}
code.ruby .normal {}
code.ruby span.attribute { color: #090; }
code.ruby span.char { color: #F00; }
code.ruby span.class { color: #A020F0; font-weight: bold; }
code.ruby span.comment { color: #00F; }
code.ruby span.constant { color: #008B8B; }
code.ruby span.escape { color: #6A5ACD; }
code.ruby span.expr { color: #22C; }
code.ruby span.global { color: #1A4; }
code.ruby span.ident { color: #004; }
code.ruby span.keyword { color: #A52A2A; font-weight: bold; }
code.ruby span.method { color: #008B8B; }
code.ruby span.module { color: #A020F0; font-weight: bold; }
code.ruby span.number { color: #D0D; }
code.ruby span.punct { color: #6A5ACD; }
code.ruby span.regex { color: #D0D; }
code.ruby span.string { color: #D0D; }
code.ruby span.symbol { color: #008B8B; }
code.xml .normal {}
code.xml .namespace { color: #D66; font-weight: bold; }
code.xml .tag { color: #F55; }
code.xml .comment { color: #070; font-style: italic; }
code.xml .punct { color: #449; font-weight: bold; }
code.xml .string { color: #949; }
code.xml .number { color: #F99; }
code.xml .attribute { color: #771; }

View file

@ -448,3 +448,30 @@ span.theorem_label {font-style:normal; font-weight:bold;}
.num_note .theorem_label:after {
content: " " counter(note); counter-increment: note;}
code.ruby .normal {}
code.ruby span.attribute { color: #090; }
code.ruby span.char { color: #F00; }
code.ruby span.class { color: #A020F0; font-weight: bold; }
code.ruby span.comment { color: #00F; }
code.ruby span.constant { color: #008B8B; }
code.ruby span.escape { color: #6A5ACD; }
code.ruby span.expr { color: #22C; }
code.ruby span.global { color: #1A4; }
code.ruby span.ident { color: #004; }
code.ruby span.keyword { color: #A52A2A; font-weight: bold; }
code.ruby span.method { color: #008B8B; }
code.ruby span.module { color: #A020F0; font-weight: bold; }
code.ruby span.number { color: #D0D; }
code.ruby span.punct { color: #6A5ACD; }
code.ruby span.regex { color: #D0D; }
code.ruby span.string { color: #D0D; }
code.ruby span.symbol { color: #008B8B; }
code.xml .normal {}
code.xml .namespace { color: #D66; font-weight: bold; }
code.xml .tag { color: #F55; }
code.xml .comment { color: #070; font-style: italic; }
code.xml .punct { color: #449; font-weight: bold; }
code.xml .string { color: #949; }
code.xml .number { color: #F99; }
code.xml .attribute { color: #771; }