diff website/src/diff.html.luan @ 562:7cc9d4a53d3b

remove SimplyHTML from documentation
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 24 Jun 2015 14:20:00 -0600
parents 0dfc01d8d42d
children b73f005f3735
line wrap: on
line diff
--- a/website/src/diff.html.luan	Tue Jun 23 16:45:16 2015 -0600
+++ b/website/src/diff.html.luan	Wed Jun 24 14:20:00 2015 -0600
@@ -1,9 +1,6 @@
 local Io = require "luan:Io"
-local Html = require "luan:Html"
 local Http = require "luan:http/Http"
 local Shared = require "site:/Shared"
-local Manual = require "site:/manual.html"
-local heading_options = Shared.heading_options
 
 
 return function()
@@ -11,12 +8,13 @@
 %>
 <html>
 <head>
-	<% Html.simply_html_head() %>
 	<title>How Luan differs from Lua</title>
+	<style>
+		@import "/site.css";
+	</style>
 </head>
 <body>
 
-<div container>
 <% Shared.header() %>
 <h1>How Luan differs from Lua</h1>
 
@@ -26,9 +24,9 @@
 
 <h2>Contents</h2>
 
-<div margin-bottom="1em"><a href="#intro">Introduction</a></div>
+<div contents><a href="#intro">Introduction</a></div>
 
-<div margin-bottom="1em">
+<div contents>
 	<a href="#basic">Basic Concepts</a>
 	<ul>
 		<li><a href="#types">Values and Types</a></li>
@@ -40,7 +38,7 @@
 	</ul>
 </div>
 
-<div margin-bottom="1em">
+<div contents>
 	<a href="#lang">The Language</a>
 	<ul>
 		<li><a href="#lex">Lexical Conventions</a></li>
@@ -70,92 +68,92 @@
 
 <hr/>
 
-<h2 <%=heading_options%> ><a name="intro">Introduction</a></h2>
+<h2 heading><a name="intro">Introduction</a></h2>
 
 <p>Lua is one of the simplest languages available, but Luan is even simpler.  This means Luan removes more than it adds.  Most of what is added is added in the library, not in the language itself.</p>
 
 <p>Luan is implemented in Java and is tightly integrated with Java.  This makes it an excellent scripting language for Java.</p>
 
-<h2 <%=heading_options%> ><a name="basic">Basic Concepts</a></h2>
+<h2 heading><a name="basic">Basic Concepts</a></h2>
 
-<h3 <%=heading_options%> ><a name="types">Values and Types</a></h3>
+<h3 heading><a name="types">Values and Types</a></h3>
 
-<p>Luan does not have the Lua <i>thread</i> type.  Luan adds a <i>binary</i> type that Lua doesn't have.  This is because Lua strings can represent binary while Luan strings cannot.</p>
+<p>Luan does not have the Lua <em>thread</em> type.  Luan adds a <em>binary</em> type that Lua doesn't have.  This is because Lua strings can represent binary while Luan strings cannot.</p>
 
-<p>The Luan <i>Nil</i> type is implemented as the Java <i>null</i>.  The Luan <i>Boolean</i> type is implemented as the Java <i>Boolean</i> type.  The Luan <i>Number</i> type is implemented as the Java <i>Number</i> type.  The Luan <i>String</i> type is implemented as the Java <i>String</i> type.  Actual numbers may be any subclass of the Java <i>Number</i> class.</p>
+<p>The Luan <em>Nil</em> type is implemented as the Java <em>null</em>.  The Luan <em>Boolean</em> type is implemented as the Java <em>Boolean</em> type.  The Luan <em>Number</em> type is implemented as the Java <em>Number</em> type.  The Luan <em>String</em> type is implemented as the Java <em>String</em> type.  Actual numbers may be any subclass of the Java <em>Number</em> class.</p>
 
 <p>Luan functions may be written in Luan or may be wrappers around native Java methods.  Any Java method may be called as a Luan function.</p>
 
-<p>The Luan <i>java</i> type is a replacement for Lua's <i>userdata</i>.  A Luan <i>java</i> value is nothing more than a Java object that doesn't fall into one of the other recognized types.</p>
+<p>The Luan <em>java</em> type is a replacement for Lua's <em>userdata</em>.  A Luan <em>java</em> value is nothing more than a Java object that doesn't fall into one of the other recognized types.</p>
 
-<p>The Luan <i>binary</i> type is the Java <i>byte[ ]</i> type which is an array of bytes.</p>
+<p>The Luan <em>binary</em> type is the Java <em>byte[ ]</em> type which is an array of bytes.</p>
 
-<p>The Luan <i>table</i> type is just like its Lua equivalent, but implemented in Java.</p>
+<p>The Luan <em>table</em> type is just like its Lua equivalent, but implemented in Java.</p>
 
-<h3 <%=heading_options%> ><a name="env">Environments</a></h3>
+<h3 heading><a name="env">Environments</a></h3>
 
-<p>Luan has no global environment at all, no <tt>_G</tt>.  By default, Luan doesn't define <tt>_ENV</tt> either, but if you define it as a local table in a chunk, then it acts like it does in Lua.  When <tt>_ENV</tt> isn't defined, there are no global variables and an unrecognized variable name produces a compile error.</p>
+<p>Luan has no global environment at all, no <code>_G</code>.  By default, Luan doesn't define <code>_ENV</code> either, but if you define it as a local table in a chunk, then it acts like it does in Lua.  When <code>_ENV</code> isn't defined, there are no global variables and an unrecognized variable name produces a compile error.</p>
 
-<p>Every module is initialized with two local functions: <tt>require</tt> and <tt>java</tt>.  The module then uses these functions to get access to whatever else it needs.</p>
+<p>Every module is initialized with two local functions: <code>require</code> and <code>java</code>.  The module then uses these functions to get access to whatever else it needs.</p>
 
-<h3 <%=heading_options%> ><a name="error">Error Handling</a></h3>
+<h3 heading><a name="error">Error Handling</a></h3>
 
-<p>Luan has the functions <tt>error</tt> and <tt>pcall</tt> but does not have <tt>xpcall</tt>.  Luan adds the function <tt>try</tt> which looks and acts like try-catch blocks in other languages.  Luan errors are implemented as an error table, not as a message object.</p>
+<p>Luan has the functions <code>error</code> and <code>pcall</code> but does not have <code>xpcall</code>.  Luan adds the function <code>try</code> which looks and acts like try-catch blocks in other languages.  Luan errors are implemented as an error table, not as a message object.</p>
 
-<h3 <%=heading_options%> ><a name="meta">Metatables and Metamethods</a></h3>
+<h3 heading><a name="meta">Metatables and Metamethods</a></h3>
 
 <p>Luan only has metatable for tables, not for other types.</p>
 
-<h3 <%=heading_options%> ><a name="gc">Garbage Collection</a></h3>
+<h3 heading><a name="gc">Garbage Collection</a></h3>
 
 <p>Luan uses Java garbage collection.  Luan has no special garbage collection methods.</p>
 
 <p>Luan does not yet have weak tables but this will be added.</p>
 
-<h3 <%=heading_options%> ><a name="coroutines">Coroutines</a></h3>
+<h3 heading><a name="coroutines">Coroutines</a></h3>
 
 <p>Luan does not have coroutines.  Coroutines is a complex concept that isn't needed in a simple language, so it was left out.</p>
 
-<h2 <%=heading_options%> ><a name="lang">The Language</a></h2>
+<h2 heading><a name="lang">The Language</a></h2>
 
-<h3 <%=heading_options%> ><a name="lex">Lexical Conventions</a></h3>
+<h3 heading><a name="lex">Lexical Conventions</a></h3>
 
-<p>Unlike Lua, Luan generally considers the end of a line to be the end of a statement.  This catches errors and encourages readability.  The exception to this is in paranthesis ( <i>(...)</i>, <i>[...]</i>, and <i>{...}</i> ) where the end of line is treated as white space.</p>
+<p>Unlike Lua, Luan generally considers the end of a line to be the end of a statement.  This catches errors and encourages readability.  The exception to this is in paranthesis ( <em>(...)</em>, <em>[...]</em>, and <em>{...}</em> ) where the end of line is treated as white space.</p>
 
 <p>Luan has exactly the same set of keywords as Lua and has the same other lexical conventions.</p>
 
-<h3 <%=heading_options%> ><a name="vars">Variables</a></h3>
+<h3 heading><a name="vars">Variables</a></h3>
 
 <p>
-By default, there are no global variables and an undefined variable produces a compile error.  To enable global variables, one must define <tt>_ENV</tt>.  Avoiding global variables makes it much easier to catch errors at compile time.
+By default, there are no global variables and an undefined variable produces a compile error.  To enable global variables, one must define <code>_ENV</code>.  Avoiding global variables makes it much easier to catch errors at compile time.
 
-<h3 <%=heading_options%> ><a name="stmt">Statements</a></h3>
+<h3 heading><a name="stmt">Statements</a></h3>
 
 <p>Most statements in Luan are the same as Lua.  Only those statements that differ will be listed here.</p>
 
-<h4 <%=heading_options%> ><a name="control">Control Structures</a></h4>
+<h4 heading><a name="control">Control Structures</a></h4>
 
 <p>The Luan <b>if</b>, <b>while</b>, and <b>repeat</b> statement are the same as in Lua except that the condition expression must return a boolean value.  Any other value type will produce an error.  This helps catch errors and makes code more readable.</p>
 
 <p>Luan does not have a <b>goto</b> statement.</p>
 
-<h4 <%=heading_options%> ><a name="for">For Statement</a></h4>
+<h4 heading><a name="for">For Statement</a></h4>
 
-<p>Luan has no numeric <b>for</b> statement.  Luan only has generic <b>for</b> statement.  Instead of the numeric <b>for</b> statement, Luan uses the <tt>range</tt> function in a generic <b>for</b> statement like this:</p>
+<p>Luan has no numeric <b>for</b> statement.  Luan only has generic <b>for</b> statement.  Instead of the numeric <b>for</b> statement, Luan uses the <code>range</code> function in a generic <b>for</b> statement like this:</p>
 
-<p><tt><pre>
-	for i in range(from,to,step) do <i>block</i> end
-</pre></tt></p>
+<pre>
+	for i in range(from,to,step) do <em>block</em> end
+</pre>
 
 <p>The Luan generic <b>for</b> statement is simpler than the Lua version because Luan only uses an expression, not an explist.  So a <b>for</b> statement like:</p>
 
-<p><tt><pre>
+<pre>
 	for var_1, &middot;&middot;&middot;, var_n in exp do block end
-</pre></tt></p>
+</pre>
 
 <p>is equivalent to the code:</p>
 
-<p><tt><pre>
+<pre>
 	do
 		local f = exp
 		while true do
@@ -164,50 +162,47 @@
 			block
 		end
 	end
-</pre></tt></p>
+</pre>
 
-<h4 <%=heading_options%> ><a name="logical">Logical Statements</a></h4>
+<h4 heading><a name="logical">Logical Statements</a></h4>
 
 <p>Unlike Lua, Luan allows <b>or</b> and <b>and</b> expressions to be stand-alone statements.  This is useful in cases like this:</p>
 
-<p><tt><pre>
+<pre>
 	x==5 or error "x should be 5"
-</pre></tt></p>
+</pre>
 
-<h4 <%=heading_options%> ><a name="template_stmt">Template Statements</a></h4>
+<h4 heading><a name="template_stmt">Template Statements</a></h4>
 
 <p>Template statements are a Luan addition that don't exist in Lua.  See <a href="manual.html#template_stmt">Template Statements</a> in the Luan Reference Manual.</p>
 
 
-<h3 <%=heading_options%> ><a name="expr">Expressions</a></h3>
+<h3 heading><a name="expr">Expressions</a></h3>
 
-<h4 <%=heading_options%> ><a name="conversions">Coercions and Conversions</a></h4>
+<h4 heading><a name="conversions">Coercions and Conversions</a></h4>
 
 <p>Unlike Lua, Luan does not do automatic conversions of strings to numbers.</p>
 
-<h4 <%=heading_options%> ><a name="bit">Bitwise Operators</a></h4>
+<h4 heading><a name="bit">Bitwise Operators</a></h4>
 
 <p>Bitwise operators appear to be a new addition to Lua 5.3 and didn't exist in Lua 5.2.  Luan does not support bitwise operators, but these can be added if there is a need.</p>
 
-<h4 <%=heading_options%> ><a name="logical_ops">Logical Operators</a></h4>
+<h4 heading><a name="logical_ops">Logical Operators</a></h4>
 
 <p>The only change in Luan is that <b>not</b> must take a boolean argument.  This helps catch errors and makes code more readable.</p>
 
-<h4 <%=heading_options%> ><a name="concatenation">Concatenation</a></h4>
+<h4 heading><a name="concatenation">Concatenation</a></h4>
 
 <p>Unlike Lua, Luan converts all concatenation operands to strings.
 
-<h4 <%=heading_options%> ><a name="fn_calls">Function Calls</a></h4>
+<h4 heading><a name="fn_calls">Function Calls</a></h4>
 
-<p>Luan does not support Lua's <tt>v:name(args)</tt> style object-oriented function call.  Object oriented programming is done in Luan using closures, so this feature is not needed.</p>
+<p>Luan does not support Lua's <code>v:name(args)</code> style object-oriented function call.  Object oriented programming is done in Luan using closures, so this feature is not needed.</p>
 
-<h4 <%=heading_options%> ><a name="template_expr">Template Expressions</a></h4>
+<h4 heading><a name="template_expr">Template Expressions</a></h4>
 
 <p>Template expressions are a Luan addition that don't exist in Lua.  See <a href="manual.html#template_expr">Template Expressions</a> in the Luan Reference Manual.</p>
-
-</div>
 		
-<% Html.simply_html_body_bottom() %>
 </body>
 </html>
 <%