changeset 1327:b29eefad2111

website - improve docs
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 08 Feb 2019 00:45:31 -0700
parents 29d6d7d79c41
children 55b8210b4ec0
files website/src/diff.html website/src/manual.html website/src/site.css
diffstat 3 files changed, 72 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/website/src/diff.html	Thu Feb 07 23:13:23 2019 -0700
+++ b/website/src/diff.html	Fri Feb 08 00:45:31 2019 -0700
@@ -13,7 +13,7 @@
 	/ <a href="docs.html">Documentation</a>
 </div>
 
-<h1>How Luan differs from Lua</h1>
+<h1><a href="diff.html">How Luan differs from Lua</a></h1>
 
 <p>This document explains how Luan differs from <a href="http://www.lua.org">Lua</a> as described in the <a href="http://www.lua.org/manual/5.3/">Lua 5.3 Reference Manual</a>.</p>
 
@@ -66,15 +66,15 @@
 
 <hr/>
 
-<h2 heading><a name="intro">Introduction</a></h2>
+<h2 heading><a name="intro" href="#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><a name="basic">Basic Concepts</a></h2>
+<h2 heading><a name="basic" href="#basic">Basic Concepts</a></h2>
 
-<h3 heading><a name="types">Values and Types</a></h3>
+<h3 heading><a name="types" href="#types">Values and Types</a></h3>
 
 <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>
 
@@ -88,58 +88,58 @@
 
 <p>The Luan <em>table</em> type is just like its Lua equivalent, but implemented in Java.</p>
 
-<h3 heading><a name="env">Environments</a></h3>
+<h3 heading><a name="env" href="#env">Environments</a></h3>
 
 <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: <code>require</code> and <code>java</code>.  The module then uses these functions to get access to whatever else it needs.</p>
 
-<h3 heading><a name="error">Error Handling</a></h3>
+<h3 heading><a name="error" href="#error">Error Handling</a></h3>
 
 <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><a name="meta">Metatables and Metamethods</a></h3>
+<h3 heading><a name="meta" href="#meta">Metatables and Metamethods</a></h3>
 
 <p>Luan only has metatable for tables, not for other types.</p>
 
 <p>Luan does not support the <b>call</b> metamethod.  There is nothing that one can do with the <b>call</b> metamethod that can't be done more cleanly with closures, so this was left out.</p>
 
-<h3 heading><a name="gc">Garbage Collection</a></h3>
+<h3 heading><a name="gc" href="#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><a name="coroutines">Coroutines</a></h3>
+<h3 heading><a name="coroutines" href="#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><a name="lang">The Language</a></h2>
+<h2 heading><a name="lang" href="#lang">The Language</a></h2>
 
-<h3 heading><a name="lex">Lexical Conventions</a></h3>
+<h3 heading><a name="lex" href="#lex">Lexical Conventions</a></h3>
 
 <p>Unlike Lua, Luan considers the end of a line to be the end of a statement.  This catches errors and encourages readability.  If you want to continue a statement on another line, you can use a backslash followed by a newline which will be 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><a name="vars">Variables</a></h3>
+<h3 heading><a name="vars" href="#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 <code>_ENV</code>.  Avoiding global variables makes it much easier to catch errors at compile time.
 
-<h3 heading><a name="stmt">Statements</a></h3>
+<h3 heading><a name="stmt" href="#stmt">Statements</a></h3>
 
 <p>Luan adds the block terminators <b>end_do</b>, <b>end_for</b>, <b>end_function</b>, <b>end_if</b>, and <b>end_while</b>.  These can be used to end the appropriate block type, but <b>end</b> can also be used to end any block.</p>
 
 <p>Most statements in Luan are the same as Lua.  Only those statements that differ will be listed here.</p>
 
-<h4 heading><a name="control">Control Structures</a></h4>
+<h4 heading><a name="control" href="#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><a name="for">For Statement</a></h4>
+<h4 heading><a name="for" href="#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 <code>range</code> function in a generic <b>for</b> statement like this:</p>
 
@@ -166,7 +166,7 @@
 	end
 </pre>
 
-<h4 heading><a name="logical">Logical Statements</a></h4>
+<h4 heading><a name="logical" href="#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>
 
@@ -174,34 +174,34 @@
 	x==5 or error "x should be 5"
 </pre>
 
-<h4 heading><a name="template_stmt">Template Statements</a></h4>
+<h4 heading><a name="template_stmt" href="#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><a name="expr">Expressions</a></h3>
+<h3 heading><a name="expr" href="#expr">Expressions</a></h3>
 
-<h4 heading><a name="conversions">Coercions and Conversions</a></h4>
+<h4 heading><a name="conversions" href="#conversions">Coercions and Conversions</a></h4>
 
 <p>Unlike Lua, Luan does not do automatic conversions of strings to numbers.</p>
 
-<h4 heading><a name="bit">Bitwise Operators</a></h4>
+<h4 heading><a name="bit" href="#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><a name="logical_ops">Logical Operators</a></h4>
+<h4 heading><a name="logical_ops" href="#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><a name="concatenation">Concatenation</a></h4>
+<h4 heading><a name="concatenation" href="#concatenation">Concatenation</a></h4>
 
 <p>Unlike Lua, Luan converts all concatenation operands to strings.
 
-<h4 heading><a name="constructors">Table Constructors</a></h4>
+<h4 heading><a name="constructors" href="#constructors">Table Constructors</a></h4>
 
 <p>Unlike Lua, Luan considers an <b>end_of_line</b> to be a field separator in a table constructor.</p>
 
-<h4 heading><a name="fn_calls">Function Calls</a></h4>
+<h4 heading><a name="fn_calls" href="#fn_calls">Function Calls</a></h4>
 
 <p>Unlike Lua, Luan does not allow extra non-nil arguments to be passed to a function.  In Luan, this causes an error.  This change helps find coding mistakes that would be very hard to detect otherwise.</p>
 
@@ -209,7 +209,7 @@
 
 <p>Luan doesn't support <em>proper tail calls</em>.  Because Java doesn't support this cleanly, this was left out.</p>
 
-<h4 heading><a name="template_expr">Template Expressions</a></h4>
+<h4 heading><a name="template_expr" href="#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>
 		
--- a/website/src/manual.html	Thu Feb 07 23:13:23 2019 -0700
+++ b/website/src/manual.html	Fri Feb 08 00:45:31 2019 -0700
@@ -13,7 +13,7 @@
 	/ <a href="docs.html">Documentation</a>
 </div>
 
-<h1>Luan Reference Manual</h1>
+<h1><a href="manual.html">Luan Reference Manual</a></h1>
 
 <p small>
 Original copyright &copy; 2015 Lua.org, PUC-Rio.
@@ -94,7 +94,7 @@
 <hr/>
 
 
-<h2 heading><a name="intro">Introduction</a></h2>
+<h2 heading><a name="intro" href="#intro">Introduction</a></h2>
 
 <p>Luan is a high level programming language based on <a href="http://www.lua.org">Lua</a>.  A great strength of Lua is its simplicity and Luan takes this even further, being even simpler than Lua.  The goal is to provide a simple programming language for the casual programmer with as few concepts as possible so that one can quickly learn the language and then easily understand any code written in Luan.</p>
 
@@ -103,11 +103,11 @@
 <p>Unlike Lua which is meant to be embedded, Luan is meant to be a full scripting language.  This done not by adding feature to Luan, but rather by providing a complete set of libraries.</p>
 
 
-<h2 heading><a name="basic">Basic Concepts</a></h2>
+<h2 heading><a name="basic" href="#basic">Basic Concepts</a></h2>
 
 <p>This section describes the basic concepts of the language.</p>
 
-<h3 heading><a name="types">Values and Types</a></h3>
+<h3 heading><a name="types" href="#types">Values and Types</a></h3>
 
 <p>
 Luan is a <em>dynamically typed language</em>.
@@ -226,7 +226,7 @@
 
 
 
-<h3 heading><a name="env">Environments</a></h3>
+<h3 heading><a name="env" href="#env">Environments</a></h3>
 
 <p>
 The environment of a chunk starts with only two local variables: <code><a href="#require">require</a></code> and <code><a href="#java">java</a></code>.  These are functions are used to load and access libraries and other modules.  All other variables must be added to the environment using <a href="http://localhost:8080/manual.html#local_stmt">local declarations</a>.
@@ -238,7 +238,7 @@
 can be syntactically translated to <code>_ENV.var</code> if <code>_ENV</code> is defined.
 
 
-<h3 heading><a name="error">Error Handling</a></h3>
+<h3 heading><a name="error" href="#error">Error Handling</a></h3>
 
 <p>
 Luan code can explicitly generate an error by calling the
@@ -256,7 +256,7 @@
 
 
 
-<h3 heading><a name="meta">Metatables and Metamethods</a></h3>
+<h3 heading><a name="meta" href="#meta">Metatables and Metamethods</a></h3>
 
 <p>
 Every table in Luan can have a <em>metatable</em>.
@@ -475,7 +475,7 @@
 
 
 
-<h3 heading><a name="gc">Garbage Collection</a></h3>
+<h3 heading><a name="gc" href="#gc">Garbage Collection</a></h3>
 
 <p>
 Luan uses Java's garbage collection.
@@ -484,7 +484,7 @@
 
 
 
-<h2 heading><a name="lang">The Language</a></h2>
+<h2 heading><a name="lang" href="#lang">The Language</a></h2>
 
 <p>
 This section describes the lexis, the syntax, and the semantics of Luan.
@@ -508,7 +508,7 @@
 
 
 
-<h3 heading><a name="lex">Lexical Conventions</a></h3>
+<h3 heading><a name="lex" href="#lex">Lexical Conventions</a></h3>
 
 <p>
 Luan ignores spaces and comments
@@ -686,7 +686,7 @@
 
 
 
-<h3 heading><a name="vars">Variables</a></h3>
+<h3 heading><a name="vars" href="#vars">Variables</a></h3>
 
 <p>
 Variables are places that store values.
@@ -749,7 +749,7 @@
 
 
 
-<h3 heading><a name="stmts">Statements</a></h3>
+<h3 heading><a name="stmts" href="#stmts">Statements</a></h3>
 
 <p>
 Luan supports an almost conventional set of statements,
@@ -760,7 +760,7 @@
 
 
 
-<h4 heading><a name="blocks">Blocks</a></h4>
+<h4 heading><a name="blocks" href="#blocks">Blocks</a></h4>
 
 <p>
 A block is a list of statements,
@@ -799,7 +799,7 @@
 
 
 
-<h4 heading><a name="chunks">Chunks</a></h4>
+<h4 heading><a name="chunks" href="#chunks">Chunks</a></h4>
 
 <p>
 The unit of compilation of Luan is called a <em>chunk</em>.
@@ -829,7 +829,7 @@
 
 
 
-<h4 heading><a name="assignment">Assignment</a></h4>
+<h4 heading><a name="assignment" href="#assignment">Assignment</a></h4>
 
 <p>
 Luan allows multiple assignments.
@@ -913,7 +913,7 @@
 
 
 
-<h4 heading><a name="control">Control Structures</a></h4>
+<h4 heading><a name="control" href="#control">Control Structures</a></h4>
 
 <p>
 The control structures
@@ -976,7 +976,7 @@
 
 
 
-<h4 heading><a name="for">For Statement</a></h4>
+<h4 heading><a name="for" href="#for">For Statement</a></h4>
 
 <p>
 The <b>for</b> statement works over functions,
@@ -1043,7 +1043,7 @@
 
 
 
-<h4 heading><a name="fn_stmt">Function Calls as Statements</a></h4>
+<h4 heading><a name="fn_stmt" href="#fn_stmt">Function Calls as Statements</a></h4>
 
 <p>
 To allow possible side-effects,
@@ -1059,7 +1059,7 @@
 
 
 
-<h4 heading><a name="local_stmt">Local Declarations</a></h4>
+<h4 heading><a name="local_stmt" href="#local_stmt">Local Declarations</a></h4>
 
 <p>
 Local variables can be declared anywhere inside a block.
@@ -1084,7 +1084,7 @@
 The visibility rules for local variables are explained in <a href="#visibility">Visibility Rules</a>.
 
 
-<h4 heading><a name="template_stmt">Template Statements</a></h4>
+<h4 heading><a name="template_stmt" href="#template_stmt">Template Statements</a></h4>
 
 <p>Template statements are based on <a href="#template_expr">template exressions</a> and provide the full equivalent of <a href="http://en.wikipedia.org/wiki/JavaServer_Pages">JSP</a> but in a general way.  Template statements write the equivalent template exression to standard output.  For example:</p>
 
@@ -1108,7 +1108,7 @@
 
 
 
-<h3 heading><a name="expressions">Expressions</a></h3>
+<h3 heading><a name="expressions" href="#expressions">Expressions</a></h3>
 
 <p>
 The basic expressions in Luan are the following:
@@ -1194,7 +1194,7 @@
 
 
 
-<h4 heading><a name="arithmetic">Arithmetic Operators</a></h4>
+<h4 heading><a name="arithmetic" href="#arithmetic">Arithmetic Operators</a></h4>
 
 <p>
 Luan supports the following arithmetic operators:
@@ -1219,7 +1219,7 @@
 
 
 
-<h4 heading><a name="conversions">Coercions and Conversions</a></h4>
+<h4 heading><a name="conversions" href="#conversions">Coercions and Conversions</a></h4>
 
 <p>
 Luan generally avoids automatic conversions.
@@ -1231,7 +1231,7 @@
 
 
 
-<h4 heading><a name="relational">Relational Operators</a></h4>
+<h4 heading><a name="relational" href="#relational">Relational Operators</a></h4>
 
 <p>
 Luan supports the following relational operators:
@@ -1297,7 +1297,7 @@
 
 
 
-<h4 heading><a name="logical_ops">Logical Operators</a></h4>
+<h4 heading><a name="logical_ops" href="#logical_ops">Logical Operators</a></h4>
 
 <p>
 The logical operators in Luan are
@@ -1337,7 +1337,7 @@
 
 
 
-<h4 heading><a name="concatenation">Concatenation</a></h4>
+<h4 heading><a name="concatenation" href="#concatenation">Concatenation</a></h4>
 
 <p>
 The string concatenation operator in Luan is
@@ -1346,7 +1346,7 @@
 
 
 
-<h4 heading><a name="length">The Length Operator</a></h4>
+<h4 heading><a name="length" href="#length">The Length Operator</a></h4>
 
 <p>
 The length operator is denoted by the unary prefix operator <code>#</code>.
@@ -1380,7 +1380,7 @@
 
 
 
-<h4 heading><a name="precedence">Precedence</a></h4>
+<h4 heading><a name="precedence" href="#precedence">Precedence</a></h4>
 
 <p>
 Operator precedence in Luan follows the table below,
@@ -1408,7 +1408,7 @@
 
 
 
-<h4 heading><a name="constructors">Table Constructors</a></h4>
+<h4 heading><a name="constructors" href="#constructors">Table Constructors</a></h4>
 
 <p>
 Table constructors are expressions that create tables.
@@ -1476,7 +1476,7 @@
 
 
 
-<h4 heading><a name="fn_calls">Function Calls</a></h4>
+<h4 heading><a name="fn_calls" href="#fn_calls">Function Calls</a></h4>
 
 <p>
 A function call in Luan has the following syntax:
@@ -1515,7 +1515,7 @@
 
 
 
-<h4 heading><a name="fn_def">Function Definitions</a></h4>
+<h4 heading><a name="fn_def" href="#fn_def">Function Definitions</a></h4>
 
 <p>
 The syntax for function definition is
@@ -1664,7 +1664,7 @@
 then the function returns with no results.
 
 
-<h4 heading><a name="template_expr">Template Expressions</a></h4>
+<h4 heading><a name="template_expr" href="#template_expr">Template Expressions</a></h4>
 
 <p>Luan template expression are based on <a href="http://en.wikipedia.org/wiki/JavaServer_Pages">JSP</a>.  Template expressions return multiple values.  Here is an example:</p>
 
@@ -1684,7 +1684,7 @@
 
 
 
-<h3 heading><a name="visibility">Visibility Rules</a></h3>
+<h3 heading><a name="visibility" href="#visibility">Visibility Rules</a></h3>
 
 <p>
 Luan is a lexically scoped language.
@@ -1747,7 +1747,7 @@
 
 
 
-<h2 heading><a name="libs">Standard Libraries</a></h2>
+<h2 heading><a name="libs" href="#libs">Standard Libraries</a></h2>
 
 <p>
 The standard Luan libraries provide useful functions
@@ -1758,19 +1758,19 @@
 others provide access to "outside" services (e.g., I/O).
 
 
-<h3 heading><a name="default_lib">Default Environment</a></h3>
+<h3 heading><a name="default_lib" href="#default_lib">Default Environment</a></h3>
 
 <p>
 These are provided by default as local variables for any Luan code as described in <a href="#env">Environments</a>.
 
 
-<h4 heading><a name="require"><code>java ()</code></a></h4>
+<h4 heading><a name="java" href="#java"><code>java ()</code></a></h4>
 
 <p>
 This function enables Java in the current chunk if that chunk has permission to use Java.  If the chunk doesn't have permission to use Java, then an error is thrown.
 
 
-<h4 heading><a name="require"><code>require (mod_uri)</code></a></h4>
+<h4 heading><a name="require" href="#require"><code>require (mod_uri)</code></a></h4>
 
 <p>
 Example use:
@@ -1789,7 +1789,7 @@
 </pre>
 
 
-<h3 heading><a name="luan_lib">Basic Functions</a></h3>
+<h3 heading><a name="luan_lib" href="#luan_lib">Basic Functions</a></h3>
 
 <p>
 Include this library by:
@@ -2184,7 +2184,7 @@
 
 
 
-<h3 heading><a name="package_lib">Modules</a></h3>
+<h3 heading><a name="package_lib" href="#package_lib">Modules</a></h3>
 
 <p>
 Include this library by:
@@ -2241,7 +2241,7 @@
 
 
 
-<h3 heading><a name="string_lib">String Manipulation</a></h3>
+<h3 heading><a name="string_lib" href="#string_lib">String Manipulation</a></h3>
 
 <p>
 Include this library by:
@@ -2593,7 +2593,7 @@
 
 
 
-<h3 heading><a name="binary_lib">Binary Manipulation</a></h3>
+<h3 heading><a name="binary_lib" href="#binary_lib">Binary Manipulation</a></h3>
 
 <p>
 Include this library by:
@@ -2630,7 +2630,7 @@
 
 
 
-<h3 heading><a name="table_lib">Table Manipulation</a></h3>
+<h3 heading><a name="table_lib" href="#table_lib">Table Manipulation</a></h3>
 
 <p>
 Include this library by:
@@ -2750,7 +2750,7 @@
 
 
 
-<h3 heading><a name="number_lib">Number Manipulation</a></h3>
+<h3 heading><a name="number_lib" href="#number_lib">Number Manipulation</a></h3>
 
 <p>
 Include this library by:
@@ -2791,7 +2791,7 @@
 
 
 
-<h3 heading><a name="math_lib">Mathematical Functions</a></h3>
+<h3 heading><a name="math_lib" href="#math_lib">Mathematical Functions</a></h3>
 
 <p>
 Include this library by:
--- a/website/src/site.css	Thu Feb 07 23:13:23 2019 -0700
+++ b/website/src/site.css	Fri Feb 08 00:45:31 2019 -0700
@@ -11,6 +11,9 @@
 a[href]:hover {
 	text-decoration: underline;
 }
+a[href]:visited {
+	color: #0000BB;
+}
 
 [small] {
 	font-size: small;