]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
Create Chapter 6 Bullets in Additional.lyx and move the bullet section into it; this...
[lyx.git] / lib / scripts / layout2layout.py
index 7d377d01a32810e8aa9e9477cff277e0de3dd51e..d923d65752d4bd019a57282b1abc911535261f82 100644 (file)
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 92
+currentFormat = 98
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -256,7 +256,7 @@ currentFormat = 92
 # 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
@@ -311,7 +311,25 @@ currentFormat = 92
 # InputGlobal tag
 
 # Incremented to format 92, 30 January 2021 by spitz
-# Add ProvideInsetLayout and ModifyIndetLayout
+# 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
+
+# Incremented to format 96, 4 December 2022 by rikiheck
+# Add HTMLInToc
+
+# Incremented to format 97, 4 December 2022 by rikiheck
+# Add HTMLClass
+
+# Incremented to format 98, 5 December 2022 by rikiheck
+# Add HTMLClass for InsetLayout
 
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
@@ -345,7 +363,7 @@ def error(message):
 
 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
@@ -435,8 +453,8 @@ def convert(lines, end_format):
     # 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)
@@ -448,10 +466,10 @@ def convert(lines, end_format):
     re_ChapterStyle = re.compile(b'^\\s*Style\\s+Chapter\\s*$', re.IGNORECASE)
     re_InsetLayout_CaptionLTNN = re.compile(b'^(\\s*InsetLayout\\s+)(Caption:LongTableNonumber)', re.IGNORECASE)
     # for format 64
-    re_trimLabelString = re.compile(b'^(\\s*LabelString\s+)"\\s*(.*?)\\s*"\\s*$')
-    re_trimLabelStringAppendix  = re.compile(b'^(\\s*LabelStringAppendix\s+)"\\s*(.*?)\\s*"\\s*$')
-    re_trimEndLabelString = re.compile(b'^(\\s*EndLabelString\s+)"\\s*(.*?)\\s*"\\s*$')
-    re_trimLabelCounter = re.compile(b'^(\\s*LabelCounter\s+)"\\s*(.*?)\\s*"\\s*$')
+    re_trimLabelString = re.compile(b'^(\\s*LabelString\\s+)"\\s*(.*?)\\s*"\\s*$')
+    re_trimLabelStringAppendix  = re.compile(b'^(\\s*LabelStringAppendix\\s+)"\\s*(.*?)\\s*"\\s*$')
+    re_trimEndLabelString = re.compile(b'^(\\s*EndLabelString\\s+)"\\s*(.*?)\\s*"\\s*$')
+    re_trimLabelCounter = re.compile(b'^(\\s*LabelCounter\\s+)"\\s*(.*?)\\s*"\\s*$')
 
 
     # counters for sectioning styles (hardcoded in 1.3)
@@ -563,7 +581,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if 87 <= format <= 92:
+        if 87 <= format <= 97:
             # nothing to do.
             i += 1
             continue
@@ -606,7 +624,7 @@ def convert(lines, end_format):
                 continue
             col  = match.group(2)
             if col == "collapsable":
-                lines[i] = match.group(1) + "collapsible"
+                lines[i] = match.group(1) + b"collapsible"
             i += 1
             continue
 
@@ -824,7 +842,7 @@ def convert(lines, end_format):
             # 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:
@@ -1274,7 +1292,7 @@ def convert(lines, end_format):
             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
             #