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

336 lines
23 KiB
HTML
Raw Normal View History

2020-04-13 16:06:45 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Making Weaves into Websites</title>
2020-04-23 22:23:44 +00:00
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-13 16:06:45 +00:00
<meta name="viewport" content="width=device-width initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
2020-04-20 22:26:08 +00:00
<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
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">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-21 16:55:17 +00:00
<link href="../docs-assets/ConsoleText-Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-23 22:23:44 +00:00
2020-04-13 16:06:45 +00:00
</head>
2020-04-25 10:33:39 +00:00
<body class="commentary-font">
2020-04-13 16:06:45 +00:00
<nav role="navigation">
<h1><a href="../index.html">
2020-04-20 22:26:08 +00:00
<img src="../docs-assets/Octagram.png" width=72 height=72">
2020-04-13 16:06:45 +00:00
</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>
2020-04-15 22:45:08 +00:00
<li><a href="../eastertide/index.html">eastertide</a></li>
2020-04-14 17:36:42 +00:00
</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-14 17:36:42 +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>
2020-04-13 16:06:45 +00:00
</ul>
</nav>
<main role="main">
2020-04-23 22:23:44 +00:00
<!--Weave of 'Making Weaves into Websites' 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>Making Weaves into Websites</b></li></ul></div>
<p class="purpose">How to present one or more weaves on a shared website, for example using GitHub Pages.</p>
2020-04-13 16:06:45 +00:00
2020-04-22 22:57:09 +00:00
<ul class="toc"><li><a href="M-mwiw.html#SP1">&#167;1. GitHub Pages</a></li><li><a href="M-mwiw.html#SP2">&#167;2. Colonies</a></li><li><a href="M-mwiw.html#SP7">&#167;7. The navigation sidebar</a></li><li><a href="M-mwiw.html#SP10">&#167;10. The trail of breadcrumbs</a></li><li><a href="M-mwiw.html#SP11">&#167;11. Adding custom HTML, CSS and such</a></li></ul><hr class="tocbar">
2020-04-13 16:06:45 +00:00
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. GitHub Pages. </b>If a project is hosted at GitHub, then the GitHub Pages service is the ideal
2020-04-22 22:57:09 +00:00
place to serve a woven copy of the project to the world: the <span class="extract"><span class="extract-syntax">docs</span></span> subdirectory
2020-04-13 16:06:45 +00:00
of a repository is simply served as a website, once this is enabled from the
owner's Github control panel.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">First, the simple case: our repository is a single web, called <span class="extract"><span class="extract-syntax">example</span></span>.
2020-04-13 16:06:45 +00:00
We suppose that the current working directory is one up from this, and contains
2020-04-22 22:57:09 +00:00
the installation of <span class="extract"><span class="extract-syntax">inweb</span></span> as well as <span class="extract"><span class="extract-syntax">example</span></span>. Then:
2020-04-13 16:06:45 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">ls</span>
<span class="ConsoleText-plain-syntax"> inweb example</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> example</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> GitHubPages</span><span class="ConsoleText-identifier-syntax"> -weave-into</span><span class="ConsoleText-plain-syntax"> example/docs</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">will do the trick. (<span class="extract"><span class="ConsoleText-extract-syntax">GitHubPages</span></span> is a pattern refining the default <span class="extract"><span class="ConsoleText-extract-syntax">HTML</span></span> one.)
2020-04-13 16:06:45 +00:00
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Colonies. </b>A collection of webs gathered in one place is, for want of a better word,
2020-04-13 16:06:45 +00:00
called a "colony". (Some social species of spiders form colonies, and share
webs which are collectively woven.)
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Inweb provides support for colonies, and this enables us to manage the more
2020-04-13 16:06:45 +00:00
complicated case where there are multiple webs in a repository, but which need
2020-04-22 22:57:09 +00:00
to share the same <span class="extract"><span class="ConsoleText-extract-syntax">docs</span></span> area. Now the problem to tackle is that we have two
or more webs in our <span class="extract"><span class="ConsoleText-extract-syntax">example</span></span> repository, one at <span class="extract"><span class="ConsoleText-extract-syntax">example/aleph</span></span>, the other
at <span class="extract"><span class="ConsoleText-extract-syntax">example/beth</span></span>.
2020-04-13 16:06:45 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">The first thing to do is to write a colony file &mdash; we could put this anywhere
2020-04-22 22:57:09 +00:00
in the repository, but let's say at <span class="extract"><span class="ConsoleText-extract-syntax">example/colony.txt</span></span>:
2020-04-13 16:06:45 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="ConsoleText-plain-syntax"> pattern: GitHubPages</span>
<span class="ConsoleText-plain-syntax"> web: "aleph" at "example/aleph" in "example/docs/aleph"</span>
<span class="ConsoleText-plain-syntax"> web: "beth" at "example/beth" in "example/docs/beth"</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This is, in effect, a set of presets of Inweb's command-line settings. We can
2020-04-13 16:06:45 +00:00
now write, for example,
</p>
2020-04-25 10:33:39 +00:00
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-identifier-syntax"> -colony</span><span class="ConsoleText-plain-syntax"> example/colony.txt</span><span class="ConsoleText-identifier-syntax"> -member</span><span class="ConsoleText-plain-syntax"> beth</span><span class="ConsoleText-identifier-syntax"> -weave</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and this is equivalent to
2020-04-13 16:06:45 +00:00
</p>
2020-04-25 10:33:39 +00:00
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
2020-04-21 16:55:17 +00:00
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> example/beth</span><span class="ConsoleText-identifier-syntax"> -weave -weave-into</span><span class="ConsoleText-plain-syntax"> example/docs/beth</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> GitHubPages</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">The idea is that <span class="extract"><span class="ConsoleText-extract-syntax">-member M</span></span> chooses <span class="extract"><span class="ConsoleText-extract-syntax">M</span></span> as the current web, and automatically
2020-04-22 22:57:09 +00:00
sets its default settings: <span class="extract"><span class="ConsoleText-extract-syntax">-weave-to</span></span>, <span class="extract"><span class="ConsoleText-extract-syntax">-weave-as</span></span>, <span class="extract"><span class="ConsoleText-extract-syntax">-navigation</span></span> and
<span class="extract"><span class="ConsoleText-extract-syntax">-breadcrumb</span></span> are all handled like this.
2020-04-13 16:06:45 +00:00
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>These pathnames are taken relative to the current working directory of
2020-04-21 23:52:25 +00:00
the user (not to the location of the colony file). For <a href="index.html" class="internal">inweb</a>, this
2020-04-14 17:36:42 +00:00
is conventionally the directory above the actual web, and that's why the
file needs to say:
</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"> home: inweb/docs</span>
2020-04-14 17:36:42 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This overrides the default setting (just <span class="extract"><span class="extract-syntax">docs</span></span>), and is the path to the
2020-04-14 17:36:42 +00:00
home page of the Github Docs area for the repository.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The use of a colony also enables cross-references from the weave of one
2020-04-13 16:06:45 +00:00
web to the weave of another, even when they are independent programs. For
2020-04-22 22:57:09 +00:00
example, a section of code in <span class="extract"><span class="extract-syntax">beth</span></span> could say:
2020-04-13 16:06:45 +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"> Handling file system problems is more of a job for //aleph// than</span>
<span class="plain-syntax"> for us, so we'll just proceed. (See //aleph: Error Recovery//.)</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">and these links would both work. Without the use of a colony file, neither
2020-04-22 22:57:09 +00:00
one could be recognised, because Inweb wouldn't know what <span class="extract"><span class="extract-syntax">aleph</span></span> even was.
2020-04-21 23:52:25 +00:00
To demonstrate that right here, see <a href="../goldbach/S-tsoe.html" class="internal">The Sieve of Eratosthenes (in goldbach)</a>.
2020-04-13 16:06:45 +00:00
That last sentence was typed as:
</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 demonstrate that right here, see //goldbach: The Sieve of Eratosthenes//.</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">Cross-references to other webs or modules in the same colony can be to chapters
2020-04-21 23:52:25 +00:00
or sections, or simply to the entire web in question &mdash; see <a href="../goldbach/index.html" class="internal">goldbach</a> &mdash;
2020-04-13 16:06:45 +00:00
but not to functions or types in those webs: that would require Inweb to read
every web in the colony into memory, which would slow it down too much.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>As a more sustained example, here is the current version of the colony file
2020-04-13 16:06:45 +00:00
for the Inweb repository:
</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">home: inweb/docs</span>
<span class="plain-syntax">assets: inweb/docs/docs-assets</span>
2020-04-14 17:36:42 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax">navigation: inweb/docs-src/nav.html</span>
<span class="plain-syntax">pattern: GitHubPages</span>
2020-04-13 22:32:29 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax">breadcrumbs: none</span>
<span class="plain-syntax">web: "overview" at "inweb/docs-src/index.inweb" in "inweb/docs"</span>
2020-04-13 16:06:45 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax">breadcrumbs: "Home: //overview//"</span>
<span class="plain-syntax">web: "inweb" at "inweb" in "inweb/docs/inweb"</span>
<span class="plain-syntax">module: "foundation" at "inweb/foundation-module" in "inweb/docs/foundation-module"</span>
<span class="plain-syntax">web: "foundation-test" at "inweb/foundation-test" in "inweb/docs/foundation-test"</span>
<span class="plain-syntax">web: "goldbach" at "inweb/Examples/goldbach" in "inweb/docs/goldbach"</span>
<span class="plain-syntax">web: "twinprimes" at "inweb/Examples/twinprimes.inweb" in "inweb/docs/twinprimes"</span>
<span class="plain-syntax">web: "eastertide" at "inweb/Examples/eastertide" in "inweb/docs/eastertide"</span>
2020-04-14 17:36:42 +00:00
2020-04-21 16:55:17 +00:00
<span class="plain-syntax">web: "intest" at "intest" in "intest/docs"</span>
<span class="plain-syntax">web: "inform" at "inform/docs-src/index.inweb" in "inform/docs"</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">As this demonstrates, either webs, or modules, or both, can be declared.
2020-04-13 16:06:45 +00:00
Each one gives (a) a short name, (b) a location relative to the current
working directory, and (c) a similar location for its woven collection of
files. The file can also specify navigation and breadcrumbs material, and
the pattern; each of these applies to each subsequent declaration until the
2020-04-22 22:57:09 +00:00
setting in question changes again. (Setting to <span class="extract"><span class="extract-syntax">none</span></span> removes them.)
2020-04-13 16:06:45 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Also notable here is that the colony contains a single-page web called
2020-04-22 22:57:09 +00:00
<span class="extract"><span class="extract-syntax">index.inweb</span></span>. (You can see that it's a single-page web, rather than something
more substantial, because the location ends <span class="extract"><span class="extract-syntax">.inweb</span></span> rather than being a
directory name.) The point of this web is that it weaves to the <span class="extract"><span class="extract-syntax">index.html</span></span>
2020-04-13 16:06:45 +00:00
home page; it's referred to in links as being the "overview", because that's
its name as a web.
</p>
2020-08-19 21:46:20 +00:00
<p class="commentary">Presentationally, it may look better if paragraph numbers are omitted from
these all-in-one webs used just to make top-level description pages. This
can be done by adding
</p>
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">Paragraph Numbers Visibility: Off</span>
</pre>
<p class="commentary">to the metadata for the all-in-one web.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>The command <span class="extract"><span class="extract-syntax">assets X</span></span> tells Inweb to place "assets" such as images, CSS and
2020-04-22 22:57:09 +00:00
JavaScript files which are needed by plugins (see <a href="M-awwp.html" class="internal">Advanced Weaving with Patterns</a>)
into the directory <span class="extract"><span class="extract-syntax">X</span></span>. In practice, this avoids a great deal of duplication:
if there are 30 webs in the colony, there's no need for each to have its own
copy of the same CSS files for the basic page makeup. (But that is what will
indeed happen if the <span class="extract"><span class="extract-syntax">assets</span></span> command is not used.)
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">Another convenience is <span class="extract"><span class="extract-syntax">patterns X</span></span>, which tells X that some unusual weave
2020-04-22 22:57:09 +00:00
patterns can be found in directory <span class="extract"><span class="extract-syntax">X</span></span>. That's useful if multiple webs in
the colony need to use the same pattern, and the pattern isn't one which is
built in the Inweb.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. The navigation sidebar. </b>When assembling large numbers of woven websites together, as is needed for
2020-04-13 16:06:45 +00:00
example by the main Inform repository's GitHub pages, we need to navigate
externally as well as internally: that is, the page for one tool will need
a way to link to pages for other tools.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">This is why the <span class="extract"><span class="extract-syntax">GitHubPages</span></span> pattern has a navigation sidebar, to the left
2020-04-13 16:06:45 +00:00
of the main part of each page. The template file contains a special expansion
2020-04-22 22:57:09 +00:00
written <span class="extract"><span class="extract-syntax">[[Navigation]]</span></span>, and this expands to the HTML for a column of links.
2020-04-13 16:06:45 +00:00
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">The pattern also has a row of breadcrumbs along the top, for navigation within
2020-04-13 16:06:45 +00:00
the current web.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>By default, Inweb looks for a file called <span class="extract"><span class="extract-syntax">nav.html</span></span> in two directories: the
2020-04-13 16:06:45 +00:00
one above the destination, and the destination. If both exist, they are both
used. If neither exists, the expansion is empty, but no error is produced.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">However, this can be overridden at the command line, with <span class="extract"><span class="extract-syntax">-navigation N</span></span>,
2020-04-22 22:57:09 +00:00
where <span class="extract"><span class="extract-syntax">N</span></span> is the filename for a suitable fragment of navigation HTML, and
2020-04-13 16:06:45 +00:00
it can also be preset in the Colony file (see above).
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>Inweb in fact makes it easy to write such navigation files, providing
2020-04-13 16:06:45 +00:00
commands which mean that little HTML need be written at all. This is the
one which generates the sidebar visible to the left of the pages on the
2020-04-22 22:57:09 +00:00
Inweb <span class="extract"><span class="extract-syntax">docs</span></span> site:
2020-04-13 16:06:45 +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">&lt;h1&gt;[[Link "overview"]]</span>
<span class="plain-syntax">&lt;img src="[[Docs]]docs-assets/Octagram.png" width=72 height=72"&gt;</span>
<span class="plain-syntax">&lt;/a&gt;&lt;/h1&gt;</span>
<span class="plain-syntax">[[Item "inweb"]]</span>
<span class="plain-syntax">[[Menu "Foundation Module"]]</span>
<span class="plain-syntax">[[Item "foundation"]]</span>
<span class="plain-syntax">[[Item "foundation-test"]]</span>
<span class="plain-syntax">[[Menu "Example Webs"]]</span>
<span class="plain-syntax">[[Item "goldbach"]]</span>
<span class="plain-syntax">[[Item "twinprimes"]]</span>
<span class="plain-syntax">[[Item "eastertide"]]</span>
<span class="plain-syntax">[[Menu "Repository"]]</span>
<span class="plain-syntax">[[Item "&lt;github.png&gt; github" -&gt; https://github.com/ganelson/inweb]]</span>
<span class="plain-syntax">[[Menu "Related Projects"]]</span>
<span class="plain-syntax">[[Item "inform"]]</span>
<span class="plain-syntax">[[Item "intest"]]</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">As this shows, there's some HTML for the top left corner area, and then
2020-04-22 22:57:09 +00:00
a list of items and submenus. <span class="extract"><span class="extract-syntax">[[Link "overview"]]</span></span> opens a link to the
colony item called <span class="extract"><span class="extract-syntax">overview</span></span>; <span class="extract"><span class="extract-syntax">[[URL "inweb"]]</span></span> writes a minimal-length
relative URL to reach the named directory, and <span class="extract"><span class="extract-syntax">[[Docs]]</span></span> to the home page
of the Github Docs area for the repository. <span class="extract"><span class="extract-syntax">[[Menu "External"]]</span></span> begins
a submenu among the items. <span class="extract"><span class="extract-syntax">[[Item "X"]]</span></span> makes a menu item whose title is
<span class="extract"><span class="extract-syntax">X</span></span> and which links to the colony item called <span class="extract"><span class="extract-syntax">X</span></span>; <span class="extract"><span class="extract-syntax">[[Item "Y" -&gt; Z]]</span></span> is
more general, and makes the text <span class="extract"><span class="extract-syntax">Y</span></span> point to either an external web page,
recognised by beginning with <span class="extract"><span class="extract-syntax">http</span></span>, or else a web cross-reference. Thus:
2020-04-13 16:06:45 +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"> [[Item "innards" -&gt; //inweb: Programming Languages//]]</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">would make a menu item called "innards" leading to a section in Chapter 4
2020-04-13 16:06:45 +00:00
of the Inweb source.
</p>
2020-04-24 23:06:02 +00:00
<p class="commentary">An item text can begin or end with an icon name, in angle brackets. For
2020-04-14 19:29:03 +00:00
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"> [[Item "&lt;github.png&gt; github" -&gt; https://github.com/ganelson/intest]]</span>
2020-04-14 19:29:03 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">This icon should be in the <span class="extract"><span class="extract-syntax">docs</span></span> home of the repository. Note that the
2020-04-22 22:57:09 +00:00
<span class="extract"><span class="extract-syntax">GithubPages</span></span> pattern automatically includes the <span class="extract"><span class="extract-syntax">github.png</span></span> icon, so
2020-04-14 19:29:03 +00:00
that one's guaranteed to be present.
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. The trail of breadcrumbs. </b>Inweb automatically adds web, chapter and section titles to the trail of
2020-04-13 16:06:45 +00:00
breadcrumbs above each page: 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">Beth &gt; Chapter 4 &gt; File Organisation</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">That may be sufficient in itself. However, it's possible to add extra
2020-04-13 16:06:45 +00:00
crumbs to the left. Suppose we want:
</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">Home &gt; Beth &gt; Chapter 4 &gt; File Organisation</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">where Home is a link to <span class="extract"><span class="extract-syntax">example/docs/index.html</span></span>. One way is to run Inweb
2020-04-22 22:57:09 +00:00
with <span class="extract"><span class="extract-syntax">-breadcrumb 'Home:index.html'</span></span>; another is to add this to the Colony
2020-04-13 16:06:45 +00:00
file, as
</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"> breadcrumbs: "Home: index.html"</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">We can add more than one, by, e.g., <span class="extract"><span class="extract-syntax">-breadcrumb 'Home:index.html' -breadcrumb 'Webs: webs.html'</span></span>.
2020-04-13 16:06:45 +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"> breadcrumbs: "Home: index.html" &gt; "Webs: webs.html"</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">The links after the colon can also be Inweb cross-references, so, for example,
2020-04-13 16:06:45 +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"> breadcrumbs: "Overview: //overview//"</span>
2020-04-13 16:06:45 +00:00
</pre>
2020-04-24 23:06:02 +00:00
<p class="commentary">makes a link to the web/module called <span class="extract"><span class="extract-syntax">overview</span></span> in the colony file.
2020-04-22 22:57:09 +00:00
</p>
2020-08-16 17:39:53 +00:00
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Adding custom HTML, CSS and such. </b>This is done by creating a new pattern: see <a href="M-awwp.html" class="internal">Advanced Weaving with Patterns</a>.
2020-04-13 16:06:45 +00:00
</p>
2020-04-30 22:36:38 +00:00
<nav role="progress"><div class="progresscontainer">
<ul class="progressbar"><li class="progressprev"><a href="M-htwaw.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="progresssection"><a href="M-htwaw.html">htwaw</a></li><li class="progresscurrent">mwiw</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-awwp.html">&#10095;</a></li></ul></div>
</nav><!--End of weave-->
2020-04-23 22:23:44 +00:00
2020-04-13 16:06:45 +00:00
</main>
</body>
</html>