gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/metacode umlrst.py


From: Asko Soukka
Subject: [Gzz-commits] gzz/metacode umlrst.py
Date: Tue, 11 Feb 2003 07:30:13 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    03/02/11 07:30:13

Modified files:
        metacode       : umlrst.py 

Log message:
        :caption: to make UML drawn as figure

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlrst.py.diff?tr1=1.33&tr2=1.34&r1=text&r2=text

Patches:
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.33 gzz/metacode/umlrst.py:1.34
--- gzz/metacode/umlrst.py:1.33 Mon Feb 10 08:54:13 2003
+++ gzz/metacode/umlrst.py      Tue Feb 11 07:30:13 2003
@@ -26,7 +26,9 @@
     Initializes Docutils Directives.
     """
     uml_directive.arguments = (1, 0, 0)
-    uml_directive.options = {}
+    uml_directive.options = {'caption': 
docutils.parsers.rst.directives.unchanged,
+                             'scale': 
docutils.parsers.rst.directives.nonnegative_int,
+                             }
     uml_directive.content = 1
 
     docutils.parsers.rst.directives._directives['uml'] = uml_directive
@@ -63,6 +65,13 @@
     src = trans+attributes['name']+"_gen.eps"
     uml_node = docutils.nodes.image(uri=src, alt="UML: "+attributes['name'],
                                     _uml=attributes['name'])
+
+    #if we have a caption, we want to make it a figure (or do we?)
+    if options.has_key('caption') and len(options['caption']) > 0:
+        uml_node = docutils.nodes.figure('', uml_node)
+        caption = docutils.nodes.caption('', options['caption'])
+        uml_node += caption
+
     if content:
 
         #splits content into uml and mp parts
@@ -105,7 +114,6 @@
     add_refer_context(attributes['name'], 1)
 
     return [uml_node]
-
 
 def add_refer_context(name, top = 0):
     if settings.has_key('context'):




reply via email to

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