]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / lib / scripts / layout2layout.py
index fe7c4e175cc6700d3c64b151f7ecdc6ecc960809..585538d2edaf62006897255a2071c0c6b0cf2fdf 100644 (file)
@@ -122,6 +122,19 @@ import os, re, string, sys
 # Incremented to format 35, 28 March 2011 by rgh
 # Try to add "Flex:" to any flex insets that don't have it.
 
+# Incremented to format 36, 7 December 2011, by rgh
+# Added HTMLStyles and AddToHTMLStyles tags.
+
+# Incremented to format 37, 29 February 2012 by jrioux
+# Implement the citation engine machinery in layouts.
+# Change CiteFormat to CiteFormat (default|authoryear|numerical).
+
+# Incremented to format 38, 08 April 2012 by gb
+# Introduce LangPreamble and BabelPreamble for InsetLayout.
+
+# Incremented to format 39, 15 April 2012 by sanda
+# Introduce styling of branches via "InsetLayout Branch:".
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -129,7 +142,7 @@ import os, re, string, sys
 # development/tools/updatelayouts.sh script to update all
 # layout files to the new format.
 
-currentFormat = 36
+currentFormat = 39
 
 
 def usage(prog_name):
@@ -203,6 +216,7 @@ def convert(lines):
     re_End = re.compile(r'^(\s*)(End)(\s*)$', re.IGNORECASE)
     re_Provides = re.compile(r'^(\s*)Provides(\S+)(\s+)(\S+)', re.IGNORECASE)
     re_CharStyle = re.compile(r'^(\s*)CharStyle(\s+)(\S+)$', re.IGNORECASE)
+    re_CiteFormat = re.compile(r'^(\s*)(CiteFormat)(?:(\s*)()|(\s+)(default|authoryear|numerical))', re.IGNORECASE)
     re_AMSMaths = re.compile(r'^\s*Input ams(?:math|def)s.inc\s*')
     re_AMSMathsPlain = re.compile(r'^\s*Input amsmaths-plain.inc\s*')
     re_AMSMathsSeq = re.compile(r'^\s*Input amsmaths-seq.inc\s*')
@@ -314,6 +328,21 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 38:
+          i += 1
+          continue
+
+        if format == 37:
+          i += 1
+          continue
+
+        if format == 36:
+            match = re_CiteFormat.match(lines[i]);
+            if match and match.group(4) == "":
+                lines[i] = match.group(0) + " default"
+            i += 1
+            continue
+
         if format == 35:
           i += 1
           continue