# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 87
+currentFormat = 95
# Incremented to format 4, 6 April 2007, lasgouttes
# New textclass tag BibInToc
# Incremented to format 77, 6 August 2019 by spitz
-# New textclass tag PageSize (= default page size)
+# New textclass tag PageSize (= default page size)
# and textclass option PageSize (= list of available page sizes)
# Incremented to format 78, 6 August 2019 by spitz
# Incremented to format 86, 20 October 2020 by tcuvelier
# New tag DocBookSection.
-# Incremeted to format 87, 2 November 2020 by rkh
+# Incremented to format 87, 2 November 2020 by rkh
+
+# Incremented to format 88, 28 November 2020 by tcuvelier
+# New tag DocBookNotInPara.
+
+# Incremented to format 89, 5 December 2020 by rkh
+# New tag LaTeXName for counters
+
+# Incremented to format 90, 11 December 2020 by spitz
+# Use semantic label colors
+
+# Incremented to format 91, 25 January 2021 by spitz
+# InputGlobal tag
+
+# Incremented to format 92, 30 January 2021 by spitz
+# Add ProvideInsetLayout and ModifyInsetLayout
+
+# Incremented to format 93, 13 February 2021 by spitz
+# Add DocBookNoFontInside
+
+# Incremented to format 94, 19 September 2021 by tcuvelier
+# Add DocBookFloatType, DocBookCaption
+
+# Incremented to format 95, 27 September 2021 by tcuvelier
+# Add DocBookRenderAsImage
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
def trim_bom(line):
" Remove byte order mark."
- if line[0:3] == "\357\273\277":
+ if line[0:3] == b"\357\273\277":
return line[3:]
else:
return line
else:
return b'"' + old + new + b'"'
+
# appends a string to a list unless it's already there
def addstring(s, l):
if l.count(s) > 0:
# for categories
re_Declaration = re.compile(b'^#\\s*\\Declare\\w+Class.*$')
re_ExtractCategory = re.compile(b'^(#\\s*\\Declare\\w+Class(?:\\[[^]]*?\\])?){([^(]+?)\\s+\\(([^)]+?)\\)\\s*}\\s*$')
- ConvDict = {"article": "Articles", "book" : "Books", "letter" : "Letters", "report": "Reports",
- "presentation" : "Presentations", "curriculum vitae" : "Curricula Vitae", "handout" : "Handouts"}
+ ConvDict = {b"article": b"Articles", b"book": b"Books", b"letter": b"Letters", b"report": b"Reports",
+ b"presentation": b"Presentations", b"curriculum vitae": b"Curricula Vitae", b"handout": b"Handouts"}
# Arguments
re_OptArgs = re.compile(b'^(\\s*)OptionalArgs(\\s+)(\\d+)\\D*$', re.IGNORECASE)
re_ReqArgs = re.compile(b'^(\\s*)RequiredArgs(\\s+)(\\d+)\\D*$', re.IGNORECASE)
i += 1
continue
+ if 87 <= format <= 95:
+ # nothing to do.
+ i += 1
+ continue
+
if format == 86:
if lines[i].lstrip().lower().startswith(b"stepmastercounter"):
pattern = re.compile(b"stepmastercounter", re.IGNORECASE)
continue
col = match.group(2)
if col == "collapsable":
- lines[i] = match.group(1) + "collapsible"
+ lines[i] = match.group(1) + b"collapsible"
i += 1
continue
# Insert the required number of arguments at the end of the style definition
match = re_End.match(lines[i])
if match:
- newarg = ['']
+ newarg = [b'']
# First the optionals (this is the required order pre 2.1)
if opts > 0:
if opts == 1:
if latextype == b"item_environment" and label.lower() == b"counter_enumi":
lines[labeltype_line] = re_LabelType.sub(b'\\1\\2\\3Enumerate', lines[labeltype_line])
# Don't add the LabelCounter line later
- counter = ""
+ counter = b""
# Replace
#