[Checkins] SVN: grokui.introspector/trunk/src/grokui/introspector/util.txt Update tests.
Uli Fouquet
uli at gnufix.de
Mon Aug 11 11:21:40 EDT 2008
Log message for revision 89662:
Update tests.
Changed:
U grokui.introspector/trunk/src/grokui/introspector/util.txt
-=-
Modified: grokui.introspector/trunk/src/grokui/introspector/util.txt
===================================================================
--- grokui.introspector/trunk/src/grokui/introspector/util.txt 2008-08-11 15:21:20 UTC (rev 89661)
+++ grokui.introspector/trunk/src/grokui/introspector/util.txt 2008-08-11 15:21:40 UTC (rev 89662)
@@ -1,7 +1,7 @@
grokui.introspector.util
************************
-:Test-Layer: unit
+:Test-Layer: functional
Helpers for the ``grokui.introspector`` package.
@@ -37,3 +37,27 @@
>>> dotted_name_url('zope.README.txt.gz', preserve_last=2)
'...<a href="/++inspect++/+code/zope/README.txt.gz">README.txt.gz</a>'
+
+render_text(text, module=None, format=None)
+===========================================
+
+A function stolen from ``zope.app.apidoc`` that quickly renders the
+given text using the specified format.
+
+If the `module` argument is specified, the function will try to determine the
+format using the module. If the `format` argument is given, it is simply
+used. Clearly, you cannot specify both, the `module` and `format` argument.
+
+You specify the format as follows:
+
+ >>> from grokui.introspector.util import render_text
+ >>> render_text('Hello!\n', format='zope.source.rest')
+ u'<p>Hello!</p>\n'
+
+Note that the format string must be a valid source factory id; if the factory
+id is not given, 'zope.source.rest' is used. Thus, specifying the module is
+often safer (if available):
+
+ >>> from grokui import introspector
+ >>> render_text('Hello!\n', module=introspector)
+ u'<p>Hello!</p>\n'
More information about the Checkins
mailing list