ulmul 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/README-en +118 -63
  2. data/README-ja +92 -58
  3. data/Rakefile +26 -10
  4. data/bin/ulmul2html5 +7 -58
  5. data/bin/ulmul2latex +34 -0
  6. data/bin/ulmul2xhtml +6 -58
  7. data/google-code-prettify/CHANGES.html +130 -0
  8. data/google-code-prettify/COPYING +202 -0
  9. data/google-code-prettify/README-zh-Hans.html +143 -0
  10. data/google-code-prettify/README.html +203 -0
  11. data/google-code-prettify/src/lang-apollo.js +51 -0
  12. data/google-code-prettify/src/lang-css.js +78 -0
  13. data/google-code-prettify/src/lang-fortran.js +53 -0
  14. data/google-code-prettify/src/lang-hs.js +101 -0
  15. data/google-code-prettify/src/lang-lisp.js +93 -0
  16. data/google-code-prettify/src/lang-lua.js +59 -0
  17. data/google-code-prettify/src/lang-ml.js +56 -0
  18. data/google-code-prettify/src/lang-proto.js +35 -0
  19. data/google-code-prettify/src/lang-scala.js +54 -0
  20. data/google-code-prettify/src/lang-sql.js +57 -0
  21. data/google-code-prettify/src/lang-vb.js +61 -0
  22. data/google-code-prettify/src/lang-vhdl.js +34 -0
  23. data/google-code-prettify/src/lang-wiki.js +53 -0
  24. data/google-code-prettify/src/lang-yaml.js +27 -0
  25. data/google-code-prettify/src/prettify.css +44 -0
  26. data/google-code-prettify/src/prettify.js +1508 -0
  27. data/google-code-prettify/tests/large_input_test.html +122 -0
  28. data/google-code-prettify/tests/prettify_test.html +2772 -0
  29. data/google-code-prettify/tests/test_base.js +132 -0
  30. data/google-code-prettify/tests/test_styles.css +5 -0
  31. data/hello.c +7 -0
  32. data/index.en.html +221 -120
  33. data/index.ja.html +182 -115
  34. data/lib/ulmul.rb +477 -276
  35. data/test/unit/ulmul_test.rb +21 -0
  36. data/ulmul-slidy.css +21 -8
  37. data/ulmul.gemspec +9 -5
  38. data/ulmul2html5.css +19 -5
  39. data/ulmul2xhtml.css +17 -1
  40. metadata +90 -12
  41. data/tests/ulmul_test.rb +0 -14
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env rake
2
2
  # -*-Ruby-*-
3
- # Time-stamp: <2010-05-26 17:48:08 takeshi>
3
+ # Time-stamp: <2011-04-02 19:31:51 takeshi>
4
4
  # Author: Takeshi Nishimatsu
5
5
  ##
6
6
  $LOAD_PATH.unshift('lib')
@@ -33,7 +33,8 @@ task :default => [ :test ]
33
33
  desc "Run the unit and functional tests"
34
34
  task :test
35
35
  Rake::TestTask.new do |t|
36
- t.test_files = FileList['tests/*.rb']
36
+ t.libs << 'lib' << 'test'
37
+ t.pattern = 'test/**/*_test.rb'
37
38
  t.verbose = true
38
39
  end
39
40
 
@@ -59,18 +60,33 @@ task :rubyforge => ["index.en.html",
59
60
  sh "scp dot.htaccess t-nissie@rubyforge.org:/var/www/gforge-projects/ulmul/.htaccess"
60
61
  end
61
62
 
62
- desc "Create presentation.en.xhtml from README-en"
63
- file "presentation.en.xhtml" => ["bin/ulmul2xhtml", "ulmul-slidy.css", "README-en",
64
- "ulmul-slidy.js", "lib/ulmul.rb"] do |t|
65
- sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -s #{t.prerequisites[1]} -j #{t.prerequisites[3]} -l en #{t.prerequisites[2]} > #{t.name}"
63
+ desc "Create presentation.en.html from README-en"
64
+ file "presentation.en.html" => ["bin/ulmul2html5", "README-en", "ulmul-slidy.css", "google-code-prettify/src/prettify.css",
65
+ "google-code-prettify/src/prettify.js", "ulmul-slidy.js", "lib/ulmul.rb"] do |t|
66
+ sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -s #{t.prerequisites[2]} -s #{t.prerequisites[3]} \
67
+ -j #{t.prerequisites[4]} -j #{t.prerequisites[5]} -m 2 -l en #{t.prerequisites[1]} > #{t.name}"
66
68
  end
67
69
 
68
70
  desc "Create index.en.html"
69
- file "index.en.html" => ["bin/ulmul2xhtml", "ulmul2xhtml.css", "README-en", "lib/ulmul.rb"] do |t|
70
- sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -l en #{t.prerequisites[2]} | sed -e 's%</h1>%</h1><div class=\"navi\">[<a href=\"index.en.html\">English</a>/<a href=\"index.ja.html\">Japanese</a>]</div>%' > #{t.name}"
71
+ file "index.en.html" => ["bin/ulmul2html5", "README-en", "ulmul2html5.css", "google-code-prettify/src/prettify.css",
72
+ "google-code-prettify/src/prettify.js", "lib/ulmul.rb"] do |t|
73
+ sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -s #{t.prerequisites[2]} -s #{t.prerequisites[3]} \
74
+ -j #{t.prerequisites[4]} -l en #{t.prerequisites[1]} | \
75
+ sed -e 's%</h1>%</h1><div class=\"navi\">[<a href=\"index.en.html\">English</a>/<a href=\"index.ja.html\">Japanese</a>]</div>%' > #{t.name}"
71
76
  end
72
77
 
73
78
  desc "Create index.ja.html"
74
- file "index.ja.html" => ["bin/ulmul2xhtml", "ulmul2xhtml.css", "README-ja", "lib/ulmul.rb"] do |t|
75
- sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -l ja #{t.prerequisites[2]} | sed -e 's%</h1>%</h1><div class=\"navi\">[<a href=\"index.en.html\">English</a>/<a href=\"index.ja.html\">Japanese</a>]</div>%' > #{t.name}"
79
+ file "index.ja.html" => ["bin/ulmul2html5", "README-ja", "ulmul2html5.css", "google-code-prettify/src/prettify.css",
80
+ "google-code-prettify/src/prettify.js", "lib/ulmul.rb"] do |t|
81
+ sh "ruby -I lib #{t.prerequisites[0]} -n 'Takeshi Nishimatsu' -s #{t.prerequisites[2]} -s #{t.prerequisites[3]} \
82
+ -j #{t.prerequisites[4]} -l ja #{t.prerequisites[1]} | \
83
+ sed -e 's%</h1>%</h1><div class=\"navi\">[<a href=\"index.en.html\">English</a>/<a href=\"index.ja.html\">Japanese</a>]</div>%' > #{t.name}"
84
+ end
85
+
86
+ desc "Create README-en.tex"
87
+ file "README-en.tex" => ["bin/ulmul2latex", "README-en", "lib/ulmul.rb", "Rakefile"] do |t|
88
+ sh "ruby -I lib #{t.prerequisites[0]} #{t.prerequisites[1]} | sed -e 's/\(\$\)/(\\\\$)/' -e 's/#/\\\\#/' \
89
+ -e 's/subs_/subs\\\\_/' -e 's/eim_/eim\\\\_/' -e 's/math_/math\\\\_/' -e 's/ulmul_/ulmul\\\\_/' \
90
+ -e 's/t_nissie/t\\\\_nissie/' -e 's/\\\\Eq/\\\\\\\\Eq/' \
91
+ -e 's/\\\\Fig/\\\\\\\\Fig/' -e 's/\\\\Table/\\\\\\\\Table/' -e 's/\\\\Code/\\\\\\\\Code/' > #{t.name}"
76
92
  end
data/bin/ulmul2html5 CHANGED
@@ -1,70 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
  # ulmul2html5
3
- # Time-stamp: <2010-03-30 18:42:10 takeshi>
3
+ # Time-stamp: <2011-03-30 11:43:20 takeshi>
4
4
  # Author: Takeshi Nishimatsu
5
5
  ##
6
6
  =begin
7
- = ulmul2html
7
+ = ulmul2html5
8
8
  == Usage
9
9
  === Examples
10
- % ulmul2html foo.txt
11
- % ulmul2html --style=style.css --name="John Smith" foo.ulmul > foo.html
12
- % ulmul2html --style=ulmul-slidy.css --javascript=slidy.js \
10
+ $ ulmul2html5 --help
11
+ $ ulmul2html5 foo.txt
12
+ $ ulmul2html5 --style=style.css --name="John Smith" foo.ulmul > foo.html
13
+ $ ulmul2html5 --style=ulmul-slidy.css --javascript=ulmul-slidy.js \
13
14
  --name="Takeshi Nishimatsu" presentation.txt > presentation.xhtml
14
- === Command options
15
- ==== -s, --style
16
- Specify stylesheet filename.
17
- ==== -n, --name
18
- Specify your name for copyright notices.
19
- ==== -j, --javascript
20
- Specify JavaScript filename.
21
- ==== -l, --language
22
- Specify natural language. Its default is "en".
23
- ==== -c, --contents-range
24
- Range of "Contents". Its default is "2..3".
25
- If you do not need "Contents" at the beginning of the
26
- output HTML file, set it 3..2.
27
- ==== --help
28
- Show a help message.
29
15
  =end
30
16
  require "ulmul"
31
- require "optparse"
32
- name = ENV['USER'] || ENV['LOGNAME'] || Etc.getlogin || Etc.getpwuid.name
33
- language = "en"
34
- stylesheets = []
35
- javascripts = []
36
- contents_range = Ulmul::CONTENTS_RANGE_DEFAULT
37
- opts = OptionParser.new
38
- def opts.usage
39
- return to_s.sub(/options/,'options] [filename')
40
- end
41
- opts.on("-s STYLESHEET_FILENAME","--style STYLESHEET_FILENAME",
42
- "Specify stylesheet filename."){|v| stylesheets<<v}
43
- opts.on("-n YOUR_NAME","--name YOUR_NAME","Specify your name."){|v| name=v}
44
- opts.on("-j JAVASCRIPT_FILENAME","--javascript JAVASCRIPT_FILENAME",
45
- "Specify JavaScript filename."){|v| javascripts<<v}
46
- opts.on("-l LANGUAGE","--language LANGUAGE",String,
47
- "Specify natural language. Its defalt is 'en'."){|v| language=v[0..1].downcase}
48
- opts.on("-c CONTENTS_RANGE","--contents-range RANGE_OF_CONTENTS_RANGE","Range of Contents."){|v|
49
- begin
50
- if eval(v).instance_of?(Range)
51
- contents_range=eval(v)
52
- else
53
- raise NameError
54
- end
55
- rescue NameError
56
- raise("Cannot evaluate given \"#{v}\" as a Range")
57
- end
58
- }
59
- opts.on_tail("-h", "--help", "Show this message."){puts opts.usage; exit}
60
-
61
- opts.parse!(ARGV)
62
- stylesheets=['ulmul2html5.css'] if stylesheets==[]
63
-
64
- u=Ulmul.new(contents_range,'ulmul2html5')
65
- u.parse(ARGF)
66
- puts u.html(stylesheets,javascripts,name,language)
67
-
68
17
  # Local variables:
69
- # compile-command: "ruby -I ../lib ./ulmul2html ulmul2html"
18
+ # compile-command: "ruby -I ../lib ./ulmul2html5 ulmul2html5"
70
19
  # End:
data/bin/ulmul2latex ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ # ulmul2latex
3
+ # Time-stamp: <2011-03-28 19:47:33 takeshi>
4
+ # Author: Takeshi Nishimatsu
5
+ ##
6
+ require "ulmul"
7
+ name = ENV['USER'] || ENV['LOGNAME'] || Etc.getlogin || Etc.getpwuid.name
8
+ packages = []
9
+ $MAX_TABLE_OF_CONTENTS = 3
10
+ opts = OptionParser.new
11
+ opts.on("-p PACKAGE_FILENAME","--style PACKAGE_FILENAME","Specify package filename."){|v| stylesheets<<v}
12
+ opts.on("-n YOUR_NAME","--name YOUR_NAME","Specify your name."){|v| name=v}
13
+ opts.on("-m MAX_TABLE_OF_CONTENTS","--max-table-of-contents MAX_TABLE_OF_CONTENTS",Integer,
14
+ "Specify the maximum level for table of contents."){|v| $MAX_TABLE_OF_CONTENTS=v}
15
+ opts.on_tail("-h", "--help", "Show this message."){puts opts.to_s.sub(/options/,'options] [filename'); exit}
16
+ opts.parse!(ARGV)
17
+ stylesheets=['ulmul2html5.css'] if stylesheets==[]
18
+ Itemize::ITEMIZE_INITIATOR = '\begin{itemize}'
19
+ Itemize::ITEMIZE_TERMINATOR = '\end{itemize}'
20
+ Itemize::ITEM_INITIATOR = '\item '
21
+ Itemize::ITEM_TERMINATOR = ''
22
+ Ulmul::PARAGRAPH_INITIATOR = ''
23
+ Ulmul::PARAGRAPH_TERMINATOR = ''
24
+ Ulmul::VERBATIM_INITIATOR = '\begin{verbatim}'
25
+ Ulmul::VERBATIM_TERMINATOR = '\end{verbatim}'
26
+ class Ulmul
27
+ include LaTeX
28
+ end
29
+ u=Ulmul.new()
30
+ u.parse(ARGF)
31
+ puts u.file(packages,name)
32
+ # Local variables:
33
+ # compile-command: "ruby -I ../lib ulmul2latex ../lib/test.ulmul | tee test.tex && latex test.tex && dvipdfmx test.dvi"
34
+ # End:
data/bin/ulmul2xhtml CHANGED
@@ -1,70 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  # ulmul2xhtml
3
- # Time-stamp: <2010-03-30 18:29:39 takeshi>
3
+ # Time-stamp: <2011-03-31 19:29:32 takeshi>
4
4
  # Author: Takeshi Nishimatsu
5
5
  ##
6
6
  =begin
7
- = ulmul2html
7
+ = ulmul2xhtml
8
8
  == Usage
9
9
  === Examples
10
- % ulmul2html foo.txt
11
- % ulmul2html --style=style.css --name="John Smith" foo.ulmul > foo.html
12
- % ulmul2html --style=ulmul-slidy.css --javascript=slidy.js \
10
+ % ulmul2xhtml foo.txt
11
+ % ulmul2xhtml --style=style.css --name="John Smith" foo.ulmul > foo.html
12
+ % ulmul2xhtml --style=ulmul-slidy.css --javascript=ulmul-slidy.js \
13
13
  --name="Takeshi Nishimatsu" presentation.txt > presentation.xhtml
14
- === Command options
15
- ==== -s, --style
16
- Specify stylesheet filename.
17
- ==== -n, --name
18
- Specify your name for copyright notices.
19
- ==== -j, --javascript
20
- Specify JavaScript filename.
21
- ==== -l, --language
22
- Specify natural language. Its default is "en".
23
- ==== -c, --contents-range
24
- Range of "Contents". Its default is "2..3".
25
- If you do not need "Contents" at the beginning of the
26
- output HTML file, set it 3..2.
27
- ==== --help
28
- Show a help message.
29
14
  =end
30
15
  require "ulmul"
31
- require "optparse"
32
- name = ENV['USER'] || ENV['LOGNAME'] || Etc.getlogin || Etc.getpwuid.name
33
- language = "en"
34
- stylesheets = []
35
- javascripts = []
36
- contents_range = Ulmul::CONTENTS_RANGE_DEFAULT
37
- opts = OptionParser.new
38
- def opts.usage
39
- return to_s.sub(/options/,'options] [filename')
40
- end
41
- opts.on("-s STYLESHEET_FILENAME","--style STYLESHEET_FILENAME",
42
- "Specify stylesheet filename."){|v| stylesheets<<v}
43
- opts.on("-n YOUR_NAME","--name YOUR_NAME","Specify your name."){|v| name=v}
44
- opts.on("-j JAVASCRIPT_FILENAME","--javascript JAVASCRIPT_FILENAME",
45
- "Specify JavaScript filename."){|v| javascripts<<v}
46
- opts.on("-l LANGUAGE","--language LANGUAGE",String,
47
- "Specify natural language. Its defalt is 'en'."){|v| language=v[0..1].downcase}
48
- opts.on("-c CONTENTS_RANGE","--contents-range RANGE_OF_CONTENTS_RANGE","Range of Contents."){|v|
49
- begin
50
- if eval(v).instance_of?(Range)
51
- contents_range=eval(v)
52
- else
53
- raise NameError
54
- end
55
- rescue NameError
56
- raise("Cannot evaluate given \"#{v}\" as a Range")
57
- end
58
- }
59
- opts.on_tail("-h", "--help", "Show this message."){puts opts.usage; exit}
60
-
61
- opts.parse!(ARGV)
62
- stylesheets=['ulmul2xhtml.css'] if stylesheets==[]
63
-
64
- u=Ulmul.new(contents_range,'ulmul2xhtml')
65
- u.parse(ARGF)
66
- puts u.html(stylesheets,javascripts,name,language)
67
-
68
16
  # Local variables:
69
- # compile-command: "ruby -I ../lib ./ulmul2html ulmul2html"
17
+ # compile-command: "ruby -I ../lib ulmul2xhtml -s ../ulmul2xhtml.css -s ../google-code-prettify/src/prettify.css -j ../google-code-prettify/src/prettify.js ../lib/test.ulmul | tee test.html"
70
18
  # End:
@@ -0,0 +1,130 @@
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
+ <title>Change Log</title>
5
+ </head>
6
+ <body bgcolor="white">
7
+ <a style="float:right" href="README.html">README</a>
8
+
9
+ <h1>Known Issues</h1>
10
+ <ul>
11
+ <li>Perl formatting is really crappy. Partly because the author is lazy and
12
+ partly because Perl is
13
+ <a href="http://www.perlmonks.org/?node_id=663393">hard</a> to parse.
14
+ <li>On some browsers, <code>&lt;code&gt;</code> elements with newlines in the text
15
+ which use CSS to specify <code>white-space:pre</code> will have the newlines
16
+ improperly stripped if the element is not attached to the document at the time
17
+ the stripping is done. Also, on IE 6, all newlines will be stripped from
18
+ <code>&lt;code&gt;</code> elements because of the way IE6 produces
19
+ <code>innerHTML</code>. Workaround: use <code>&lt;pre&gt;</code> for code with
20
+ newlines.
21
+ </ul>
22
+
23
+ <h1>Change Log</h1>
24
+ <h2>29 March 2007</h2>
25
+ <ul>
26
+ <li>Added <a href="tests/prettify_test.html#PHP">tests</a> for PHP support
27
+ to address
28
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=3"
29
+ >issue 3</a>.
30
+ <li>Fixed
31
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=6"
32
+ >bug</a>: <code>prettyPrintOne</code> was not halting. This was not
33
+ reachable through the normal entry point.
34
+ <li>Fixed
35
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
36
+ >bug</a>: recursing into a script block or PHP tag that was not properly
37
+ closed would not silently drop the content.
38
+ (<a href="tests/prettify_test.html#issue4">test</a>)
39
+ <li>Fixed
40
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=8"
41
+ >bug</a>: was eating tabs
42
+ (<a href="tests/prettify_test.html#issue8">test</a>)
43
+ <li>Fixed entity handling so that the caveat
44
+ <blockquote>
45
+ <p>Caveats: please properly escape less-thans. <tt>x&amp;lt;y</tt>
46
+ instead of <tt>x&lt;y</tt>, and use <tt>&quot;</tt> instead of
47
+ <tt>&amp;quot;</tt> for string delimiters.</p>
48
+ </blockquote>
49
+ is no longer applicable.
50
+ <li>Added noisefree's C#
51
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=4"
52
+ >patch</a>
53
+ <li>Added a <a href="http://google-code-prettify.googlecode.com/files/prettify-small.zip">distribution</a> that has comments and
54
+ whitespace removed to reduce download size from 45.5kB to 12.8kB.
55
+ </ul>
56
+ <h2>4 Jul 2008</h2>
57
+ <ul>
58
+ <li>Added <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=17">language specific formatters</a> that are triggered by the presence
59
+ of a <code>lang-&lt;language-file-extension&gt;</code></li>
60
+ <li>Fixed <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=29">bug</a>: python handling of <code>'''string'''</code>
61
+ <li>Fixed bug: <code>/</code> in regex <code>[charsets] should not end regex</code>
62
+ </ul>
63
+ <h2>5 Jul 2008</h2>
64
+ <ul>
65
+ <li>Defined language extensions for Lisp and Lua</code>
66
+ </ul>
67
+ <h2>14 Jul 2008</h2>
68
+ <ul>
69
+ <li>Language handlers for F#, OCAML, SQL</code>
70
+ <li>Support for <code>nocode</code> spans to allow embedding of line
71
+ numbers and code annotations which should not be styled or otherwise
72
+ affect the tokenization of prettified code.
73
+ See the issue 22
74
+ <a href="tests/prettify_test.html#issue22">testcase</a>.</code>
75
+ </ul>
76
+ <h2>6 Jan 2009</h2>
77
+ <ul>
78
+ <li>Language handlers for Visual Basic, Haskell, CSS, and WikiText</li>
79
+ <li>Added <tt>.mxml</tt> extension to the markup style handler for
80
+ Flex <a href="http://en.wikipedia.org/wiki/MXML">MXML files</a>. See
81
+ <a
82
+ href="http://code.google.com/p/google-code-prettify/issues/detail?id=37"
83
+ >issue 37</a>.
84
+ <li>Added <tt>.m</tt> extension to the C style handler so that Objective
85
+ C source files properly highlight. See
86
+ <a
87
+ href="http://code.google.com/p/google-code-prettify/issues/detail?id=58"
88
+ >issue 58</a>.
89
+ <li>Changed HTML lexer to use the same embedded source mechanism as the
90
+ wiki language handler, and changed to use the registered
91
+ CSS handler for STYLE element content.
92
+ </ul>
93
+ <h2>21 May 2009</h2>
94
+ <ul>
95
+ <li>Rewrote to improve performance on large files.
96
+ See <a href="http://mikesamuel.blogspot.com/2009/05/efficient-parsing-in-javascript.html">benchmarks</a>.</li>
97
+ <li>Fixed bugs with highlighting of Haskell line comments, Lisp
98
+ number literals, Lua strings, C preprocessor directives,
99
+ newlines in Wiki code on Windows, and newlines in IE6.</li>
100
+ </ul>
101
+ <h2>14 August 2009</h2>
102
+ <ul>
103
+ <li>Fixed prettifying of <code>&lt;code&gt;</code> blocks with embedded newlines.
104
+ </ul>
105
+ <h2>3 October 2009</h2>
106
+ <ul>
107
+ <li>Fixed prettifying of XML/HTML tags that contain uppercase letters.
108
+ </ul>
109
+ <h2>19 July 2010</h2>
110
+ <ul>
111
+ <li>Added support for line numbers. Bug
112
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=22"
113
+ >22</a></li>
114
+ <li>Added YAML support. Bug
115
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=123"
116
+ >123</a></li>
117
+ <li>Added VHDL support courtesy Le Poussin.</li>
118
+ <li>IE performance improvements. Bug
119
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=102"
120
+ >102</a> courtesy jacobly.</li>
121
+ <li>A variety of markup formatting fixes courtesy smain and thezbyg.</li>
122
+ <li>Fixed copy and paste in IE[678].
123
+ <li>Changed output to use <code>&amp;#160;</code> instead of
124
+ <code>&amp;nbsp;</code> so that the output works when embedded in XML.
125
+ Bug
126
+ <a href="http://code.google.com/p/google-code-prettify/issues/detail?id=108"
127
+ >108</a>.</li>
128
+ </ul>
129
+ </body>
130
+ </html>
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.