Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 15
- Log:
Attempt to update Typo to a Typo SVN HEAD release from around the
time the prototype installation was set up on the RISC OS Open Limited
web site. Timestamps place this at 04-Jul so a revision from 05-Jul or
earlier was pulled and copied over the 2.6.0 tarball stable code.
- Author:
- adh
- Date:
- Sat Jul 22 23:27:35 +0100 2006
- Size:
- 6962 Bytes
1 | <?xml version="1.0" encoding="iso-8859-1"?> |
2 | <!DOCTYPE html |
3 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
5 | <html> |
6 | <head> |
7 | <title>Class: Syntax::Convertors::HTML</title> |
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
9 | <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
10 | |
11 | <script language="JavaScript" type="text/javascript"> |
12 | // <![CDATA[ |
13 | |
14 | function toggleSource( id ) |
15 | { |
16 | var elem |
17 | var link |
18 | |
19 | if( document.getElementById ) |
20 | { |
21 | elem = document.getElementById( id ) |
22 | link = document.getElementById( "l_" + id ) |
23 | } |
24 | else if ( document.all ) |
25 | { |
26 | elem = eval( "document.all." + id ) |
27 | link = eval( "document.all.l_" + id ) |
28 | } |
29 | else |
30 | return false; |
31 | |
32 | if( elem.style.display == "block" ) |
33 | { |
34 | elem.style.display = "none" |
35 | link.innerHTML = "show source" |
36 | } |
37 | else |
38 | { |
39 | elem.style.display = "block" |
40 | link.innerHTML = "hide source" |
41 | } |
42 | } |
43 | |
44 | function openCode( url ) |
45 | { |
46 | window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" ) |
47 | } |
48 | // ]]> |
49 | </script> |
50 | </head> |
51 | |
52 | <body> |
53 | <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr> |
54 | <td class="file-title"><span class="file-title-prefix">Class</span><br />Syntax::Convertors::HTML</td> |
55 | <td align="right"> |
56 | <table cellspacing=0 cellpadding=2> |
57 | <tr valign="top"> |
58 | <td>In:</td> |
59 | <td> |
60 | <a href="../../../files/lib/syntax/convertors/html_rb.html">lib/syntax/convertors/html.rb</a> |
61 | </td> |
62 | </tr> |
63 | <tr> |
64 | <td>Parent:</td> |
65 | <td> |
66 | <a href="Abstract.html"> |
67 | Abstract |
68 | </a> |
69 | </td> |
70 | </tr> |
71 | </table> |
72 | </td> |
73 | </tr> |
74 | </table> |
75 | <!-- banner header --> |
76 | |
77 | <div id="bodyContent"> |
78 | <div id="content"> |
79 | |
80 | <div class="description"><p> |
81 | A simple class for converting a text into <a href="HTML.html">HTML</a>. |
82 | </p> |
83 | </div> |
84 | |
85 | |
86 | |
87 | <div class="sectiontitle">Methods</div> |
88 | <ul> |
89 | <li><a href="#M000003">convert</a></li> |
90 | </ul> |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | <div class="sectiontitle">Public Instance methods</div> |
98 | <div class="method"> |
99 | <div class="title"> |
100 | <a name="M000003"></a><b>convert</b>( text, pre=true ) |
101 | </div> |
102 | <div class="description"> |
103 | <p> |
104 | Converts the given text to <a href="HTML.html">HTML</a>, using spans to |
105 | represent token groups of any type but <tt>:normal</tt> (which is always |
106 | unhighlighted). If <tt>pre</tt> is <tt>true</tt>, the html is automatically |
107 | wrapped in pre tags. |
108 | </p> |
109 | </div> |
110 | <div class="sourcecode"> |
111 | <p class="source-link">[ <a href="javascript:toggleSource('M000003_source')" id="l_M000003_source">show source</a> ]</p> |
112 | <div id="M000003_source" class="dyn-source"> |
113 | <pre> |
114 | <span class="ruby-comment cmt"># File lib/syntax/convertors/html.rb, line 12</span> |
115 | 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>( <span class="ruby-identifier">text</span>, <span class="ruby-identifier">pre</span>=<span class="ruby-keyword kw">true</span> ) |
116 | 13: <span class="ruby-identifier">html</span> = <span class="ruby-value str">""</span> |
117 | 14: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<pre>"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pre</span> |
118 | 15: <span class="ruby-identifier">regions</span> = [] |
119 | 16: <span class="ruby-ivar">@tokenizer</span>.<span class="ruby-identifier">tokenize</span>( <span class="ruby-identifier">text</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tok</span><span class="ruby-operator">|</span> |
120 | 17: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">tok</span>) |
121 | 18: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">tok</span>.<span class="ruby-identifier">instruction</span> |
122 | 19: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:region_close</span> <span class="ruby-keyword kw">then</span> |
123 | 20: <span class="ruby-identifier">regions</span>.<span class="ruby-identifier">pop</span> |
124 | 21: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</span>"</span> |
125 | 22: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:region_open</span> <span class="ruby-keyword kw">then</span> |
126 | 23: <span class="ruby-identifier">regions</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">tok</span>.<span class="ruby-identifier">group</span> |
127 | 24: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<span class=\"#{tok.group}\">#{value}"</span> |
128 | 25: <span class="ruby-keyword kw">else</span> |
129 | 26: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tok</span>.<span class="ruby-identifier">group</span> <span class="ruby-operator">==</span> ( <span class="ruby-identifier">regions</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">:normal</span> ) |
130 | 27: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span> |
131 | 28: <span class="ruby-keyword kw">else</span> |
132 | 29: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<span class=\"#{tok.group}\">#{value}</span>"</span> |
133 | 30: <span class="ruby-keyword kw">end</span> |
134 | 31: <span class="ruby-keyword kw">end</span> |
135 | 32: <span class="ruby-keyword kw">end</span> |
136 | 33: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</span>"</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">regions</span>.<span class="ruby-identifier">pop</span> |
137 | 34: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</pre>"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pre</span> |
138 | 35: <span class="ruby-identifier">html</span> |
139 | 36: <span class="ruby-keyword kw">end</span> |
140 | </pre> |
141 | </div> |
142 | </div> |
143 | </div> |
144 | </div> |
145 | |
146 | </div> |
147 | |
148 | </body> |
149 | </html> |