Commit 4ba95087 authored by Jason Fox's avatar Jason Fox
Browse files

Add badges

parent 0d3661a2
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -102,6 +102,31 @@
  content: url("https://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Logo_ETSI.svg/320px-Logo_ETSI.svg.png")
}*/

.norm {
  color: white;
  text-transform: uppercase;
  font-size: 16px;
  background: rgb(2, 72, 141);
  padding: 4px 20px 4px 20px;
  border-radius: 4px;
  border: 1px solid rgb(62, 72, 79);
  float: right;
}

.inform {
  /*color: rgb(62, 72, 79)*/
  color: black;
  text-transform: uppercase;
  font-size: 16px;
  background: rgb(191, 227, 255);
  padding: 4px 20px 4px 20px;
  border-radius: 4px;
  border: 1px solid rgb(2, 72, 141);
  float: right;
}



.ZGSM {
}

+22 −0
Original line number Diff line number Diff line
@@ -516,6 +516,27 @@ def move_figure_id_to_FL_elements(soup: BeautifulSoup):

    return soup

def shorten_toc_text(soup: BeautifulSoup):
    """
    Remove informative/normative from TOC only
    """
    tocTexts = soup.select("#TOC .norm")
    for tocText in tocTexts:
        tocText.decompose()

    tocTexts = soup.select(".norm")
    for tocText in tocTexts:
        tocText.string = "Normative"

    tocTexts = soup.select("#TOC .inform")
    for tocText in tocTexts:
        tocText.decompose()

    tocTexts = soup.select(".inform")
    for tocText in tocTexts:
        tocText.string = "Informative"

    return soup

def fix_custom_tags(soup: BeautifulSoup):
    """
@@ -797,6 +818,7 @@ def postprocess(html_dir: str):
        soup = replace_dash_characters(soup)
        soup = move_figure_id_to_FL_elements(soup)
        soup = fix_custom_tags(soup)
        soup = shorten_toc_text(soup)
        images, soup = extract_images_from_html(soup)
        for image_id, image_src in images.items():
            images_mapping[image_src] = {"id": image_id, "file": new_filename}