<ulclass="crumbs"><li><ahref="../index.html">Home</a></li><li><ahref="index.html">inweb</a></li><li><ahref="index.html#M">Manual</a></li><li><b>Making Weaves into Websites</b></li></ul></div>
<pclass="purpose">How to present one or more weaves on a shared website, for example using GitHub Pages.</p>
<ulclass="toc"><li><ahref="M-mwiw.html#SP1">§1. GitHub Pages</a></li><li><ahref="M-mwiw.html#SP2">§2. Colonies</a></li><li><ahref="M-mwiw.html#SP7">§7. The navigation sidebar</a></li><li><ahref="M-mwiw.html#SP10">§10. The trail of breadcrumbs</a></li><li><ahref="M-mwiw.html#SP11">§11. Adding custom HTML, CSS and such</a></li></ul><hrclass="tocbar">
<pclass="commentary firstcommentary"><aid="SP1"class="paragraph-anchor"></a><b>§1. GitHub Pages. </b>If a project is hosted at GitHub, then the GitHub Pages service is the ideal
<pclass="commentary">First, the simple case: our repository is a single web, called <spanclass="extract"><spanclass="extract-syntax">example</span></span>.
the installation of <spanclass="extract"><spanclass="extract-syntax">inweb</span></span> as well as <spanclass="extract"><spanclass="extract-syntax">example</span></span>. Then:
<pclass="commentary">will do the trick. (<spanclass="extract"><spanclass="ConsoleText-extract-syntax">GitHubPages</span></span> is a pattern refining the default <spanclass="extract"><spanclass="ConsoleText-extract-syntax">HTML</span></span> one.)
<pclass="commentary firstcommentary"><aid="SP2"class="paragraph-anchor"></a><b>§2. Colonies. </b>A collection of webs gathered in one place is, for want of a better word,
to share the same <spanclass="extract"><spanclass="ConsoleText-extract-syntax">docs</span></span> area. Now the problem to tackle is that we have two
or more webs in our <spanclass="extract"><spanclass="ConsoleText-extract-syntax">example</span></span> repository, one at <spanclass="extract"><spanclass="ConsoleText-extract-syntax">example/aleph</span></span>, the other
at <spanclass="extract"><spanclass="ConsoleText-extract-syntax">example/beth</span></span>.
<pclass="commentary">The idea is that <spanclass="extract"><spanclass="ConsoleText-extract-syntax">-member M</span></span> chooses <spanclass="extract"><spanclass="ConsoleText-extract-syntax">M</span></span> as the current web, and automatically
sets its default settings: <spanclass="extract"><spanclass="ConsoleText-extract-syntax">-weave-to</span></span>, <spanclass="extract"><spanclass="ConsoleText-extract-syntax">-weave-as</span></span>, <spanclass="extract"><spanclass="ConsoleText-extract-syntax">-navigation</span></span> and
<spanclass="extract"><spanclass="ConsoleText-extract-syntax">-breadcrumb</span></span> are all handled like this.
<pclass="commentary firstcommentary"><aid="SP3"class="paragraph-anchor"></a><b>§3. </b>These pathnames are taken relative to the current working directory of
<pclass="commentary">This overrides the default setting (just <spanclass="extract"><spanclass="extract-syntax">docs</span></span>), and is the path to the
<pclass="commentary firstcommentary"><aid="SP4"class="paragraph-anchor"></a><b>§4. </b>The use of a colony also enables cross-references from the weave of one
<pclass="commentary firstcommentary"><aid="SP5"class="paragraph-anchor"></a><b>§5. </b>As a more sustained example, here is the current version of the colony file
<pclass="commentary firstcommentary"><aid="SP6"class="paragraph-anchor"></a><b>§6. </b>The command <spanclass="extract"><spanclass="extract-syntax">assets X</span></span> tells Inweb to place "assets" such as images, CSS and
<pclass="commentary">Another convenience is <spanclass="extract"><spanclass="extract-syntax">patterns X</span></span>, which tells X that some unusual weave
<pclass="commentary firstcommentary"><aid="SP7"class="paragraph-anchor"></a><b>§7. The navigation sidebar. </b>When assembling large numbers of woven websites together, as is needed for
<pclass="commentary">This is why the <spanclass="extract"><spanclass="extract-syntax">GitHubPages</span></span> pattern has a navigation sidebar, to the left
<pclass="commentary firstcommentary"><aid="SP8"class="paragraph-anchor"></a><b>§8. </b>By default, Inweb looks for a file called <spanclass="extract"><spanclass="extract-syntax">nav.html</span></span> in two directories: the
<pclass="commentary">However, this can be overridden at the command line, with <spanclass="extract"><spanclass="extract-syntax">-navigation N</span></span>,
<pclass="commentary firstcommentary"><aid="SP9"class="paragraph-anchor"></a><b>§9. </b>Inweb in fact makes it easy to write such navigation files, providing
a list of items and submenus. <spanclass="extract"><spanclass="extract-syntax">[[Link "overview"]]</span></span> opens a link to the
colony item called <spanclass="extract"><spanclass="extract-syntax">overview</span></span>; <spanclass="extract"><spanclass="extract-syntax">[[URL "inweb"]]</span></span> writes a minimal-length
relative URL to reach the named directory, and <spanclass="extract"><spanclass="extract-syntax">[[Docs]]</span></span> to the home page
of the Github Docs area for the repository. <spanclass="extract"><spanclass="extract-syntax">[[Menu "External"]]</span></span> begins
a submenu among the items. <spanclass="extract"><spanclass="extract-syntax">[[Item "X"]]</span></span> makes a menu item whose title is
<spanclass="extract"><spanclass="extract-syntax">X</span></span> and which links to the colony item called <spanclass="extract"><spanclass="extract-syntax">X</span></span>; <spanclass="extract"><spanclass="extract-syntax">[[Item "Y" -> Z]]</span></span> is
more general, and makes the text <spanclass="extract"><spanclass="extract-syntax">Y</span></span> point to either an external web page,
recognised by beginning with <spanclass="extract"><spanclass="extract-syntax">http</span></span>, or else a web cross-reference. Thus:
<pclass="commentary">This icon should be in the <spanclass="extract"><spanclass="extract-syntax">docs</span></span> home of the repository. Note that the
<spanclass="extract"><spanclass="extract-syntax">GithubPages</span></span> pattern automatically includes the <spanclass="extract"><spanclass="extract-syntax">github.png</span></span> icon, so
<pclass="commentary firstcommentary"><aid="SP10"class="paragraph-anchor"></a><b>§10. The trail of breadcrumbs. </b>Inweb automatically adds web, chapter and section titles to the trail of
<pclass="commentary">where Home is a link to <spanclass="extract"><spanclass="extract-syntax">example/docs/index.html</span></span>. One way is to run Inweb
<pclass="commentary">We can add more than one, by, e.g., <spanclass="extract"><spanclass="extract-syntax">-breadcrumb 'Home:index.html' -breadcrumb 'Webs: webs.html'</span></span>.
<pclass="commentary firstcommentary"><aid="SP11"class="paragraph-anchor"></a><b>§11. Adding custom HTML, CSS and such. </b>This is done by creating a new pattern: see <ahref="M-awwp.html"class="internal">Advanced Weaving with Patterns</a>.