commit-gnue
[Top][All Lists]
Advanced

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

r5352 - in trunk: gnue-common/utils/helpers www www/docs


From: jcater
Subject: r5352 - in trunk: gnue-common/utils/helpers www www/docs
Date: Thu, 18 Mar 2004 17:07:29 -0600 (CST)

Author: jcater
Date: 2004-03-18 17:07:27 -0600 (Thu, 18 Mar 2004)
New Revision: 5352

Added:
   trunk/www/docs/Project.txt
Modified:
   trunk/gnue-common/utils/helpers/tools.py
   trunk/www/README
   trunk/www/docs/common.txt
   trunk/www/docs/forms.txt
Log:
added basic support for docs on website

Modified: trunk/gnue-common/utils/helpers/tools.py
===================================================================
--- trunk/gnue-common/utils/helpers/tools.py    2004-03-18 21:52:19 UTC (rev 
5351)
+++ trunk/gnue-common/utils/helpers/tools.py    2004-03-18 23:07:27 UTC (rev 
5352)
@@ -2,7 +2,6 @@
 from files import openModuleFile, importModule, SubheadedFile, SVN_BASE, 
htmlify
 from StringIO import StringIO
 
-
 _generate_feature_plan = __import__('generate-feature-plan').FeaturePlan
 ##
 ##
@@ -15,6 +14,7 @@
     self.install = INSTALL(tool)
     self.translations = TRANSLATIONS(tool)
     self.featureplan = FEATUREPLAN(tool)
+    self.docs = DOCS(tool)
 
     # Import the src/ module, if possible
     try:
@@ -243,6 +243,104 @@
 #################################################
 #
 #
+class DOCS:
+  def __init__(self, tool):
+
+    try:
+      file = open(os.path.join(SVN_BASE,'www','docs','%s.txt'%tool))
+      lines = file.readlines()
+      file.close()
+    except IOError:
+      print "WARNING: gnue-%s has no www/docs/%s.txt" % (tool, tool)
+      lines = []
+
+    in_header = False
+    self.allfiles = []
+    self.corefiles = []   # Core developers (APIs, etc)
+    self.devfiles = []    # End Developers
+    self.userfiles = []   # End Users
+    current = None
+    text = []
+    props = {}
+    for line in lines:
+      line = line[:-1]
+      if line[:1] == '[':
+        in_header = True
+        text = []
+        props = { 'name': None,
+                  'audience': None,
+                  'location': None,
+                  'autoextensions': 'No' }
+        current = (text, props)
+        self.allfiles.append(current)
+      elif not line.strip() and in_header:
+        in_header = False
+      elif in_header:
+        try:
+          field, value = line.split(':',1)
+          props[field.lower()] = value.strip()
+          if field.lower() == 'Audience':
+            for audience in value.strip().replace(' ','').split(','):
+              if audience.lower() == 'enduser':
+                self.userfiles.append(current)
+              elif audience.lower() == 'enddeveloper':
+                self.devfiles.append(current)
+              elif audience.lower() == 'coredeveloper':
+                self.corefiles.append(current)
+              else:
+                print "WARNING: gnue-%s www/docs/%s.txt has invalid target: 
%s" % (tool, tool, value)
+        except ValueError:
+          print "WARNING: gnue-%s www/docs/%s.txt has invalid header line:" % 
(tool, tool)
+          print "   ", line
+      else:
+        text.append(line)
+
+
+  def getTypes(self, props, dest):
+    """
+    Returns a list of tuples in format of [ ('/path/to/1','Format'), .. ]
+    """
+    if props['autoextensions'].lower()[:1] == 'Y':
+      files = []
+      if dest[-1] == '/':
+        dest = dest[:-1]
+        files = []
+        for file in glob.glob(os.path.join(dest, props['location'] + '.*')):
+          files.append(file[len(dest):])
+    else:
+      files = [props['location']]
+
+    results = []
+    for file in files:
+      base = file.split('/')[-1]
+      if '.' in base:
+        ext = base.split('.')[-1].upper()
+        compressed = 0
+        if ext == 'GZ':
+          stuff = base.split('.')
+          if len(stuff) > 2:
+            ext = stuff[-2]
+          else:
+            ext = 'Plain Text'
+        if ext == 'TXT':
+          ext = 'Plain Text'
+        elif ext == 'PHP':
+          ext = 'HTML'
+        elif ext == 'SXW':
+          ext = 'OpenOffice'
+        elif ext == 'PS':
+          ext = 'Postscript'
+        if compressed:
+          ext += ' (Compressed)'
+        results.append(file)
+      else:
+        # No extension, assume it's HTML
+        results.append((file, 'HTML'))
+
+
+#################################################
+#
+#
 class ISO_CODES:
   def __init__(self):
     self.countries = {}

Modified: trunk/www/README
===================================================================
--- trunk/www/README    2004-03-18 21:52:19 UTC (rev 5351)
+++ trunk/www/README    2004-03-18 23:07:27 UTC (rev 5352)
@@ -1,8 +1,9 @@
 This repository contains the scripts and source files
 to create GNUe's website.
 
+=========
 STRUCTURE
----------
+=========
 The important directories are:
 
   web/          This directory contains files that are copied directly into
@@ -26,8 +27,22 @@
                 with php (via the command line) to create a static .html file
                 before being placed in htdig's path.
 
+==========
 NEWS ITEMS
-----------
+==========
+The format of the file:
+
+    - - - - - - - - -
+    Author: <email>
+    Title: Some Title
+    Date: YYYY-MM-DD
+
+    News Text ....
+    - - - - - - - - -
+
+A blank line separates the text from the headers. Also, the format of the
+date is important ... it is parsed and expected to be in the YYYY-MM-DD format.
+
 Note that the news text is processed with ReStructuredText, so
 plan accordingly.
 
@@ -47,3 +62,45 @@
 
 It treats it as a definition, which we don't want. Include a blank line
 between those two paragraphs.
+
+=============
+DOC STRUCTURE
+=============
+Each tool has a <tool>.txt file in www/docs/ that lists each documentation
+source.
+
+The file format is:
+
+    - - - - - - - - -
+    [Doc Name 1]
+    Name: Doc Name 1
+    Audience: End Developer
+    Location: /tools/forms/docs/Developers-Guide
+    AutoExtensions: Yes
+
+    Description text
+
+    [Doc Name 2]
+    - - - - - - - - -
+
+Audience can be a comma-separated list of:
+   Core Developer   Someone who is actually hacking on the
+                    forms, appserver, common source code
+   End Developer    Someone who would use Designer, etc, to
+                    do forms/reports for his organization.
+   End User         An actual user of a completed application.
+
+If AutoExtensions is Yes, then the create-website script basically
+does a:
+
+    ls ${location}.*
+
+to find all versions of a document.
+
+The following "docs" are added automatically:
+   - FAQ
+   - Roadmap/Feature Plans
+
+General project docs are indicated in Project.txt. Docs that don't pertain to 
any
+specific tool, but to the project as a whole, should go here.
+

Added: trunk/www/docs/Project.txt
===================================================================

Modified: trunk/www/docs/common.txt
===================================================================
--- trunk/www/docs/common.txt   2004-03-18 21:52:19 UTC (rev 5351)
+++ trunk/www/docs/common.txt   2004-03-18 23:07:27 UTC (rev 5352)
@@ -1,18 +1,18 @@
-[Developers-Guide]
+[Developers Guide]
 Name: Developer's Guide
 Audience: End Developer
 Location: /tools/common/docs/Developers-Guide
-AutoExtensions: Yes 
+AutoExtensions: Yes
 
 This guide will lead developers throught the various features provided
 by gnue-common.  Sample applications will be presented along with detailed
-information on each featurer.  If you wish to learn how to use gnue-common 
+information on each featurer.  If you wish to learn how to use gnue-common
 in your applications then this guide, in conjuction with the
 API reference, would be the one to use.
 
 [API Reference]
 Name: Developer's Guide
-Audience: End Developer
+Audience: End Developer, Core Developer
 Location: /tools/common/docs/api
 AutoExtensions: No
 

Modified: trunk/www/docs/forms.txt
===================================================================
--- trunk/www/docs/forms.txt    2004-03-18 21:52:19 UTC (rev 5351)
+++ trunk/www/docs/forms.txt    2004-03-18 23:07:27 UTC (rev 5352)
@@ -2,16 +2,16 @@
 Name: Developer's Guide
 Audience: End Developer
 Location: /tools/forms/docs/Developers-Guide
-AutoExtensions: Yes 
+AutoExtensions: Yes
 
 This guide will lead developers through the creation of their own forms via
-GNUe-designer. Sample forms will be presented along with detailed
-information on each feature.  An appendix of commonly used triggers recipies 
+GNUe Designer. Sample forms will be presented along with detailed
+information on each feature.  An appendix of commonly used triggers recipies
 is also provided.
 
 [API Reference]
 Name: Developer's Guide
-Audience: End Developer
+Audience: Core Developer
 Location: /tools/forms/docs/api
 AutoExtensions: No
 





reply via email to

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