From 775de26728f9b81f273eda1b49c5887d8ce29386 Mon Sep 17 00:00:00 2001 From: Janos Kovacs Date: Wed, 25 Apr 2012 02:52:16 +0300 Subject: [PATCH] documentation: dblyxfix.py is now filtering tags --- configure.ac | 2 +- .../lyx/plugin-developer-guide.lyx | 82 +++++++++++++++++++++- doc/scripts/dblyxfix.py | 18 ++++- 3 files changed, 98 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index ffdf562..0e5ccff 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx b/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx index 32f69de..5a73bbf 100644 --- a/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx +++ b/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx @@ -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 diff --git a/doc/scripts/dblyxfix.py b/doc/scripts/dblyxfix.py index 07f1039..ab0956f 100755 --- a/doc/scripts/dblyxfix.py +++ b/doc/scripts/dblyxfix.py @@ -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 += "" % \ (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("") graph_pattern = re.compile("") -- 2.7.4