Commit c01c3e7c authored by Marco Cavalli's avatar Marco Cavalli
Browse files

fix: use - instead of _ for HTML styles

fix: update font size for headers in html
fix: prevent collapsing of HTML styles to italic
parent 9df39f5f
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -24,19 +24,19 @@
  font-size: 9pt;
}

.HTML_Variable {
.HTML-Variable {
  font-family: "Roboto Mono", Monospace;
  font-size: 8pt;
  font-style: italic;
}

.HTML_Keyboard {
.HTML-Keyboard {
  font-family: Times New Roman;
  font-size: 10pt;
  color: #595959;
}

.HTML_Definition {
.HTML-Definition {
  font-style: italic;
}

@@ -48,7 +48,7 @@
  gap: 12pt;
}

.HTML_Code {
.HTML-Code {
  font-family: "Roboto Mono", Monospace;
  font-size: 8pt;
  color: #31849b;
@@ -58,7 +58,7 @@
  font-family: Courier New;
}

.HTML_Error {
.HTML-Error {
  font-family: Times New Roman;
  font-weight: bold;
  font-style: italic;
@@ -128,6 +128,10 @@
  white-space: nowrap;
}

.EQ {
  text-align: center;
}

.EX {
  padding-left: 12pt;
  margin-bottom: 9pt;
@@ -192,7 +196,7 @@
  margin-bottom: 9pt;
}

.HTML_Sample {
.HTML-Sample {
  font-family: Courier New;
  font-size: 8pt;
}
+3 −3
Original line number Diff line number Diff line
@@ -597,13 +597,13 @@ h3 {
  font-size: 1.25em;
}
h4 {
  font-size: 1em;
  font-size: 1.1em;
}
h5 {
  font-size: 0.875em;
  font-size: 1.05em;
}
h6 {
  font-size: 0.85em;
  font-size: 1em;
  color: #777;
}
h1 tt,
+6 −3
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ function Substitute(el, word)
                                el.content[i + 6])
                        end
                    else --we finally sustitute it with the proper link
                        if word == "clause" and tocLinks[number] ~= nil then
                        if word == "clause" then
                            newContent:insert(ClauseLink(elem.text .. " " .. number, number))
                        elseif word == "figure" then
                            newContent:insert(FigureLink(elem.text .. " " .. number, number))
@@ -295,7 +295,10 @@ if FORMAT:match 'html' then

    function Emph(el)
        el = Linking(el)
        return pandoc.RawInline('html', '<i>' .. pandoc.utils.stringify(el) .. '</i>')
        if #el.content == 1 then
            return el.content[1]
        end
        return el
    end

    function Underline(el)
+4 −1
Original line number Diff line number Diff line
@@ -338,7 +338,10 @@ if FORMAT:match 'html' then

    function Emph(el)
        el = Linking(el)
        return pandoc.RawInline('html', '<i>' .. pandoc.utils.stringify(el) .. '</i>')
        if #el.content == 1 then
            return el.content[1]
        end
        return el
    end

    function Underline(el)
+10 −0
Original line number Diff line number Diff line
@@ -159,6 +159,14 @@ def run_format_checks(filename: str, file_lines: list[str]):
    check_divs()
    check_notes_and_examples()

def remove_ignore_prettier_statements(text: str) -> str:
    """Remove any existing <!-- prettier-ignore --> statements from the text to avoid duplication"""
    new_lines = []
    for line in text.split("\n"):
        if line.strip() != "<!-- prettier-ignore-start -->" and line.strip() != "<!-- prettier-ignore-end -->":
            new_lines.append(line)

    return "\n".join(new_lines)

def add_divs_to_images_tables(text : str) -> str:
    """Add divs around images and their captions, and tables captions to the ones defined using the ETSI guidelines."""
@@ -598,6 +606,8 @@ def preprocess(

                run_format_checks(filename, text.splitlines())

                text = remove_ignore_prettier_statements(text)

                text = add_divs_to_images_tables(text)

                if filename in clauses_filenames:
Loading