| 61 | 1 #!/usr/bin/python3 | 
|  | 2 | 
|  | 3 import os | 
|  | 4 import sys | 
|  | 5 import datetime | 
|  | 6 import rlgall | 
|  | 7 import pytz | 
|  | 8 | 
| 91 | 9 navbar = '<div class="nav"><a href="/">RLGallery</a> -> \ | 
| 61 | 10 <a href="/notes/">Notes</a> -> {0}</div>' | 
|  | 11 | 
|  | 12 rsshead = """<?xml version="1.0" encoding="UTF-8"?> | 
|  | 13 <rss version="2.0"> | 
|  | 14 <channel> | 
|  | 15 <title>Roguelike Gallery</title> | 
|  | 16 <description>News and notes from the Roguelike Gallery.</description> | 
| 91 | 17 <link>https://rlgallery.org/notes/</link> | 
| 61 | 18 """ | 
|  | 19 | 
|  | 20 indexintro = """<p>The Gallery's blog, with news and thoughts on roguelike | 
|  | 21 games. A comment system is planned but does not exist yet. There is an | 
|  | 22 <a href="feed.rss">RSS feed</a> for the benefit of robots.</p> | 
|  | 23 """ | 
|  | 24 | 
|  | 25 phead = rlgall.phead.replace("/scoring/scores.css", "notes.css") | 
|  | 26 | 
|  | 27 ptitle = '<h2 class="pagetitle">{0}</h2>\n' | 
|  | 28 | 
|  | 29 posthead = '<h3 class="posttitle">{0}</h2>\n' | 
|  | 30 | 
|  | 31 datediv = '<div class="datehead">{0}</div>\n' | 
|  | 32 | 
|  | 33 def noteurl(tag): | 
| 91 | 34   return "https://rlgallery.org/notes/" + tag + ".html" | 
| 61 | 35 | 
|  | 36 def itementry(tagname, value): | 
|  | 37   return "  <{0}>{1}</{0}>\n".format(tagname, value) | 
|  | 38 | 
|  | 39 def fmtdate(dt): | 
|  | 40   if dt == None: | 
|  | 41     dt = datetime.datetime.now(pytz.utc) | 
|  | 42   return dt.strftime("%a, %d %b %Y %H:%M:%S %z") | 
|  | 43 | 
|  | 44 def qdetag(istr): | 
|  | 45   nstart = istr.find('>') | 
|  |