Ronald Oussoren committed c2f726e

We're finally there, the new site looks fine and complete.

There are still minor issues (such as a too narrow left margin and lack of
syntax coloring inside documents), but those can be resolved later.

Time to prepare for replacing the current website...

Comments (0)

Files changed (11)


     return allProjects
-def generateProjectDocumentation(generator, projhtml, projroot, name, allProjects):
+def generateProjectDocumentation(generator, projhtml, projroot, newsfile, name, allProjects):
     doclist = []
     description = ''
+    if os.path.exists(newsfile):
+        newshtml = os.path.join(projhtml, 'news.html')
+        doclist.append(('Current NEWS', newshtml))
+        content = open(newsfile, 'r').read()
+        parts =  publish_parts(
+            source=content,
+            source_path=os.path.basename(newsfile),
+            writer_name='html',
+            settings_overrides=dict(
+                input_encoding='utf-8',
+                initial_header_level=2,
+            ))
+        title=parts['title']
+        if not title:
+            title = os.path.splitext(fn)[0]
+        generator.emitHTML(
+            newshtml,
+            'documentation-doc.html',
+            name=name,
+            title=title,
+            body=parts['body'],
+            bottommenu=allProjects,
+        )
     for fn in os.listdir(projroot):
         if fn.endswith('.html') or fn in ('.svn', 'CVS'):
     for project in projects:
         projroot = os.path.join(sourceroot, project, 'Doc')
-        if not os.path.exists(projroot):
+        newsfile = os.path.join(sourceroot, project, 'NEWS.txt')
+        if not os.path.exists(projroot) and not os.path.exists(newsfile):
             projhtml = os.path.join(htmlroot, project)
             description, projdocs = generateProjectDocumentation(
-                generator, projhtml, projroot, name, allProjects)
+                generator, projhtml, projroot, newsfile, name, allProjects)
             documentListing.append((name, description, projdocs))


     quarter and at least 5 news items.
     result = []
-    mindate = -
+    mindate = - datetime.timedelta(maxAge)
     mindate = mindate.strftime('%Y-%m-%d')
     for item in listing:
         if len(result) < minitems:


     ('Home',            '/index.html'),
     ('Documentation',   '/documentation/index.html'),
-    ('Development',     '/development/index.html'),
-    ('Download',        '/software/index.html'),
+    ('Development',     '/development.html'),
+    ('Download',        '/downloads.html'),
     ('Examples',        '/examples/index.html'),
     ('Mailing lists',   ''),
         if not os.path.exists(outdn):
-        tmpl = MarkupTemplate(open(infn, 'r').read(), loader=self._makeLoader(infn))
+        tmpl = MarkupTemplate(open(infn, 'r').read(), loader=self._makeLoader(infn), lookup='strict')
         variables = self._makeGlobals(_htmlpath)
         stream = tmpl.generate(**variables)


 Bob Ippolito did a session about Python on Mac OS X, and more specifically
-PyObjC at this year's WWDC. The web presence for that session is now up
+PyObjC, at WWDC 2005. The web presence for that session is now up


+Updated website
+The website has been updated with documentation and examples from PyObjC 2.0.
+It is now possible to browse the source code for examples and download complete


 from distutils.errors  import DistutilsError
 from distutils import log
-import sys, os
+import sys, os, shutil
 # The truly interesting code is in the 'lib' directory, make that available.
         generator = sitegen.SiteGenerator('templates', 'htdocs')
+        if os.path.exists('htdocs'):
+            shutil.rmtree('htdocs')
+        os.mkdir('htdocs')
+"Copying static resources")
         for subdir in os.listdir('resources'):
             if subdir.startswith('.'): continue
         generator.emitHTML("/index.html", "site-index.html",  
                 pyobjc_release_date='October 24th 2007',
-                news=newsItems,
+                news=news.newsSelection(newsItems),
         docs.generateDocs(generator, '/documentation', '..', ['pyobjc-core'] + frameworkList)


 .. __:
 You can fetch a snapshot of the current development tree using a WebDAV connection to <>
-or <>, just copy the ``pyobjc`` folder to a local disk.
+or <>, just copy the ``pyobjc`` folder to a local disk.
 Bug tracker and older files


 The building blocks
-* `Python` - the python interpreter
+* `Python`_ - the python interpreter
 * `Objective-C`_ - the objective-C programming language
 * `CamelBones`_ - a Perl<->ObjC bridge
+* `FScript`_ - a lightweight object-oriented scripting layer designed for OS X
+* And many more.... has put together an `an excellent collection of links!`__
+.. __:
+.. _`FScript`:
 .. _`CamelBones`:
-* `FScript`_ - a lightweight object-oriented scripting layer designed for OS X
-.. _`FScript`:
-* And many more.... the F-Script folks have put together an `an excellent collection of links!`__
-.. __:


   <xi:include href="layout.html" />
-    <title>PyObjC - ${headline}</title>
+    <title>PyObjC - ${newsitem['headline']}</title>


     the examples for a specific framework.</p>
-      <li py:for="framework, link in bottommenu"><a href="${link}/">${framework}</a></li>
+      <li py:for="framework, link in bottommenu"><a href="${link}">${framework}</a></li>
     <p><em>Note:</em> a number of examples still use <code>NibClassBuilder.AutoBaseClass</code>. This is deprecated


-      <p><a href="${url('/download.html')}">PyObjC ${pyobjc_version}</a> was released on ${pyobjc_release_date}. See 
-      the <a href="${url('/documentation/news.html')}">NEWS file</a> for details.</p>
+      <p><a href="${url('/downloads.html')}">PyObjC ${pyobjc_version}</a> was released on ${pyobjc_release_date}. See 
+      the <a href="${url('/documentation/pyobjc-core/news.html')}">NEWS file</a> for details.</p>
       <p>PyObjC supports Mac OS X 10.3.9 and later, earlier versions are not supported. 
       The <a href="">GNUstep</a> project is also not supported, contact the