[Telepathy-commits] [telepathy-spec/master] Add title, copyrights, license and other fun stuff

Davyd Madeley davyd at madeley.id.au
Mon Mar 23 12:29:24 PDT 2009


---
 doc/spec/style.css       |    2 +-
 doc/templates/index.html |   21 +++++++++++++++++----
 tools/specparser.py      |   13 +++++++++++++
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/doc/spec/style.css b/doc/spec/style.css
index c3c2ea8..12effb4 100644
--- a/doc/spec/style.css
+++ b/doc/spec/style.css
@@ -17,6 +17,7 @@ ul {
 
 div.header {
 	position: fixed;
+	height: 4em;
 	background-color: white;
 	width: 100%;
 	margin: 0;
@@ -25,7 +26,6 @@ div.header {
 	top: 0;
 	left: 0;
 	z-index: 1;
-	height: 4em;
 }
 
 div.main {
diff --git a/doc/templates/index.html b/doc/templates/index.html
index ee36a6d..eb50aa5 100644
--- a/doc/templates/index.html
+++ b/doc/templates/index.html
@@ -2,23 +2,36 @@
 <!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" "">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
-  <title>FIXME - get this from the XML</title>
+  <title>$title &mdash v$version</title>
   <link rel="stylesheet" href="style.css" type="text/css"/>
  </head>
  <body>
-  <h1>FIXME - get this from the XML</h1>
+  <div class="header">
+   <h1>$title</h1>
+   <a href="#interfaces">Interfaces</a>
+   | <a href="#other">Other</a>
+  </div>
 
-  <h3>Interfaces</h3>
+  <div class="main">
+  <h3 class="version">Version $version</h3>
+  <p class="copyrights">
+   #echo '<br/>'.join($copyrights)
+  </p>
+  $license
+
+  <h3 id="interfaces">Interfaces</h3>
   <ul>
   #for $interface in $interfaces
    <li><a href="$interface.get_url()">$interface.name</a></li>
   #end for
   </ul>
 
-  <h3>Extra</h3>
+  <h3 id="other">Other</h3>
   <ul>
    <li><a href="generic-types.html">Generic Types</a></li>
    <li><a href="errors.html">Errors</a></li>
   </ul>
+
+  </div>
  </body>
 </html>
diff --git a/tools/specparser.py b/tools/specparser.py
index 6a86503..d4e6bb7 100644
--- a/tools/specparser.py
+++ b/tools/specparser.py
@@ -467,6 +467,19 @@ class Spec (object):
                 for type in interface.types:
                     self.types[type.short_name] = type
 
+        # get some extra bits for the HTML
+        node = dom.getElementsByTagNameNS (XMLNS_TP, 'spec')[0]
+        self.title = getText (getChildrenByName (node, XMLNS_TP, 'title')[0])
+        self.version = getText (getChildrenByName (node, XMLNS_TP, 'version')[0])
+        self.copyrights = map (getText,
+                               getChildrenByName (node, XMLNS_TP, 'copyright'))
+
+        license = getChildrenByName (node, XMLNS_TP, 'license')[0]
+        license.tagName = 'div'
+        license.namespaceURI = None
+        license.setAttribute ('class', 'license')
+        self.license = license.toxml ()
+
     def get_spec (self):
         return self
     
-- 
1.5.6.5




More information about the telepathy-commits mailing list