Commits

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...

  • Participants
  • Parent commits c181928
  • Branches pyobjc-ancient

Comments (0)

Files changed (11)

pyobjc-website/lib/docs.py

 
     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'):
             continue
 
     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):
             continue
 
         else:
             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))
 
     generator.emitHTML(

pyobjc-website/lib/news.py

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

pyobjc-website/lib/sitegen.py

 gTopMenu=[
     ('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',   'http://sourceforge.net/mail/?group_id=14534'),
 ]
         if not os.path.exists(outdn):
             os.makedirs(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)
         variables.update(kwds)
         stream = tmpl.generate(**variables)

pyobjc-website/news/20050608_wwdcbob.rst

 ===========================
 
 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
-at: http://pythonmac.org/wwdc05
+PyObjC, at WWDC 2005. The web presence for that session is now up
+at: http://pythonmac.org/wwdc2005/

pyobjc-website/news/20080107_examples.rst

+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
+examples.

pyobjc-website/setup.py

 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.
 sys.path.append('lib')
 
         generator = sitegen.SiteGenerator('templates', 'htdocs')
 
+        if os.path.exists('htdocs'):
+            shutil.rmtree('htdocs')
+        os.mkdir('htdocs')
+
         log.info("Copying static resources")
         for subdir in os.listdir('resources'):
             if subdir.startswith('.'): continue
         generator.emitHTML("/index.html", "site-index.html",  
                 pyobjc_version='2.0',
                 pyobjc_release_date='October 24th 2007',
-                news=newsItems,
+                news=news.newsSelection(newsItems),
                 bottommenu=root_menu)
 
         docs.generateDocs(generator, '/documentation', '..', ['pyobjc-core'] + frameworkList)

pyobjc-website/static/development.rst

 .. __: http://www.codingmonkeys.de/mbo/
 
 You can fetch a snapshot of the current development tree using a WebDAV connection to <http://svn.red-bean.com/pyobjc/trunk/>
-or <http://svn.red-bean.com/pyobjc/trunk/>, just copy the ``pyobjc`` folder to a local disk.
+or <https://svn.red-bean.com/pyobjc/trunk/>, just copy the ``pyobjc`` folder to a local disk.
 
 Bug tracker and older files
 ---------------------------

pyobjc-website/static/links.rst

 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.... hyperjeff.net has put together an `an excellent collection of links!`__
+  
+.. __: http://osx.hyperjeff.net/Reference/cocoa.php
+.. _`FScript`: http://www.fscript.org/
 .. _`CamelBones`: http://camelbones.sourceforge.net/
-
-* `FScript`_ - a lightweight object-oriented scripting layer designed for OS X
-  
-.. _`FScript`: http://www.fscript.org/
-
-* And many more.... the F-Script folks have put together an `an excellent collection of links!`__
-  
-.. __: http://www.fscript.org/links.htm

pyobjc-website/templates/news-item.html

   xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="layout.html" />
   <head>
-    <title>PyObjC - ${headline}</title>
+    <title>PyObjC - ${newsitem['headline']}</title>
   </head>
 
   <body>

pyobjc-website/templates/sample-global-index.html

     the examples for a specific framework.</p>
 
     <ul>
-      <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>
     </ul>
 
     <p><em>Note:</em> a number of examples still use <code>NibClassBuilder.AutoBaseClass</code>. This is deprecated

pyobjc-website/templates/site-index.html

 
       <h1>Status</h1>
 
-      <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="http://www.gnustep.org/">GNUstep</a> project is also not supported, contact the