documentation: dblyxfix.py is now filtering <dummy> tags
authorJanos Kovacs <jankovac503@gmail.com>
Tue, 24 Apr 2012 23:52:16 +0000 (02:52 +0300)
committerJanos Kovacs <jankovac503@gmail.com>
Tue, 24 Apr 2012 23:52:16 +0000 (02:52 +0300)
configure.ac
doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx
doc/scripts/dblyxfix.py

index ffdf562..0e5ccff 100644 (file)
@@ -244,7 +244,7 @@ AC_SUBST(MRP_DBLYXFIX, [$MRP_DOCSCRIPT_DIR/dblyxfix.py])
 
 
 # Shave by default.
-SHAVE_INIT([build-aux], [enable])
+#SHAVE_INIT([build-aux], [enable])
 
 # Create murphy symlink to src.
 if test ! -L murphy; then
index 32f69de..5a73bbf 100644 (file)
@@ -85,7 +85,87 @@ Murphy in Brief
 \end_layout
 
 \begin_layout Standard
-jhkjhkjh
+blah blah bla ....
+\end_layout
+
+\begin_layout Standard
+this is the enumeration test:
+\end_layout
+
+\begin_layout Itemize
+First level bbbbbb
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+second level
+\end_layout
+
+\begin_layout Itemize
+another second level
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+first level again
+\end_layout
+
+\begin_layout Itemize
+now we try third level as well
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+second
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+third
+\end_layout
+
+\begin_layout Itemize
+jjjjj
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+again second
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+third
+\end_layout
+
+\end_deeper
+\end_deeper
+\begin_layout Itemize
+first
+\end_layout
+
+\begin_layout Enumerate
+This is for 1
+\end_layout
+
+\begin_layout Enumerate
+for 2
+\end_layout
+
+\begin_layout Enumerate
+and for three
+\end_layout
+
+\begin_layout Description
+This will be the first among description thing
+\end_layout
+
+\begin_layout Description
+here we have the second
+\end_layout
+
+\begin_layout Description
+and the third
 \end_layout
 
 \begin_layout Part
index 07f1039..ab0956f 100755 (executable)
@@ -5,19 +5,32 @@
 import os, sys, re
 from lxml import etree
 
+def fix_dummy(broken_xml):
+    start = 0
+    end = len(broken_xml)
+    fixed_xml = ""
+
+    for match in re.finditer(dummy_pattern, broken_xml):
+        fixed_xml += broken_xml[start:match.start()]
+        start = match.end()
+
+    if start < end:
+        fixed_xml += broken_xml[start:end]
+    return fixed_xml
+
 def fix_graphs(broken_xml):
     start = 0
     end = len(broken_xml)
     fixed_xml = ""
 
     for match in re.finditer(graph_pattern, broken_xml):
-        fixed_xml += broken_xml[start:match.start()]
+        fixed_xml += fix_dummy(broken_xml[start:match.start()])
         fixed_xml += "<!ENTITY graph%s \"%s\">" % \
             (match.group(1), os.path.basename(match.group(2)))
         start = match.end()
 
     if start < end:
-        fixed_xml += broken_xml[start:end]
+        fixed_xml += fix_dummy(broken_xml[start:end])
     return fixed_xml
 
 def fix_files(broken_xml):
@@ -50,6 +63,7 @@ except IOError as (errno, strerror):
     print "Input error %d - %s" % (errno, strerror)
     exit(errno)
 
+dummy_pattern = re.compile("<[/]?dummy>")
 file_pattern = re.compile("<!ENTITY file([0-9]*) \"([^\"]*)\">")
 graph_pattern = re.compile("<!ENTITY graph([0-9]*) \"([^\"]*)\">")