further documentation

This commit is contained in:
Philip Sargent 2022-12-17 19:20:33 +00:00
parent 4c890b7cde
commit 8c7aaa78c2
2 changed files with 31 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -59,9 +59,40 @@ it is handy to print out this page and tick off the steps as you do them.
<p>Look at all the photos in the file browser set to show thumbnails and delete all advertising logos etc., and delete the UK Caving header image which will be of random people not us. <p>Look at all the photos in the file browser set to show thumbnails and delete all advertising logos etc., and delete the UK Caving header image which will be of random people not us.
<h3 id="code1">Edit logbooks.py</a></h3> <h3 id="code1">Edit logbooks.py</a></h3>
<p>Edit this bit in the obvious manner to add a line for the year you want to add:
<code><pre>BLOG_PARSER_SETTINGS = {
"2017": ("ukcavingblog.html", "parser_blog"),
"2018": ("ukcavingblog.html", "parser_blog"),
"2019": ("ukcavingblog.html", "parser_blog"),
"2022": ("ukcavingblog.html", "parser_blog"),
}
</pre></code>
<p>If there are 2nd or 3rd pageswithin the same year, these will be detected automatically. But you have to tell it about the first one.
<img src="export-dialog.jpg" hspace="20" align="right">
<h3 id="export">Exporting all entries to a new file</a></h3> <h3 id="export">Exporting all entries to a new file</a></h3>
<p>Run Troggle locally, and navigate your browser to
<var>http://localhost:8000/controlpanel</var>. Select the drop-down for the year you are working on (2017 in this example).
<p>You need to login as the "expoadmin" user id, not the usual "expo" id. This has a different password but you already know what it is because you set up your local copy of Troggle.
<p>There is only one export format: "HTML 2005 style". This uses the Django template
<var>troggle/templates/logbook2005style.html</var>.
<p>All entries for the year will be exported in date order, which may not be the order they were originally written in the paper logbook.
<p>Some logbooks have "front matter": text and images which are not part of any trip entry. This front matter is copied out when the logbook.html file was most recently parsed and is copied in to the front of the generated export file. The export file is always called "logbook-new-format.html" and is located in the same folder as "logbook.html". If there is a file of that name already there it is overwritten without warning.
<h3 id="code2">Edit logbooks.py again</a></h3> <h3 id="code2">Edit logbooks.py again</a></h3>
<p><p>Edit this bit in the obvious manner to show that you have done all the work for 2017. Don't just delete the line, make it obvious that the importing job was done:
<code><pre>BLOG_PARSER_SETTINGS = {
# "2017": ("ukcavingblog.html", "parser_blog"), # now folded in to logbooks.html
"2018": ("ukcavingblog.html", "parser_blog"),
"2019": ("ukcavingblog.html", "parser_blog"),
"2022": ("ukcavingblog.html", "parser_blog"),
}
</pre></code>
<h3 id="reimport">Rename and reimport</a></h3>
<p>...[to be done]
<h3 id="tidy">Tidy oddities</a></h3> <h3 id="tidy">Tidy oddities</a></h3>
<p>With the blog, we have well known expoers labelled as unrecognized because while they posted to the blog, they were not actually on expo in that year. This is not a bug, but don't be confused by it.
<p>Somewhere the encode/decode process of exporting the content of the trip writeups is turning quote marks into question marks, and &gt; into &amp;gt;. Currently these are all being hand-edited to fix. The fault
is somewhere in the settings for rendering a dictionary using a Django template, and hard to find and fix.
<hr /> <hr />
<p> <p>
Back to <a href="logbooks-parsing.html">Logbooks Import for Nerds</a> documentation.<br> Back to <a href="logbooks-parsing.html">Logbooks Import for Nerds</a> documentation.<br>