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:
- 7670 Bytes
1 | <html> |
2 | <head> |
3 | <title>Syntax Manual :: Chapter 1: Introduction</title> |
4 | <link type="text/css" rel="stylesheet" href="stylesheets/manual.css" /> |
5 | </head> |
6 | |
7 | <body> |
8 | <div id="banner"> |
9 | <table border='0' cellpadding='0' cellspacing='0' width='100%'> |
10 | <tr><td valign='top' align='left'> |
11 | <div class="title"> |
12 | <span class="product">Syntax—</span><br /> |
13 | <span class="tagline">Lexical Analysis for Syntax Highlighting</span> |
14 | </div> |
15 | </td><td valign='middle' align='right'> |
16 | <div class="info"> |
17 | Syntax Version: <strong>1.0.0</strong><br /> |
18 | Manual Last Updated: <strong>2005-06-18 20:25 UTC</strong> |
19 | </div> |
20 | </td></tr> |
21 | </table> |
22 | </div> |
23 | |
24 | <table border='0' width='100%' cellpadding='0' cellspacing='0'> |
25 | <tr><td valign='top'> |
26 | |
27 | <div id="navigation"> |
28 | <h1>Syntax Manual</h1> |
29 | |
30 | <h2>Chapters</h2> |
31 | <ol type="I"> |
32 | |
33 | <li><strong> |
34 | <a href="chapter-1.html"> |
35 | Introduction |
36 | </a> |
37 | </strong> <big>←</big> |
38 | <ol type="1"> |
39 | |
40 | <li><a href="chapter-1.html#s1">What is Syntax?</a></li> |
41 | |
42 | <li><a href="chapter-1.html#s2">Quick Start</a></li> |
43 | |
44 | </ol> |
45 | </li> |
46 | |
47 | <li> |
48 | <a href="chapter-2.html"> |
49 | Lexical Analysis |
50 | </a> |
51 | |
52 | <ol type="1"> |
53 | |
54 | <li><a href="chapter-2.html#s1">Groups</a></li> |
55 | |
56 | <li><a href="chapter-2.html#s2">Instructions</a></li> |
57 | |
58 | <li><a href="chapter-2.html#s3">Analyzing</a></li> |
59 | |
60 | </ol> |
61 | </li> |
62 | |
63 | <li> |
64 | <a href="chapter-3.html"> |
65 | Syntax Highlighting |
66 | </a> |
67 | |
68 | <ol type="1"> |
69 | |
70 | <li><a href="chapter-3.html#s1">Converting Text</a></li> |
71 | |
72 | <li><a href="chapter-3.html#s2">Custom Highlighters</a></li> |
73 | |
74 | </ol> |
75 | </li> |
76 | |
77 | <li> |
78 | <a href="chapter-4.html"> |
79 | Extending Syntax |
80 | </a> |
81 | |
82 | <ol type="1"> |
83 | |
84 | <li><a href="chapter-4.html#s1">Introduction</a></li> |
85 | |
86 | <li><a href="chapter-4.html#s2">Interface</a></li> |
87 | |
88 | <li><a href="chapter-4.html#s3">Scanning <span class="caps">API</span></a></li> |
89 | |
90 | <li><a href="chapter-4.html#s4">Registering Your New Syntax</a></li> |
91 | |
92 | </ol> |
93 | </li> |
94 | |
95 | </ol> |
96 | |
97 | <h2>Other Documentation</h2> |
98 | |
99 | <ul> |
100 | <li><a href="http://net-ssh.rubyforge.org/api/index.html">Net::SSH API</a></li> |
101 | <li><a href="http://rubyforge.org/tracker/?atid=1842&group_id=274&func=browse">Net::SSH FAQ</a></li> |
102 | </ul> |
103 | |
104 | <h2>Tutorials</h2> |
105 | <ol> |
106 | |
107 | </ol> |
108 | |
109 | <p align="center"><strong>More To Come...</strong></p> |
110 | |
111 | <div class="license"> |
112 | <a href="http://creativecommons.org/licenses/by-sa/2.0/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights" /></a><br /> |
113 | This manual is licensed under a <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons License</a>. |
114 | </div> |
115 | </div> |
116 | |
117 | </td><td valign='top' width="100%"> |
118 | |
119 | <div id="content"> |
120 | |
121 | <div class="top"><div class="prevnext"> |
122 | |
123 | <a href="index.html">Up</a> |
124 | |
125 | | <a href="chapter-2.html">Next (2. Lexical Analysis)</a> |
126 | |
127 | </div></div> |
128 | |
129 | <h1>1. Introduction</h1> |
130 | |
131 | |
132 | |
133 | <h2> |
134 | <a name="s1"></a> |
135 | 1.1. What is Syntax? |
136 | </h2> |
137 | |
138 | |
139 | |
140 | <div class="section"> |
141 | <p>Syntax is, first and foremost, a lexical analysis framework. It supports pluggable syntax modules, and comes with modules for Ruby, <span class="caps">XML</span>, and <span class="caps">YAML</span>.</p> |
142 | |
143 | |
144 | <p>What does it mean, a “lexical analysis framework”? It means you can use Syntax to take a body of text representing instructions in some syntax (like Ruby), and break that text into <em>tokens</em>.</p> |
145 | |
146 | |
147 | <p>What is that good for? Well, a few things. You could concievably use it to count the number of classes in a system, or the number of lines of code per method. But Syntax was written specifically with <em>syntax highlighting</em> in mind.</p> |
148 | </div> |
149 | |
150 | |
151 | |
152 | <h2> |
153 | <a name="s2"></a> |
154 | 1.2. Quick Start |
155 | </h2> |
156 | |
157 | |
158 | |
159 | <div class="section"> |
160 | <p>Because Syntax was written primarily to support syntax highlighting, that is going to be the task most clients of the library will use it for. So, to get you up and running quickly, converting, for example, Ruby code to <span class="caps">HTML</span>, consider the following:</p> |
161 | |
162 | |
163 | <div class='figure'> |
164 | <span class='caption'>Convert a Ruby script to HTML [ruby]</span> |
165 | <div class='body'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='lineno'>1<br />2<br />3<br />4<br />5<br />6<br /></td><td width='100%'><link rel='stylesheet' type='text/css' href='stylesheets/ruby.css' /><div class='ruby'><pre><span class="ident">require</span> <span class="punct">'</span><span class="string">syntax/convertors/html</span><span class="punct">'</span> |
166 | |
167 | <span class="ident">convertor</span> <span class="punct">=</span> <span class="constant">Syntax</span><span class="punct">::</span><span class="constant">Convertors</span><span class="punct">::</span><span class="constant">HTML</span><span class="punct">.</span><span class="ident">for_syntax</span> <span class="punct">"</span><span class="string">ruby</span><span class="punct">"</span> |
168 | <span class="ident">html</span> <span class="punct">=</span> <span class="ident">convertor</span><span class="punct">.</span><span class="ident">convert</span><span class="punct">(</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">read</span><span class="punct">(</span> <span class="punct">"</span><span class="string">program.rb</span><span class="punct">"</span> <span class="punct">)</span> <span class="punct">)</span> |
169 | |
170 | <span class="ident">puts</span> <span class="ident">html</span></pre></div></td></tr></table></div></div> |
171 | |
172 | |
173 | <p>The above script will convert a Ruby file called <code>program.rb</code> to <span class="caps">HTML</span>, writing the <span class="caps">HTML</span> to stdout. <span class="caps">HTML </span><code>span</code> tags will be used in conjunction with “class” attributes to describe the various tokens—this allows you to use <span class="caps">CSS</span> to colorize the result.</p> |
174 | |
175 | |
176 | <p>Incidentally, this entire document uses the Syntax library to colorize the Ruby code snippets!</p> |
177 | |
178 | |
179 | <p><em>Note: currently, only <span class="caps">HTML</span> conversion is supported, but it should be possible to create a convertor that takes the tokenized output and emits other formats, like LaTeX, <span class="caps">PDF</span>, or Rich Text.</em></p> |
180 | </div> |
181 | |
182 | |
183 | |
184 | <div class="bottom"><div class="prevnext"> |
185 | |
186 | <a href="index.html">Up</a> |
187 | |
188 | | <a href="chapter-2.html">Next (2. Lexical Analysis)</a> |
189 | |
190 | </div></div> |
191 | |
192 | |
193 | </div> |
194 | |
195 | </td></tr> |
196 | </table> |
197 | </body> |
198 | </html> |