commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5594 - in trunk: gnue-common/utils/helpers www/utils/webhelpers www/web


From: jcater
Subject: r5594 - in trunk: gnue-common/utils/helpers www/utils/webhelpers www/web/shared
Date: Wed, 31 Mar 2004 11:01:29 -0600 (CST)

Author: jcater
Date: 2004-03-31 11:01:28 -0600 (Wed, 31 Mar 2004)
New Revision: 5594

Modified:
   trunk/gnue-common/utils/helpers/tools.py
   trunk/www/utils/webhelpers/tools.py
   trunk/www/web/shared/base.css
Log:
added manpage links to tool webpages

Modified: trunk/gnue-common/utils/helpers/tools.py
===================================================================
--- trunk/gnue-common/utils/helpers/tools.py    2004-03-31 16:13:06 UTC (rev 
5593)
+++ trunk/gnue-common/utils/helpers/tools.py    2004-03-31 17:01:28 UTC (rev 
5594)
@@ -1,6 +1,7 @@
 import sys, os, string, time, glob
 from files import openModuleFile, importModule, SubheadedFile, SVN_BASE, 
htmlify
 from StringIO import StringIO
+import tempfile
 
 _generate_feature_plan = __import__('generate-feature-plan').FeaturePlan
 ##
@@ -16,6 +17,7 @@
     self.featureplan = FEATUREPLAN(tool)
     self.technotes = TECHNOTES(tool)
     self.docs = DOCS(tool)
+    self.manpages = MAN(tool)
 
     # Import the src/ module, if possible
     try:
@@ -358,6 +360,7 @@
 
     return results
 
+
 #################################################
 #
 #
@@ -401,6 +404,40 @@
 #################################################
 #
 #
+class MAN:
+  def __init__(self, tool):
+
+    self.files = []
+    self.tool = tool
+    self.path = path = os.path.join(SVN_BASE,'gnue-%s' % tool, 'doc','man')
+    if os.path.exists(path):
+      for file in glob.glob(path+'/*.[1-9]'):
+        self.files.append(os.path.split(file)[-1])
+    else:
+      print "WARNING: gnue-%s has no doc/man directory" % tool
+    self.files.sort()
+
+  def asHTML(self, file):
+    inp = self.path + '/' + file
+    tmp = tempfile.mktemp('.html')
+
+    # Use groff to generate HTML, but strip out headers and useless fluff
+    os.system("""
+    groff -T html -mandoc "%s" |
+       sed 
'/^<html>/,/<body>/d;s/align=center//g;/<\/body>/,/<\/html>/g;s/<hr>//g' > %s
+    """ % (inp, tmp))
+
+    fl = open(tmp)
+    html = fl.read()
+    fl.close()
+    os.unlink(tmp)
+
+    return html
+
+
+#################################################
+#
+#
 class ISO_CODES:
   def __init__(self):
     self.countries = {}

Modified: trunk/www/utils/webhelpers/tools.py
===================================================================
--- trunk/www/utils/webhelpers/tools.py 2004-03-31 16:13:06 UTC (rev 5593)
+++ trunk/www/utils/webhelpers/tools.py 2004-03-31 17:01:28 UTC (rev 5594)
@@ -153,6 +153,15 @@
     html += '<h2>Documentation</h2>\n<ul>'   #TODO
     html += '<li>Frequently Asked Questions: <a 
href="docs/faq.php">HTML</a></li>\n'
 
+    # Man pages
+    if mod.manpages.files:
+      html += '<li>Man Pages:<ul>\n'
+      for manpage in mod.manpages.files:
+        html += '<li>%s: <a href="docs/man/%s.php">HTML</a></li>\n' % 
(manpage.split('.')[0], manpage)
+        phpWrapper('tools/%s/docs/man/%s.php' % (tool,manpage), 
mod.manpages.asHTML(manpage),
+                    name + ' Man Page (' + manpage + ')')
+      html += '</ul></li>\n'
+
     # tools/<tool>/docs/index.php
     html2 = "<h1>%s Documentation</h1>\n" % package.replace('GNUe-','')
     html2 += "<p>This pages contains various documentation for %s.</p>" % name
@@ -161,7 +170,7 @@
                 (mod.docs.userfiles, 'End User'),
                 (mod.docs.devfiles,'End Developer')):
       if fileset:
-        html += '<li>%s Documentation:</p><ul>\n' % descr
+        html += '<li>%s Documentation:<ul>\n' % descr
         html2 += '<h2>%s Documentation</h2>\n' % descr
         for props, text in fileset:
           all = []

Modified: trunk/www/web/shared/base.css
===================================================================
--- trunk/www/web/shared/base.css       2004-03-31 16:13:06 UTC (rev 5593)
+++ trunk/www/web/shared/base.css       2004-03-31 17:01:28 UTC (rev 5594)
@@ -163,6 +163,10 @@
   padding-left: 20pt;
 }
 
+li>ul {
+  margin: 0 0 2px 0;
+}
+
 /*ul,ol li ul,ol{
   margin: 0px 0 0 0;
   padding-left: 40pt;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]