inweb-bootstrap/docs/inweb/M-htwaw.html

966 lines
57 KiB
HTML
Raw Normal View History

2019-02-04 22:26:45 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
2020-04-08 22:41:00 +00:00
<title>How to Write a Web</title>
2020-04-23 22:23:44 +00:00
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width initial-scale=1">
2019-02-04 22:26:45 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
2020-04-30 22:36:38 +00:00
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-25 10:33:39 +00:00
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-20 22:26:08 +00:00
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-22 11:31:01 +00:00
<link href="../docs-assets/Carousel.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script src="../docs-assets/Carousel.js"></script>
2020-04-20 22:26:08 +00:00
<script>
MathJax = {
2020-04-21 23:52:25 +00:00
tex: {
inlineMath: '$', '$'], ['\\(', '\\)'
},
svg: {
fontCache: 'global'
}
2020-04-20 22:26:08 +00:00
};
</script>
<script type="text/javascript" id="MathJax-script" async
2020-04-21 23:52:25 +00:00
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
2020-04-20 22:26:08 +00:00
</script>
2020-04-10 20:29:28 +00:00
2020-04-21 23:52:25 +00:00
<script src="http://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
2020-04-20 22:26:08 +00:00
2020-04-21 23:52:25 +00:00
<script src="../docs-assets/Bigfoot.js"></script>
2020-04-20 22:26:08 +00:00
<link href="../docs-assets/Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-21 16:55:17 +00:00
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-23 22:23:44 +00:00
2020-04-20 22:26:08 +00:00
</head>
2020-04-25 10:33:39 +00:00
<body class="commentary-font">
2020-04-20 22:26:08 +00:00
<nav role="navigation">
<h1><a href="../index.html">
<img src="../docs-assets/Octagram.png" width=72 height=72">
</a></h1>
<ul><li><a href="index.html"><span class="selectedlink">inweb</span></a></li>
</ul><h2>Foundation Module</h2><ul>
<li><a href="../foundation-module/index.html">foundation</a></li>
<li><a href="../foundation-test/index.html">foundation-test</a></li>
</ul><h2>Example Webs</h2><ul>
<li><a href="../goldbach/index.html">goldbach</a></li>
<li><a href="../twinprimes/twinprimes.html">twinprimes</a></li>
<li><a href="../eastertide/index.html">eastertide</a></li>
</ul><h2>Repository</h2><ul>
2020-04-20 22:34:44 +00:00
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=18> github</a></li>
2020-04-20 22:26:08 +00:00
</ul><h2>Related Projects</h2><ul>
<li><a href="../../../inform/docs/index.html">inform</a></li>
<li><a href="../../../intest/docs/index.html">intest</a></li>
</ul>
</nav>
<main role="main">
2020-04-23 22:23:44 +00:00
<!--Weave of 'How to Write a Web' generated by Inweb-->
2020-04-30 22:36:38 +00:00
<div class="breadcrumbs">
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#M">Manual</a></li><li><b>How to Write a Web</b></li></ul></div>
<p class="purpose">How to mark up code for literate programming.</p>
2020-04-20 22:26:08 +00:00
<ul class="toc"><li><a href="M-htwaw.html#SP1">&#167;1. The title of a section</a></li><li><a href="M-htwaw.html#SP2">&#167;2. Paragraphing</a></li><li><a href="M-htwaw.html#SP6">&#167;6. Conditional compilation</a></li><li><a href="M-htwaw.html#SP7">&#167;7. Commentary</a></li><li><a href="M-htwaw.html#SP12">&#167;12. Code samples and other extraneous matter</a></li><li><a href="M-htwaw.html#SP13">&#167;13. Links</a></li><li><a href="M-htwaw.html#SP14">&#167;14. Cross-references</a></li><li><a href="M-htwaw.html#SP19">&#167;19. Figures</a></li><li><a href="M-htwaw.html#SP20">&#167;20. Carousels</a></li><li><a href="M-htwaw.html#SP21">&#167;21. Video and audio</a></li><li><a href="M-htwaw.html#SP22">&#167;22. Embedded video and audio</a></li><li><a href="M-htwaw.html#SP24">&#167;24. Mathematics notation</a></li><li><a href="M-htwaw.html#SP25">&#167;25. Footnotes</a></li></ul><hr class="tocbar">
2020-04-20 22:26:08 +00:00
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP1"></a><b>&#167;1. The title of a section. </b>In any section file, there will be a few lines at the top which occur before
2020-04-20 22:26:08 +00:00
the first paragraph of code begins. (The first paragraph begins on the first
2020-04-22 22:57:09 +00:00
line which starts with an <span class="extract"><span class="extract-syntax">@</span></span> character.)
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">The first line should be the title of the section, followed by a full stop.
2020-04-20 22:26:08 +00:00
For example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> The Sieve of Eratosthenes.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">A section title must contain only filename-safe characters, and it's probably
2020-04-20 22:26:08 +00:00
wise to make them filename-safe on all platforms: so don't include either
kind of slash, or a colon, and in general go easy on punctuation marks.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Optionally, a section heading can also specify its own range abbreviation,
2020-04-20 22:26:08 +00:00
which must be given in round brackets and followed by a colon:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> (S/sieve): The Sieve of Eratosthenes.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">If this is not done (and usually it is not), Inweb will construct a range
2020-04-22 22:57:09 +00:00
abbreviation itself: in this case, it comes up with <span class="extract"><span class="extract-syntax">S/tsoe</span></span>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Subsequent lines of text are then taken as the optional description of the
2020-04-20 22:26:08 +00:00
purpose of the code in this section. (This is used on contents pages.) For
example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> A fairly fast way to determine if small numbers are prime, given storage.</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP2"></a><b>&#167;2. Paragraphing. </b>A standard paragraph is introduced with an <span class="extract"><span class="extract-syntax">@</span></span> command, which must place
2020-04-20 22:26:08 +00:00
that magic character in the first column of the line:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span><span class="plain-syntax"> This is some comment at the start of a new paragraph, which...</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">A fancier paragraph with a subheading attached is introduced using the
2020-04-22 22:57:09 +00:00
<span class="extract"><span class="extract-syntax">@h</span></span> or <span class="extract"><span class="extract-syntax">@heading</span></span> command instead. (This is simply a long and short version
2020-04-20 22:26:08 +00:00
of the same command.) The text of the subheading then follows, up to the
first full stop.
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@heading</span><span class="plain-syntax"> Reflections on the method.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Paragraphs can contain three ingredients, all optional, but if given then
2020-04-20 22:26:08 +00:00
given in this order: comment, definitions, and code. The following
example shows all three being used:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@h</span><span class="plain-syntax"> Primality.</span>
<span class="plain-syntax"> We provide this as a function which determines whether a number</span>
<span class="plain-syntax"> </span><span class="element-syntax">is prime</span><span class="plain-syntax">:</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> TRUE 1</span>
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> FALSE 0</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> =</span>
<span class="plain-syntax"> int isprime(int n) {</span>
<span class="plain-syntax"> if (n &lt;= 1) return FALSE;</span>
<span class="plain-syntax"> for (int m = 2; m*m &lt;= n; m++)</span>
<span class="plain-syntax"> if (n % m == 0)</span>
<span class="plain-syntax"> return FALSE;</span>
<span class="plain-syntax"> return TRUE;</span>
<span class="plain-syntax"> }</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP3"></a><b>&#167;3. </b>Definitions are made using one of three commands: <span class="extract"><span class="extract-syntax">@d</span></span> or <span class="extract"><span class="extract-syntax">@define</span></span>; or
2020-04-22 22:57:09 +00:00
<span class="extract"><span class="extract-syntax">@e</span></span> or <span class="extract"><span class="extract-syntax">@enum</span></span>; or <span class="extract"><span class="extract-syntax">@default</span></span>, which is rarely used and has no abbreviation.
2020-04-20 22:26:08 +00:00
These create new constants in the program, with the values given: they are
2020-04-22 22:57:09 +00:00
the equivalent of a <span class="extract"><span class="extract-syntax">#define</span></span> directive in C. <span class="extract"><span class="extract-syntax">@define</span></span> is the simpler form.
2020-04-20 22:26:08 +00:00
For example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@define</span><span class="plain-syntax"> ENIGMATIC_NUMBER 90125</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">sets <span class="extract"><span class="extract-syntax">ENIGMATIC_NUMBER</span></span> to 90125. Unlike in the C preprocessor, multi-line
2020-04-20 22:26:08 +00:00
definitions are automatically handled, so for example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span><span class="plain-syntax"> The following macro defines a function:</span>
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> EAT_FRUIT(variety)</span>
<span class="plain-syntax"> int consume_by_##variety(variety *frp) {</span>
<span class="plain-syntax"> return frp-&gt;eat_by_date;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> =</span>
<span class="plain-syntax"> banana my_banana; /* initialised somewhere else, let's suppose */</span>
<span class="plain-syntax"> EAT_FRUIT(banana) /* expands with the definition above */</span>
<span class="plain-syntax"> void consider_fruit(void) {</span>
<span class="plain-syntax"> printf("The banana has an eat-by date of %d.", consume_by_banana(&amp;my_banana));</span>
<span class="plain-syntax"> }</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">In fact, a definition continues until the next definition, or until the code
2020-04-20 22:26:08 +00:00
part of the paragraph begins, or until the paragraph ends, whichever comes
first.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Enumerations with <span class="extract"><span class="extract-syntax">@enum</span></span> are a convenience to define enumerated constants.
2020-04-20 22:26:08 +00:00
For example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@enum</span><span class="plain-syntax"> JANUARY_MNTH from 0</span>
<span class="plain-syntax"> </span><span class="function-syntax">@enum</span><span class="plain-syntax"> FEBRUARY_MNTH</span>
<span class="plain-syntax"> </span><span class="function-syntax">@enum</span><span class="plain-syntax"> MARCH_MNTH</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and so on, is equivalent to
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@define</span><span class="plain-syntax"> JANUARY_MNTH 0</span>
<span class="plain-syntax"> </span><span class="function-syntax">@define</span><span class="plain-syntax"> FEBRUARY_MNTH 1</span>
<span class="plain-syntax"> </span><span class="function-syntax">@define</span><span class="plain-syntax"> MARCH_MNTH 2</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">What happens is that <span class="extract"><span class="extract-syntax">@enum</span></span> looks at the tail of the name, from the last
2020-04-22 22:57:09 +00:00
underscore to the end: in this case, <span class="extract"><span class="extract-syntax">_MNTH</span></span>. The first time an enumerated
value is asked for with this tail, <span class="extract"><span class="extract-syntax">from</span></span> is used to specify the lowest
2020-04-20 22:26:08 +00:00
number to be used - in the above case, months begin counting from 0. With
2020-04-22 22:57:09 +00:00
each subsequent <span class="extract"><span class="extract-syntax">_MNTH</span></span> request, <span class="extract"><span class="extract-syntax">@enum</span></span> allocates the next unused value.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">All symbols defined with <span class="extract"><span class="extract-syntax">@define</span></span> or <span class="extract"><span class="extract-syntax">@enum</span></span> are global, and can be used
2020-04-20 22:26:08 +00:00
from anywhere in the web, including in sections or paragraphs earlier than
the ones in which they are defined. (The tangler automatically arranges code
as necessary to make this work.)
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">A symbol defined with <span class="extract"><span class="extract-syntax">@default</span></span> has the given value only if some other use
2020-04-22 22:57:09 +00:00
of <span class="extract"><span class="extract-syntax">@d</span></span> or <span class="extract"><span class="extract-syntax">@e</span></span> in the web has not already defined it. For example, if the
2020-04-20 22:26:08 +00:00
web contains:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@default</span><span class="plain-syntax"> MAX_HEADROOM 100</span>
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> MAX_HEADROOM 99</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">or
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> MAX_HEADROOM 99</span>
<span class="plain-syntax"> </span><span class="function-syntax">@default</span><span class="plain-syntax"> MAX_HEADROOM 100</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">then the value is 99, but if only
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@default</span><span class="plain-syntax"> MAX_HEADROOM 100</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">then the value is 100.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP4"></a><b>&#167;4. </b>Finally, a paragraph can contain code. This is introduced with an equals
2020-04-20 22:26:08 +00:00
sign: in some sense, the value of the paragraph is the code it contains.
In many paragraphs, as in the example above, the divider is just
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> =</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and this means that the rest of the paragraph is part of the program.
2020-04-20 22:26:08 +00:00
Ordinarily, this must appear in column 1, but a special abbreviation is
allowed for paragraphs with no comment and no definitions:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@ =</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This is exactly equivalent to:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> =</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">We can tell the tangler to place the code early in the tangled program,
2020-04-20 22:26:08 +00:00
rather than at its natural place in the sequence, by annotating
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (early code)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">instead of just <span class="extract"><span class="extract-syntax">=</span></span>. (This is occasionally useful where, for example, it's
2020-04-20 22:26:08 +00:00
necessary to create global variables which will be referred to in other
2020-04-22 22:57:09 +00:00
sections of code.) The more extreme <span class="extract"><span class="extract-syntax">= (very early code)</span></span> can be used in C
2020-04-20 22:26:08 +00:00
for complicated header file inclusions, but should be kept to an absolute
minimum, if only for clarity.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP5"></a><b>&#167;5. </b>One last feature, but it's the most important. Some code extracts are
2020-04-20 22:26:08 +00:00
given names, in angle brackets. If so, then the paragraph is the definition
of that extract. For example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Dramatic finale@&gt; =</span>
<span class="plain-syntax"> printf("I'm ruined! Ruined, I say!\n");</span>
<span class="plain-syntax"> exit(1);</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Notice that the equals sign is still there: it's just that the chunk of code
2020-04-22 22:57:09 +00:00
is given a name, written inside <span class="extract"><span class="extract-syntax">@&lt;</span></span> and <span class="extract"><span class="extract-syntax">@&gt;</span></span> "brackets". (This notation
2020-04-20 22:26:08 +00:00
goes all the way back to Knuth's original WEB.)
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">What does the tangler do with this? It doesn't place the code as the next
2020-04-22 22:57:09 +00:00
item in the program. Instead, it expands any mention of <span class="extract"><span class="extract-syntax">@&lt;Dramatic finale@&gt;</span></span>
2020-04-20 22:26:08 +00:00
elsewhere in the section with this block of code. It can be expanded as
many times as necessary, but only within the same section. Another section
2020-04-22 22:57:09 +00:00
would be quite free to define its own <span class="extract"><span class="extract-syntax">@&lt;Dramatic finale@&gt;</span></span>, but it would
2020-04-20 22:26:08 +00:00
not be able to see this one.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Why is this important? One of the points of literate programming is to
2020-04-20 22:26:08 +00:00
subdivide the program on conceptual lines, even within single functions.
For example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Perform the sieve@&gt; =</span>
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Start with all numbers from 2 upwards in the sieve@&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> for (int n=2; n*n &lt;= RANGE; n++)</span>
<span class="plain-syntax"> if (still_in_sieve[n])</span>
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Shake out multiples of n@&gt;</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> sieve_performed = TRUE;</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This is easier to understand than writing the function all in one go, and
2020-04-20 22:26:08 +00:00
more practicable than breaking it up into smaller functions.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Named paragraphs behave, in some ways, like macro definitions, and those
2020-04-20 22:26:08 +00:00
have a bad name nowadays - probably fairly. But Inweb makes them much
safer to use than traditional macros, because it tangles them into code
blocks, not just into runs of statements. A variable defined inside a
named paragraph has, as its scope, just that paragraph. And this:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> if (still_in_sieve[n])</span>
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Shake out multiples of n@&gt;</span><span class="plain-syntax">;</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">works safely because <span class="extract"><span class="extract-syntax">@&lt;Shake out multiples of n@&gt;</span></span> is, thanks to being a
2020-04-20 22:26:08 +00:00
code block, semantically a single statement.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Finally, note that if there are no commentary or definitions attached to
2020-04-22 22:57:09 +00:00
the paragraph then it's not necessary to type the initial <span class="extract"><span class="extract-syntax">@</span></span>. That is,
2020-04-20 22:26:08 +00:00
this:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Prepare to exit@&gt; =</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">...is not necessary, and it's sufficient to type just:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@&lt;Prepare to exit@&gt; =</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP6"></a><b>&#167;6. Conditional compilation. </b>In some languages, especially C, it's very hard to write a program which will
2020-04-20 22:26:08 +00:00
run on multiple operating systems without some use of conditional compilation:
2020-04-22 22:57:09 +00:00
that is, putting some code or definitions inside <span class="extract"><span class="extract-syntax">#ifdef</span></span> clauses or the like.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Inweb can't alter this sad fact of life, but it can make the process tidier.
2020-04-22 22:57:09 +00:00
If a paragraph has the tag <span class="extract"><span class="extract-syntax">^"ifdef-SYMBOL"</span></span>, then any material in it will
be tangled in such a way that it takes effect only if <span class="extract"><span class="extract-syntax">SYMBOL</span></span> is defined.
2020-04-20 22:26:08 +00:00
For example, in a C-language web with the paragraph:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@h</span><span class="plain-syntax"> Windows stuff. ^"ifdef-PLATFORM_WINDOWS"</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@d</span><span class="plain-syntax"> THREADS_AVAILABLE 12</span>
<span class="plain-syntax"> =</span>
<span class="plain-syntax"> void start_threads(int n) {</span>
<span class="plain-syntax"> ...</span>
<span class="plain-syntax"> }</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">...the definition of <span class="extract"><span class="extract-syntax">THREADS_AVAILABLE</span></span> and the function <span class="extract"><span class="extract-syntax">start_threads</span></span>
2020-04-22 22:57:09 +00:00
would be made only inside a <span class="extract"><span class="extract-syntax">#ifdef PLATFORM_WINDOWS</span></span> clause; the same would
happen for any typedefs or <span class="extract"><span class="extract-syntax">#include</span></span>s made.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Similarly, tagging a paragraph <span class="extract"><span class="extract-syntax">^"ifndef-SYMBOL"</span></span> causes it to have effect
2020-04-22 22:57:09 +00:00
only if <span class="extract"><span class="extract-syntax">SYMBOL</span></span> is undefined. A paragraph can have any number of such
2020-04-20 22:26:08 +00:00
conditions applied to it, and if so then all of the conditions must be met.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Note that since tags can be applied to entire sections of a web, at the
2020-04-20 22:26:08 +00:00
Contents listing, it's straightforward to give, say, two versions of a
section file, one with effect on MacOS, one with effect on Windows.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP7"></a><b>&#167;7. Commentary. </b>The comment part of a paragraph is ignored by the tangler, and appears only
2020-04-20 22:26:08 +00:00
in weaves. For the most part, the text is simply copied over verbatim: but
Inweb quietly tries to improve the appearance of what it copies, and a
few special notations are allowed, to help with this.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP8"></a><b>&#167;8. </b>A doubled hyphen becomes an em-rule; double-quotation marks automatically
2020-04-20 22:26:08 +00:00
smarten (in TeX format, at least).
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP9"></a><b>&#167;9. </b>Lines beginning with what look like bracketed list numbers or letters are
2020-04-20 22:26:08 +00:00
set as such, running on into little indented paragraphs. Thus
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> (a) Intellectual property has the shelf life of a banana. (Bill Gates)</span>
<span class="plain-syntax"> (b) He is the very pineapple of politeness! (Richard Brinsley Sheridan)</span>
<span class="plain-syntax"> (c) Harvard takes perfectly good plums as students, and turns them into</span>
<span class="plain-syntax"> prunes. (Frank Lloyd Wright)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">will be typeset thus:
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<ul class="items"><li>(a) Intellectual property has the shelf life of a banana. (Bill Gates)
</li><li>(b) He is the very pineapple of politeness! (Richard Brinsley Sheridan)
</li><li>(c) Harvard takes perfectly good plums as students, and turns them into
2020-04-20 22:26:08 +00:00
prunes. (Frank Lloyd Wright)
2020-04-24 23:06:02 +00:00
</li></ul>
<p class="commentary">A line which begins <span class="extract"><span class="extract-syntax">(...)</span></span> will be treated as a continuation of indented
2020-04-20 22:26:08 +00:00
matter (following on from some break-off such as a source quotation).
2020-04-22 22:57:09 +00:00
A line which begins <span class="extract"><span class="extract-syntax">(-X)</span></span> will be treated as if it were <span class="extract"><span class="extract-syntax">(X)</span></span>, but
2020-04-20 22:26:08 +00:00
indented one tab stop further in, like so:
</p>
2020-04-24 23:06:02 +00:00
<ul class="items"><li>(c) Harvard blah, blah, blah. (Frank Lloyd Wright)
<ul class="items"><li>(d) Pick a song and sing a yellow nectarine. (Scott Weiland)
</li></ul>
</li></ul>
<p class="commentary firstcommentary"><a id="SP10"></a><b>&#167;10. </b>Text placed between vertical strokes will be set in a fixed-space, code
2020-04-22 22:57:09 +00:00
style font, <span class="extract"><span class="extract-syntax">thus</span></span>. This paragraph appears in the web you are reading thus:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span><span class="plain-syntax"> Text placed between vertical strokes will be set in a fixed-space, code</span>
<span class="plain-syntax"> </span><span class="element-syntax">style font, |thus|. This paragraph appears in the web you are reading thus</span><span class="plain-syntax">:</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This notation may be inconvenient if you need the vertical stroke character
2020-04-20 22:26:08 +00:00
for something else, especially as the notation is used both in code comments
and in paragraph commentary. But both notations can be configured in the
Contents page of a web, thus:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="element-syntax">Code In Code Comments Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> Off</span>
<span class="element-syntax">Code In Commentary Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> %%</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This example would turn off the feature in code comments, but allow it in
2020-04-20 22:26:08 +00:00
paragraph commentary; we would then need to write...
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">@</span><span class="plain-syntax"> Text placed between vertical strokes will be set in a fixed-space, code</span>
<span class="plain-syntax"> </span><span class="element-syntax">style font, %%thus%%. This paragraph appears in the web you are reading thus</span><span class="plain-syntax">:</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP11"></a><b>&#167;11. </b>A line written thus:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> &gt;&gt; The monkey carries the blue scarf.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">is typeset as an extract of text thus:
2020-04-20 22:26:08 +00:00
</p>
<blockquote>
<p>The monkey carries the blue scarf.</p>
</blockquote>
2020-04-24 23:06:02 +00:00
<p class="commentary">(This is a feature used for Inform 7 "code" samples, those being essentially
2020-04-20 22:26:08 +00:00
natural language text.)
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP12"></a><b>&#167;12. Code samples and other extraneous matter. </b>When is code not code? When it's an extract of text being displayed for
2020-04-20 22:26:08 +00:00
documentation reasons, is the answer. We can include this like so:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (text)</span>
<span class="plain-syntax"> Here is my sample bit of text.</span>
<span class="plain-syntax"> = (undisplayed text)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This is assumed to be plain text, and is syntax-coloured (or rather, not)
2020-04-22 22:57:09 +00:00
as such, but otherwise it's woven as code. Using the word <span class="extract"><span class="extract-syntax">undisplayed</span></span>
before <span class="extract"><span class="extract-syntax">text</span></span> tells Inweb to do so less showily, on HTML weaves:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (undisplayed text)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Sometimes, though, we do want syntax colouring. If in fact it is a
2020-04-20 22:26:08 +00:00
hypothetical piece of code from the program &mdash; for example, a demonstration of
an API, but for reading and not to be compiled &mdash; we can instead write:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (text as code)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and the text will then be treated visually exactly as the surrounding
2020-04-20 22:26:08 +00:00
program is. If, on the other hand, it's a sample piece of code from a
different language altogether, we can specify which:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (text as ACME)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This will then be syntax-coloured following the rules for ACME (or any
2020-04-20 22:26:08 +00:00
other language supported by Inweb).
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Note that if your web is written in, for example, C, then these are
2020-04-20 22:26:08 +00:00
subtly different:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (text as C)</span>
<span class="plain-syntax"> = (text as code)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">The difference is that syntax-colouring in the first case doesn't know
2020-04-20 22:26:08 +00:00
the names of any surrounding functions or data structures; in the second
case, it knows the names of all those in your program.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Samples of code are, uniquely, allowed to end mid-way in a paragraph (unlike
2020-04-22 22:57:09 +00:00
real code): placing a <span class="extract"><span class="extract-syntax">=</span></span> on the left margin allows the commentary to resume.
2020-04-20 22:26:08 +00:00
For example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (text as ACME)</span>
<span class="plain-syntax"> BEQ .adjustXRegister</span>
<span class="plain-syntax"> =</span>
<span class="plain-syntax"> ...which is essential in order to restore the state of</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP13"></a><b>&#167;13. Links. </b>URLs in the web are automatically recognised and a weave to HTML will
2020-04-20 22:26:08 +00:00
make them into links. For example:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> For further reading, see: https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships.</span>
2020-04-20 22:26:08 +00:00
</pre>
<p class="commentary">For further reading, see: <a href="https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships" class="external">https://en.wikipedia.org/wiki/How_to_Avoid_Huge_Ships</a>.
2020-04-20 22:26:08 +00:00
</p>
<p class="commentary">Note that URLs are considered to continue to the next white space, except
that any final full stops, question or exclamation marks, commas, brackets,
semicolons, or colons are disregarded. (This is why the above sentence ended
with a full stop and yet the full stop wasn't part of the reference URL.)
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">URLs will also be recognised in any text extract marked as <span class="extract"><span class="extract-syntax">hyperlinked</span></span>.
2020-04-20 22:26:08 +00:00
For example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> Compare: https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes!</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">produces:
2020-04-20 22:26:08 +00:00
</p>
2020-04-11 12:08:53 +00:00
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> Compare: </span><a href="https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes!" class="external">https://en.wikipedia.org/wiki/Crocheting_Adventures_with_Hyperbolic_Planes!</a>
</pre>
<p class="commentary firstcommentary"><a id="SP14"></a><b>&#167;14. Cross-references. </b>These are like links, but are internal. These are normally written within <span class="extract"><span class="extract-syntax">//</span></span>
2020-04-20 22:26:08 +00:00
signs and are only available in the commentary of a web. They allow us to
place cross-references like so:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> To see how cross-references are implemented, see //Format Methods//,</span>
<span class="plain-syntax"> or more generally the whole of //Chapter 5//; to decipher the text,</span>
<span class="plain-syntax"> Inweb uses code from //foundation// at //foundation: Web Modules//.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">To see how cross-references are implemented, see <a href="5-fm.html" class="internal">Format Methods</a>,
2020-04-21 23:52:25 +00:00
or more generally the whole of <a href="5-wt.html" class="internal">Chapter 5: Formats</a>; to decipher the text,
Inweb uses code from <a href="../foundation-module/index.html" class="internal">foundation</a> at <a href="../foundation-module/8-wm.html" class="internal">Web Modules (in foundation)</a>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">What happened in that last sentence is that Inweb noticed the following:
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<ul class="items"><li>(a) "Format Methods" is the name of a section of code in the Inweb web;
</li><li>(b) The web also has a "Chapter 5";
</li><li>(c) It uses a module called "foundation";
</li><li>(d) And that module has a section called "Web Modules".
</li></ul>
<p class="commentary">Inweb then made links accordingly. Chapters, which can be referred to either
2020-04-20 22:26:08 +00:00
numerically, link to the first section in them; modules likewise. Errors are
thrown if these references to sections are in any way ambiguous. They are not
case sensitive.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP15"></a><b>&#167;15. </b>Sometimes we want to make a link without literally showing the destination.
2020-04-20 22:26:08 +00:00
This is simple: for example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> First //the program has to configure itself -&gt; Configuration//, then...</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">produces: "First <a href="1-cnf.html" class="internal">the program has to configure itself</a>,
2020-04-21 23:52:25 +00:00
then..."; the text "the program has to configure itself" links to <a href="1-cnf.html" class="internal">Configuration</a>.
This is especially useful if the destination is given as an explicit URL, which
is also allowed:
</p>
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> See //this biographical note -&gt; http://mathshistory.st-andrews.ac.uk/Biographies/Gauss.html//.</span>
</pre>
<p class="commentary">See <a href="http://mathshistory.st-andrews.ac.uk/Biographies/Gauss.html" class="external">this biographical note</a>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP16"></a><b>&#167;16. </b>It's also possible to reference function names and type names, provided that
2020-04-21 23:52:25 +00:00
the language definition supports these (see <a href="M-spl.html" class="internal">Supporting Programming Languages</a>):
2020-04-20 22:26:08 +00:00
this is certainly the case for C-like languages. For example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> Individual lines of a web are stored in //source_line// structures,</span>
<span class="plain-syntax"> and mostly created by //Reader::read_file//.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">produces: Individual lines of a web are stored in <a href="2-lc.html#SP1" class="internal">source_line</a> structures,
2020-04-21 23:52:25 +00:00
and mostly created by <a href="2-tr.html#SP6" class="internal">Reader::read_file</a>. And that should link to the
2020-04-20 22:26:08 +00:00
structure definition and function of these names inside the Inweb program.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Lastly, cross-references can even be made to webs quite separate from the
2020-04-20 22:26:08 +00:00
current one, but this requires the use of a Colony file.
2020-04-21 23:52:25 +00:00
See <a href="M-mwiw.html" class="internal">Making Weaves into Websites</a>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary firstcommentary"><a id="SP17"></a><b>&#167;17. </b>Cross-references also work inside text extracts marked as <span class="extract"><span class="extract-syntax">hyperlinked</span></span>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (hyperlinked text)</span>
<span class="plain-syntax"> See the //Manual// for more on this.</span>
<span class="plain-syntax"> =</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">produces:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 23:52:25 +00:00
<span class="plain-syntax"> See the </span><a href="M-iti.html" class="internal">Manual</a><span class="plain-syntax"> for more on this.</span>
2020-04-20 22:26:08 +00:00
</pre>
<p class="commentary firstcommentary"><a id="SP18"></a><b>&#167;18. </b>Cross-references must begin after white space, or a punctuation mark (other
than a colon), and must end to be followed by more white space or another
punctuation mark (this time allowing a colon). In practice, that reduces
the risk of misunderstanding a <span class="extract"><span class="extract-syntax">//</span></span> occurring in the commentary for some
other reason. All the same, you might want a different notation, so this
2020-04-20 22:26:08 +00:00
can be configured in the Contents page of a web, say like so:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="element-syntax">Cross-References Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> &amp;&amp;&amp;</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">It's also possible to disable cross-referencing entirely with:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="element-syntax">Cross-References Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> Off</span>
</pre>
<p class="commentary firstcommentary"><a id="SP19"></a><b>&#167;19. Figures. </b>Images to be included in weaves of a web are called "Figures", as they
2020-04-20 22:26:08 +00:00
would be in a printed book. These images should ideally be in PNG, JPG or PDF
2020-04-22 22:57:09 +00:00
format and placed in a subdirectory of the web called <span class="extract"><span class="extract-syntax">Figures</span></span>: for instance,
the weaver would seek <span class="extract"><span class="extract-syntax">Fig_2_3.pdf</span></span> at pathname <span class="extract"><span class="extract-syntax">Figures/Fig_2_3.pdf</span></span>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">To embed an image, we write like so:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (figure mars.jpg)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">With results like so:
2020-04-20 22:26:08 +00:00
</p>
<p class="center-p"><img src="mars.jpg" alt="mars.jpg"></p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Inweb also has some limited ability to control the dimensions of an image:
2020-04-22 11:31:01 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (figure Whatever.jpg at width 500)</span>
<span class="plain-syntax"> = (figure Something.jpg at height 2cm)</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Dimensions given in cm are scaled at 72 times dimensions given without a
2020-04-22 11:31:01 +00:00
measurement; in practice, rendering to TeX produces roughly the number of
centimeters asked for, and rendering to HTML makes the image width or height
correspond. If you really want to monkey with the aspect ratio,
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (figure Whatever.jpg at 20 by 100)</span>
</pre>
<p class="commentary firstcommentary"><a id="SP20"></a><b>&#167;20. Carousels. </b>A carousel is a slide-show of (usually but not always) figures; there's a
2020-04-22 11:31:01 +00:00
set of slides with captions, only one of which is visible at a time.
</p>
<div class="carousel-container" id="carousel-no-1">
<div class="carousel-slide fading-slide" style="display: block;">
<div class="carousel-number">1 / 4</div>
<div class="carousel-content"><p class="center-p"><img src="rah.jpg" alt="rah.jpg"></p>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-caption">Royal Albert Hall, London: King Crimson's 50th Anniversary Concert</div>
</div>
<div class="carousel-slide fading-slide" style="display: none;">
<div class="carousel-number">2 / 4</div>
<div class="carousel-content"><p class="center-p"><img src="brighton.jpg" alt="brighton.jpg"></p>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-caption">Brighton Beach</div>
</div>
<div class="carousel-slide fading-slide" style="display: none;">
<div class="carousel-number">3 / 4</div>
<div class="carousel-content"><p class="center-p"><img src="pula.jpg" alt="pula.jpg"></p>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-caption">Roman Amphitheatre, Pula</div>
</div>
<div class="carousel-slide fading-slide" style="display: none;">
<div class="carousel-number">4 / 4</div>
<div class="carousel-content"><p class="center-p"><img src="venice.jpg" alt="venice.jpg"></p>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-caption">St Mark's Basilica, Venice</div>
</div>
<a class="carousel-prev-button" onclick="carouselMoveSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, -1)">&#10094;</a>
<a class="carousel-next-button" onclick="carouselMoveSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, 1)">&#10095;</a>
</div>
<div class="carousel-dots-container" id="carousel-dots-no-1">
<span class="carousel-dot carousel-dot-active" onclick="carouselSetSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, 0)"></span>
<span class="carousel-dot" onclick="carouselSetSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, 1)"></span>
<span class="carousel-dot" onclick="carouselSetSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, 2)"></span>
<span class="carousel-dot" onclick="carouselSetSlide(&quot;carousel-no-1&quot;, &quot;carousel-dots-no-1&quot;, 3)"></span>
</div>
That carousel was produced by:
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (carousel "Royal Albert Hall, London: King Crimson's 50th Anniversary Concert")</span>
<span class="plain-syntax"> = (figure rah.jpg)</span>
<span class="plain-syntax"> = (carousel "Brighton Beach")</span>
<span class="plain-syntax"> = (figure brighton.jpg)</span>
<span class="plain-syntax"> = (carousel "Roman Amphitheatre, Pula")</span>
<span class="plain-syntax"> = (figure pula.jpg)</span>
<span class="plain-syntax"> = (carousel "St Mark's Basilica, Venice")</span>
<span class="plain-syntax"> = (figure venice.jpg)</span>
<span class="plain-syntax"> = (carousel end)</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">That carousel contained only figures, but almost any material can go into the
2020-04-22 11:31:01 +00:00
slides, paragraph breaks excepted. For example:
</p>
<div class="carousel-container" id="carousel-no-2">
<div class="carousel-slide fading-slide" style="display: block;">
<div class="carousel-caption-above">Stage 1 - Raw tree</div>
<div class="carousel-number-above">1 / 3</div>
2020-04-25 10:33:39 +00:00
<div class="carousel-content"><pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">ROOT</span><span class="plain-syntax"> ---&gt; </span><span class="function-syntax">DOCUMENT</span>
</pre>
</div>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-slide fading-slide" style="display: none;">
<div class="carousel-caption-above">Stage 2 - Developed tree</div>
<div class="carousel-number-above">2 / 3</div>
2020-04-25 10:33:39 +00:00
<div class="carousel-content"><pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">ROOT</span><span class="plain-syntax"> ---&gt; </span><span class="function-syntax">DOCUMENT</span>
<span class="plain-syntax"> |</span>
<span class="plain-syntax"> </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax"> --- </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax"> --- </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax"> --- ...</span>
</pre>
</div>
2020-04-22 11:31:01 +00:00
</div>
<div class="carousel-slide fading-slide" style="display: none;">
<div class="carousel-caption-above">Stage 3 - Completed tree</div>
<div class="carousel-number-above">3 / 3</div>
2020-04-25 10:33:39 +00:00
<div class="carousel-content"><pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> </span><span class="function-syntax">ROOT</span><span class="plain-syntax"> ---&gt; </span><span class="function-syntax">DOCUMENT</span>
<span class="plain-syntax"> |</span>
<span class="plain-syntax"> </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax"> --- </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax"> --- </span><span class="function-syntax">NODE</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax"> --- ...</span>
<span class="plain-syntax"> | | |</span>
<span class="plain-syntax"> </span><span class="element-syntax">text</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax"> </span><span class="element-syntax">text</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax"> </span><span class="element-syntax">text</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax"> ...</span>
</pre>
</div>
2020-04-22 11:31:01 +00:00
</div>
<a class="carousel-prev-button" onclick="carouselMoveSlide(&quot;carousel-no-2&quot;, &quot;carousel-dots-no-2&quot;, -1)">&#10094;</a>
<a class="carousel-next-button" onclick="carouselMoveSlide(&quot;carousel-no-2&quot;, &quot;carousel-dots-no-2&quot;, 1)">&#10095;</a>
</div>
<div class="carousel-dots-container" id="carousel-dots-no-2">
<span class="carousel-dot carousel-dot-active" onclick="carouselSetSlide(&quot;carousel-no-2&quot;, &quot;carousel-dots-no-2&quot;, 0)"></span>
<span class="carousel-dot" onclick="carouselSetSlide(&quot;carousel-no-2&quot;, &quot;carousel-dots-no-2&quot;, 1)"></span>
<span class="carousel-dot" onclick="carouselSetSlide(&quot;carousel-no-2&quot;, &quot;carousel-dots-no-2&quot;, 2)"></span>
</div>
This carousel has differently placed captions, too: that's because the
slide lines were typed as:
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (carousel "Stage 2 - Developed tree" above)</span>
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and the like. By default, a caption overlaps slightly with the content; but
2020-04-22 22:57:09 +00:00
it can also be <span class="extract"><span class="extract-syntax">above</span></span> or <span class="extract"><span class="extract-syntax">below</span></span>. A slide can also have no caption at all:
2020-04-22 11:31:01 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (carousel)</span>
<span class="plain-syntax"> = (figure anonymous.jpg)</span>
<span class="plain-syntax"> = (carousel)</span>
<span class="plain-syntax"> = (figure furtive.jpg)</span>
<span class="plain-syntax"> = (carousel end)</span>
</pre>
<p class="commentary firstcommentary"><a id="SP21"></a><b>&#167;21. Video and audio. </b>To include audio samples, place them as MP3 files in the subdirectory <span class="extract"><span class="extract-syntax">Audio</span></span>
2020-04-28 22:00:48 +00:00
of the web. For example, in the present web,
</p>
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> = (audio SP014.mp3)</span>
</pre>
<p class="commentary">produces Space Patrol episode 14, from 1953: "Brain Bank And Space Binoculars" &mdash;
</p>
<p class="center-p"><audio controls>
<source src="SP014.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</p>
<p class="commentary">Similarly,
</p>
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> = (video DW014.mp4)</span>
</pre>
<p class="commentary">produces Doctor Who episode 14, from 1963: "The Roof of the World". Still, video
takes up space, so for economy's sake a demonstration is omitted from this manual.
</p>
<p class="commentary firstcommentary"><a id="SP22"></a><b>&#167;22. Embedded video and audio. </b>One way to get around such space limitations is to embed players for video or
2020-04-28 22:00:48 +00:00
audio hosted on some external service. For example:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (embedded YouTube video GR3aImy7dWw)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">With results like so:
2020-04-20 22:26:08 +00:00
</p>
<p class="center-p"><iframe width="720" height="405" src="https://www.youtube.com/embed/GR3aImy7dWw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</p>
2020-04-20 22:26:08 +00:00
2020-04-24 23:06:02 +00:00
<p class="commentary">The YouTube ID number <span class="extract"><span class="extract-syntax">GR3aImy7dWw</span></span> can be read from its Share URL, which in
2020-04-22 22:57:09 +00:00
this case was <span class="extract"><span class="extract-syntax">https://youtu.be/GR3aImy7dWw</span></span>.
2020-04-20 22:26:08 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Similarly for Vimeo:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (embedded Vimeo video 204519)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">With results like so:
2020-04-20 22:26:08 +00:00
</p>
<p class="center-p"><iframe src="https://player.vimeo.com/video/204519" width="720" height="405" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</p>
2020-04-20 22:26:08 +00:00
2020-04-24 23:06:02 +00:00
<p class="commentary">For audio, you may like to try SoundCloud:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (embedded SoundCloud audio 42803139)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">With results like so:
2020-04-20 22:26:08 +00:00
</p>
<p class="center-p"><iframe width="100%" height="405" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/42803139&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
</p>
<p class="commentary firstcommentary"><a id="SP23"></a><b>&#167;23. </b>Adding width and height is straightforward; by default the dimensions are
2020-04-20 22:26:08 +00:00
720 by 405.
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> = (embedded Vimeo video 204519 at 400 by 300)</span>
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> = (embedded SoundCloud audio 42803139 at height 200)</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">The latter sets just the height (of the displayed waveform, that is &mdash;
2020-04-20 22:26:08 +00:00
arguably music has width and not height, but SoundCloud thinks otherwise).
</p>
<p class="commentary firstcommentary"><a id="SP24"></a><b>&#167;24. Mathematics notation. </b>Literate programming is a good technique to justify code which hangs on
2020-04-20 22:26:08 +00:00
unobvious pieces of mathematics or computer science, and which must therefore
be explained carefully. Formulae or equations are a real convenience for that.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">For example, it's known that the average running time of Euclid's GCD
2020-04-20 22:26:08 +00:00
algorithm on \(a\) and numbers coprime to \(a\) is:
$$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$
where \(C\) is Porter's constant,
2020-04-22 11:31:01 +00:00
$$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}}\left(4\gamma - {\frac {24}{\pi ^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$
2020-04-20 22:26:08 +00:00
which involves evaluating Euler's constant \(\gamma\) and the first derivative
of the Riemann zeta function \(\zeta'(z)\) at \(z=2\).
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">That passage was achieved by typing this as the Inweb source:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> For example, it's known that the average running time of Euclid's GCD</span>
<span class="plain-syntax"> </span><span class="element-syntax">algorithm on $a$ and numbers coprime to $a$ is</span><span class="plain-syntax">:</span>
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> $$ \tau (a)={\frac {12}{\pi ^{2}}}\ln 2\ln a+C+O(a^{-1/6-\varepsilon }) $$</span>
<span class="plain-syntax"> where $C$ is Porter's constant,</span>
2020-04-22 11:31:01 +00:00
<span class="plain-syntax"> $$ C=-{\frac {1}{2}}+{\frac {6\ln 2}{\pi ^{2}}} \left(4\gamma - {\frac {24}{\pi^{2}}}\zeta'(2)+3\ln 2-2\right)\approx 1.467 $$</span>
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> which involves evaluating Euler's constant $\gamma$ and the first derivative</span>
<span class="plain-syntax"> of the Riemann zeta function $\zeta'(z)$ at $z=2$.</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Mathematical formulae is typed in TeX notation between dollar signs,
2020-04-22 22:57:09 +00:00
as usual for TeX formulae. If those notations are inconvenient, they can be
changed. The defaults are:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-22 22:57:09 +00:00
<span class="plain-syntax"> </span><span class="element-syntax">TeX Mathematics Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> $</span>
<span class="plain-syntax"> </span><span class="element-syntax">TeX Mathematics Displayed Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> $$</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Changing these to <span class="extract"><span class="extract-syntax">None</span></span> causes Inweb to disregard mathematics entirely, and
2020-04-22 22:57:09 +00:00
treat it as any other text would be treated.
2020-04-20 22:26:08 +00:00
</p>
<p class="commentary firstcommentary"><a id="SP25"></a><b>&#167;25. Footnotes. </b>Not everyone likes footnotes,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> but sometimes they're a tidy way to make
2020-04-20 22:26:08 +00:00
references.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>
</p>
<ul class="footnotetexts"><li class="footnote" id="fn:1"><p class="inwebfootnote"><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> But see Anthony Grafton, "The Footnote: A Curious History" (Harvard
University Press, 1999).
<a href="#fnref:1" title="return to text"> &#x21A9;</a></p></li><li class="footnote" id="fn:2"><p class="inwebfootnote"><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> For example, to cite Donald Knuth, "Evaluation of Porter's constant",
Computers &amp; Mathematics with Applications, 2, 137-39 (1976).
<a href="#fnref:2" title="return to text"> &#x21A9;</a></p></li></ul>
<p class="commentary firstcommentary"><a id="SP26"></a><b>&#167;26. </b>The content of that sentence was typed as follows:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> Not everyone likes footnotes,[1] but sometimes they're a tidy way to make</span>
<span class="plain-syntax"> references.[2]</span>
2020-04-20 22:26:08 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="identifier-syntax">[1]</span><span class="plain-syntax"> But see Anthony Grafton, "The Footnote: A Curious History" (Harvard</span>
<span class="plain-syntax"> University Press, 1999).</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">[2]</span><span class="plain-syntax"> For example, to cite Donald Knuth, "Evaluation of Porter's constant",</span>
<span class="plain-syntax"> Computers &amp; Mathematics with Applications, 2, 137-39 (1976).</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Note that footnotes should be numbered upwards from 1 in each individual
2020-04-20 22:26:08 +00:00
paragraph; Inweb automatically renumbers them for each woven section, but
we don't have to worry about that when typing.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">If you're reading this as a web page (with Javascript on), then you should
2020-04-20 22:26:08 +00:00
have seen clickable footnote blobs, which reveal the text. If Javascript is
off, there's a more conventionally textual presentation.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Once again, notation may be an issue, and so it's controllable. By default,
2020-04-20 22:26:08 +00:00
we have:
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="element-syntax">Footnote Begins Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> [</span>
<span class="plain-syntax"> </span><span class="element-syntax">Footnote Ends Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> ]</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">but if you need squares for something else in your commentary, then perhaps:
2020-04-20 22:26:08 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="plain-syntax"> </span><span class="element-syntax">Footnote Begins Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> [fn</span>
<span class="plain-syntax"> </span><span class="element-syntax">Footnote Ends Notation</span><span class="plain-syntax">:</span><span class="string-syntax"> ]</span>
2020-04-20 22:26:08 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">would be sensible. The "cue" between these notations is required to be a
2020-04-20 22:26:08 +00:00
string of digits; each must occur just once in its section; and each must
have a text and a cue which match up correctly.
</p>
2020-04-30 22:36:38 +00:00
<nav role="progress"><div class="progresscontainer">
<ul class="progressbar"><li class="progressprev"><a href="M-wtaw.html">&#10094;</a></li><li class="progresscurrentchapter">M</li><li class="progresssection"><a href="M-iti.html">iti</a></li><li class="progresssection"><a href="M-wtaw.html">wtaw</a></li><li class="progresscurrent">htwaw</li><li class="progresssection"><a href="M-mwiw.html">mwiw</a></li><li class="progresssection"><a href="M-awwp.html">awwp</a></li><li class="progresssection"><a href="M-spl.html">spl</a></li><li class="progresssection"><a href="M-tid.html">tid</a></li><li class="progresssection"><a href="M-rc.html">rc</a></li><li class="progresschapter"><a href="P-htpw.html">P</a></li><li class="progresschapter"><a href="1-bsc.html">1</a></li><li class="progresschapter"><a href="2-tr.html">2</a></li><li class="progresschapter"><a href="3-ta.html">3</a></li><li class="progresschapter"><a href="4-pl.html">4</a></li><li class="progresschapter"><a href="5-wt.html">5</a></li><li class="progresschapter"><a href="6-mkf.html">6</a></li><li class="progressnext"><a href="M-mwiw.html">&#10095;</a></li></ul></div>
</nav><!--End of weave-->
2020-04-23 22:23:44 +00:00
</main>
2019-02-04 22:26:45 +00:00
</body>
</html>