# 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").
# development/tools/updatelayouts.sh script to update all
# layout files to the new format.
-currentFormat = 35
+currentFormat = 39
def usage(prog_name):
def read(source):
" Read input file and strip lineendings."
- lines = source.read().splitlines()
+ lines = source.read().splitlines() or ['']
lines[0] = trim_bom(lines[0])
return 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*')
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
+
if format == 34:
match = re_InsetLayout2.match(lines[i])
if not match:
i += 1
+ if only_comment:
+ lines.insert(i, "Format 2")
if usemodules:
i = formatline + 1
for mod in usemodules: