[xiph-cvs] r6549 - in websites/ngen: . xiph.org xiph.org/CSS
comatoast at xiph.org
comatoast at xiph.org
Mon Apr 19 20:54:27 PDT 2004
Author: comatoast
Date: 2004-04-19 23:54:26 -0400 (Mon, 19 Apr 2004)
New Revision: 6549
Added:
websites/ngen/xiph.org/.htaccess
Modified:
websites/ngen/wrapup.py
websites/ngen/xiph.org/CSS/all.css
Log:
* makeReadableDate() works now.
* the <h1> matcher now won't miss the boat if you sneak some attributes into it.
* the sidebar includeable is now responsible for adding in its own containing div.
This may be a bad idea.
* Miniscule refactoring and labeling with the definition of getParallelFile().
Incidentally, I don't like the name.
* Added in a bare-bones .htaccess, because we need one.
* Need to move *sidebar.inc to *beforecontent.inc. That might take a second commit.
<p>Modified: websites/ngen/wrapup.py
===================================================================
--- websites/ngen/wrapup.py 2004-04-19 19:43:03 UTC (rev 6548)
+++ websites/ngen/wrapup.py 2004-04-20 03:54:26 UTC (rev 6549)
@@ -21,7 +21,7 @@
import os, re, sys, glob, os.path
MARKDOWN_COMMAND = "Markdown" # could also be "Markdown.pl"
-TITLE_REGEX = re.compile(r"<h1>(.*)</h1>")
+TITLE_REGEX = re.compile(r"<h1.*>(.*)</h1>")
class MarkdownWrapper(object):
"""
Important attributes:
@@ -33,6 +33,7 @@
.inHeadBits -- a list of strings to be included inside the head element
.beforeContentBits -- stuff to include before the content div
.mainText -- the text from .sourceFileName after it's been turned into HTML
+ .afterMainTextBits -- comes just after .mainText, but inside the content div
.afterContentBits -- stuff to include after the content div
"""
def __init__(self, sourceFilename, destFilename=None):
@@ -60,21 +61,20 @@
self.title = match.group(1)
self.lang = 'en-US'
-
+
+ self.afterMainTextBits = []
self.headBits = []
self.beforeContentBits = []
self.afterContentBits = []
-
- sidebarFilename = os.path.join(os.path.split(self.sourceFilename)[0], "sidebar.inc")
+
+ sidebarFilename = getParallelFile(self.sourceFilename, "beforecontent.inc")
if os.path.isfile(sidebarFilename):
# consider crawling back to ./ from ./foo/bar/baz/quux
- beforeBit = "<div id='sidebar'>"
- beforeBit += (file(sidebarFilename).read())
- beforeBit += "</div>"
+ beforeBit = file(sidebarFilename).read()
self.beforeContentBits.append(beforeBit)
-
- # todo: similarly to append, say, copyright.inc to afterContentBits
+
+ # todo: similarly to append, say, copyright.inc to afterMainTextBits
def renderToFile(self):
outfile = file(self.destFilename, "w")
@@ -102,6 +102,8 @@
ret += bit
ret += "<div id='content'>"
ret += self.mainText
+ for bit in self.afterMainTextBits:
+ ret += bit
ret += "</div>\n"
for bit in self.afterContentBits:
ret += bit
@@ -111,14 +113,19 @@
def makeReadableDate(isoDate):
"""Gets "January 4, 1982" from "1982-01-04"."""
- year = isoDate[0-4]
+ year = isoDate[0:4]
+ month = isoDate[5:7]
day = isoDate[-2:]
if day.startswith('0'): day = day[-1]
- month = isoDate[5:7]
months = """Nothing January February March April May June
July August September October November December""".split()
return "%s %s, %s" % (months[int(month)], day, year)
+def getParallelFile(where, what):
+ """
+ given f("/home/foo.txt", "bar.html"), returns "/home/bar.html".
+ """
+ return os.path.join(os.path.split(where)[0], what)
if __name__ == '__main__':
for dirpath, dirnames, filenames in os.walk('.'):
Added: websites/ngen/xiph.org/.htaccess
===================================================================
--- websites/ngen/xiph.org/.htaccess 2004-04-19 19:43:03 UTC (rev 6548)
+++ websites/ngen/xiph.org/.htaccess 2004-04-20 03:54:26 UTC (rev 6549)
@@ -0,0 +1 @@
+AddDefaultCharset UTF-8
Modified: websites/ngen/xiph.org/CSS/all.css
===================================================================
--- websites/ngen/xiph.org/CSS/all.css 2004-04-19 19:43:03 UTC (rev 6548)
+++ websites/ngen/xiph.org/CSS/all.css 2004-04-20 03:54:26 UTC (rev 6549)
@@ -78,6 +78,23 @@
font-size: .8em;
}
-ul#bignavbuttons a:hover {
+ul#bignavbuttons li.vorbis a:hover {
+ background: #74a5fd;
+}
+
+ul#bignavbuttons li.flac a:hover {
+ background: #ff9; /* banana-ish */
+}
+
+ul#bignavbuttons li.speex a:hover {
background: #90ee90; /* light green */
}
+
+ul#bignavbuttons li.theora a:hover {
+ background: #e9f;
+}
+
+ul#bignavbuttons li.icecast a:hover {
+ background: #f5f5f5; /* white smoke */
+}
+
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list