expoweb/handbook/computing/hbmanual1.html

161 lines
12 KiB
HTML
Raw Normal View History

2020-04-10 13:09:12 +01:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CUCC Expedition Handbook: editing the handbook</title>
2024-02-08 18:34:01 +00:00
<link rel="stylesheet" type="text/css" href=/css/main2.css />
2020-04-10 13:09:12 +01:00
</head>
<body>
<h2 id="tophead">CUCC Expedition Manuals - Editing the Handbook</h2>
<h1>Editing the Handbook (1)</h1>
<h2>Handbook editing manual</h2>
<p>These pages are for cavers wanting to:
<ol>
<li>quickly edit a correction using "Edit this Page", or
<li>edit several pages while sitting at the <em>expo laptop</em>
<li>edit several pages using their own laptop
</ol>
<h3 id="editthispage">"Edit this page"</h3>
<p>You can update a single webpage
online via a browser. This is best for urgent edits to a single page, e.g.
if the emergency phone at top-camp has to use a new SIM with a different phone number.
<p>You can edit web pages without installing any software or doing any configuration. It even works if your laptop is a Mac.
To use it you need to <a href="/accounts/login/">log in to troggle</a> using the well-known "cavey:beery" password. You generally only need to do this once.
<p>When you are a logged-on user you will see "Edit this page" at the bottom of the menu on the top-left of this page. It appears on
nearly all pages in this website. If you click on it you will be able to edit the content of the page.
<img class="onright" alt="gosser bier" src="../i/editthispage.jpg" />
<p>The image shows what it looks like when editing the "bierbook" page. There is a menu bar along the top of the panel where you can select the usual word-processing commands to make text <b>bold</b> or <em>italic</em> and to select syles such as headings or plain text.
<p>After editing the page you save your work by clicking on the "Submit" button at the bottom (see it at the bottom-left of the image).
<p>There is nothing to stop you editing lots of pages by this method but you will find it extremely tedious. It is especially tedious creating the links between pages.
<p><b>Footnote:</b> Currently this process does not properly tidy up after itself. Everyone can see your new edited page on the website immediately but you will need to ask a nerd to finish the process to make sure that your changes become persistent and don't get overwritten. [See the explanation at <a href="#tidy">the bottom of this page</a> if you want to know more.]
2022-03-06 01:18:32 +00:00
<h3 id="auto">Autogenerated pages</h3>
2020-04-10 13:09:12 +01:00
<p>Some key sections of the online webpages are autogenerated from cave survey data
so you cannot use "Edit this page". These pages will not show "Edit this page" in the top-left menu even when you are logged in. If you need to change any of these you will need to <a href="manual.html">correct the underlying cave survey data</a></p>
2022-03-06 01:18:32 +00:00
<p>Some pages are not editable because the file permissions are set to read-only. This may be a mistake and you should consult a nerd to get it fixed.
<p>In either case, instead of "Edit this page" it will say "This page not editable" at the bottom of the menu.
2020-04-10 13:09:12 +01:00
<h3>Creating New Pages</h3>
<p>If you type in the name of a new webapge into the address bar of your browser, e.g. <a href="http://expo.survex.com/handbook/festering/spa.html">http://expo.survex.com/handbook/festering/spa.html</a> (e.g. if you want to document how to find a hot-tub in Altaussee) then troggle will offer to create the page for you. Just click on the blue text that says "Create this page":<br />
<img src="../i/createpage.jpg"/>
<p>Then once created, you can edit it the same way that you edit a pre-existing page.
<h3>Linking in New Pages</h3>
<p>You link your new page into the handbook by editing another page in which you want to create a link. For example if you have created a new page describing your wonderful new sleeping bag/hammock technique, then you might want to add a link in to <a href="../kitlist.html">Expo Personal Gear List</a>. Unfortunately the "create link" icon (a picture of 3 links of a chain) is disabled in the on-line editor so you would have to click on the HTML icon and insert the link by editing the HTML directly using an <em>&lt;a href="filename"&gt;</em> tag. See <a href="#images">Images: Relative and Absolute URLs</a> below for how to structure the URLs in the <var>href</var> attribute.
2020-04-10 13:09:12 +01:00
2023-07-29 16:52:27 +01:00
<h3 id="conventions">Conventions</h3>
This covers all files and names, not just just the handbook pages. Other parts of the handbook guidance for logbooks, cave description writeups, entrance decription text and everything else redirect here.
2020-04-10 13:09:12 +01:00
<h4>Encoding</h4>
<ul>
<li>We specify that pages are encoded using <a href="https://www.w3schools.com/charsets/ref_html_utf8.asp">UTF-8</a> for all content.
<li>We are using <a href="https://www.w3schools.com/html/html5_intro.asp">HTML5</a> and
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS3</a> but a great many pages still use obsolescent tags such as &lt;font&gt;. These are being removed whenever a page is edited.
<li>All the pages use a single CSS stylesheet <a href="/css/main2.css">/css/main2.css</a>.
<li>We do not use any javascript framework: just HTML and CSS. You may come across historic references to jquery but this is not used.
2023-07-29 16:52:27 +01:00
<li>When editing webpages, use <a href="https://www.freeformatter.com/html-entities.html">HTML entities</a> for characters with umlauts, e.g. <var>&amp;ouml;</var> for &ouml;.
<li><em>Only</em> use a <a href="https://en.wikipedia.org/wiki/UTF-8#Encoding_process">UTF-8 encoding</a> if there is no HTML entity available, e.g. biohazard: <span style='font-size:30px;'>&#9763;</span> which is written as <var> &amp;#9763;</var>
2020-04-10 13:09:12 +01:00
</ul>
<h4>Automated formatting</h4>
<ul>
<li>When any .html page is loaded by troggle it replaces all the <em> &lt;head&gt;...&lt;/head&gt; </em> material with the expo standard header. So don't put anything in the header of any page you edit as it will be ignored. This is also where troggle inserts the <a href="/css/main2.css">/css/main2.css</a> standard stylesheet.
<li>On loading a .html page troggle also inserts a standard menu - normally visible to the top left of the page. This is not inserted if the .html page has its own menu: <em> &lt;div id="menu"&gt;&lt;ul id="links"&gt; ... various &lt;li&gt;items .. &lt;/ul&gt;&lt;/div&gt;</em>
<li>If you add the header line
<em>&lt;meta name="keywords" content="NOEDIT"&gt;</em>
it will be stripped out by troggle when it replaces the header, but it will notice it and will not insert "Edit this page" at the end of the inserted menu.
</ul>
2020-04-10 13:09:12 +01:00
<h4>Filenames</h4>
<ul>
<li>No spaces in filenames. Use underscores or hyphens.
<li>No filenames starting with "-" or "!" (Mac users beware)
<lI>All filenames to start with an alphabetic letter.
<li>All filenames to be in lower case, must not use umlauts, must not have extra full-stops in the name.
<li>Don't use capitals in any sort of identifier. If you have to, make _sure_ that they are used exactly the same everywhere.
Otherwise it's easy to make pages that work on Windows, but which don't on Linux.
<li>When you use "Edit this page" you are editing on the server which is a Linux machine.
<li> Never create two files spelt the same except for capitalisation. They will overwrite each other if edited on a Windows machine <em>without any warning</em>. This is particularly a problem for the filenames generated on phones for photographs.
</ul>
<h4 id="images">Images: Relative and Absolute URLs</h4>
<ul>
<li>Older parts of the website have sub-folders "i/", "l/", and "t/" holding respectively<br />
i/ - the image file at full resolution (600px width usually)</br>
l/ - an html file which displays the full image with a caption and some description</br>
t/ - a thumbnail image which is usually used inside an &lt;a&gt; tag to link to the l/ html file.
</ul>
2020-04-10 13:09:12 +01:00
<p>When creating figures use one of these two constructions. The first with "rooted" URLs beginning with a "/":</p>
<code><pre>
&lt;figure class="onright"&gt;
&lt;a href="/piclinks/typing.htm"&gt;&lt;img src="/images/typing.jpg"&gt;&lt;/a&gt;
&lt;br&gt;&lt;figcaption&gt;Tony Rooke at computer in 1991 - in the old potato hut&lt;/figcaption&gt;
&lt;/figure&gt;</pre></code>
or, with "relative" URLs, where the URL does not start with a "/":
<code><pre>
&lt;figure class="onleft"&gt;
&lt;a href="../l/hut-cables.html"&gt;&lt;img width=200 src="../i/acer-blue-aspire-one-netbook.jpg"&gt;&lt;/a&gt;
&lt;br&gt;&lt;figcaption&gt;AA1 netbook&lt;br /&gt; sits high up out of reach&lt;br /&gt;
(ours is less shiny)&lt;/figcaption&gt;
&lt;/figure&gt;
</pre></code>
<ul>
<li>"Rooted" URLs will work werever your fragment of HTML ends up. This root is the always the root of the <var>:expoweb:</var> repo, i.e. <var>/home/expo/expoweb/</var>.
<li>"Relative" URLs will be relative to wherever the webpage <em>is being viewed from</em> as located in the published
strcuture. This is often not where you think it is (especially for individual logbook entries and cave descriptions) but for handbook pages it is straightforward: you can see the location in the browser URL bar and for this page it is in the folder <var>"/handbook/computing/"</var>.
</ul>
<p>
P.S. In older pages that have not been updated recently, you may see this archaic form:</p>
<code><pre>
&lt;a href="/years/2018/logbook.html#t2018-08-03w"&gt;&lt;img src="i/logbookpage.jpg" class="onright"&gt;&lt;/a&gt;
</pre></code>
Where the <var>class="onright"</var> attribute is set on the IMG tag and not on the FIGURE tag or an enclosing DIV tag. If you find one of those in a page you are editing, please update it to use the current &lt;figure&gt; and &lt;figcaption&gt; structure. [Note the mixed URLs in this example, one is absolute and one is relative: this is not a recommended style.]
2020-04-10 13:09:12 +01:00
<hr />
2022-03-05 13:19:50 +00:00
<h3 id="tidy">Tidying up and committing the edits</h3>
<p>'Edit This Page' edits the file served on the web, saves it, adds it to the list of proposed git updates, then finally does the git 'commit' on the server. Things can go wrong at each step of the process.
2022-03-05 13:10:07 +00:00
2022-03-05 13:19:50 +00:00
<p>Specific error message pages are produced if the file cannot be saved (usually a permissions error), if it cannot be added to git's list, or if the git commit fails (which would be due to a merge failure on a previous commit attempt).
<p>If the version control commit fails, your edits will be saved and you will see them on the
website but <em>they will be lost later</em> if you do not get a nerd to fix the version control
2022-03-05 13:27:35 +00:00
<a href="../computing/repos.html">repository</a> properly.
<p>To properly finish the job you need to get a nerd to
2020-04-10 13:09:12 +01:00
<ul>
2022-03-05 13:27:35 +00:00
<li>Look at the current git log and status on the server, i.e. at
<a href="/repositories/expoweb/.git/log/">expoweb repo</a>
2020-04-10 13:09:12 +01:00
<li>
ssh into expo@expo.survex.com from a machine already configured to do this
<li>cd to the directory containing the repo you want, i.e. "cd expoweb" for the handbook, which takes you to /home/expo/expoweb
2020-04-23 01:12:51 +01:00
<li>Run "<a href="https://git-scm.com/book/en/v2/Getting-Started-Getting-Help">git status</a>" (to check what
2020-04-10 13:09:12 +01:00
changes are pending),
2022-03-05 13:23:34 +00:00
<li>then "<a href="https://git-scm.com/book/en/v2/Getting-Started-Getting-Help">git add</a> <em>filename</em>" to stage the page you have just edited.
2020-04-23 01:12:51 +01:00
<li>then DO NOT just run '<a href="https://git-scm.com/book/en/v2/Getting-Started-Getting-Help">
git commit</a>' unless you know how <em>emacs</em> works as it would dump
2020-04-10 13:09:12 +01:00
you into an emacs editing window (C-x C-C is the way to exit emacs). Instead, use the "-m" option:
2020-04-23 01:12:51 +01:00
<code>git commit -m "changed topcamp phone number - myName" </code>
2020-04-10 13:09:12 +01:00
which submits the obligatory comment with the commit operation. You should write something informative and brief about your changes between the quotation marks and also give your full name.
</ul>
2022-03-05 13:19:50 +00:00
<p>The same 'save/git-add/git-commit' process happens when uploading drawings files or when editing survex files online.
2020-04-10 13:09:12 +01:00
<hr />
<p>Go on to <a href="hbmanual2.html">Editing several pages</a><br />
Return to <a href="onlinesystems.html">Online systems overview</a>
2022-03-05 13:10:07 +00:00
<hr /></body>
2020-04-10 13:09:12 +01:00
</html>