--- a/createdoc.py Wed Apr 25 17:12:18 2012 +0200
+++ b/createdoc.py Wed Apr 25 17:15:15 2012 +0200
@@ -12,17 +12,15 @@
import inspect
from pkg_resources import parse_version
-from docutils.core import publish_doctree
-import docutils
-
-#--
-from docutils import core
+from docutils.core import publish_doctree, publish_from_doctree, publish_string
+from docutils.utils import new_document
from docutils.writers.html4css1 import Writer,HTMLTranslator
from iro.view.xmlrpc import TwistedInterface as Current
from iro import __version__
from createerm import createSchemaPlot, tables, tables_cls
+#redering text with rest syntax
class NoHeaderHTMLTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self,document)
@@ -40,13 +38,15 @@
_w.apply_template = d
def reSTify(s):
- d =docutils.utils.new_document("")
+ d = new_document("")
if s.tagname == "paragraph":
d.append(s[0])
else:
d.append(s)
- return core.publish_from_doctree(d, writer=_w)
+ return publish_from_doctree(d, writer=_w)
+
+
class Link():
@@ -65,6 +65,7 @@
class Site(Link):
pass
+
class Keyword():
def __init__(self, name=None, typ=None, description=None):
self.name=name
@@ -174,7 +175,7 @@
title=self.tablename[0].upper()+self.tablename[1:]
Link.__init__(self,name,title)
- self.description = Markup(core.publish_string(cls.__doc__,writer=_w))
+ self.description = Markup(publish_string(cls.__doc__,writer=_w))
class File:
def __init__(self,path):