class_docstr: An Htmlbook is used to generate an html page from text and matplotlib figures.
class_docstr_tok: ["An","Htmlbook","is","used","to","generate","an","html","page","from","text","and","matplotlib","figures","."]
docstr: Adds a section to the Htmlbook (also updates table of contents).
docstr_tok: ["Adds","a","section","to","the","Htmlbook","(","also","updates","table","of","contents",")","."]
code: def add_section(self, name):
      """Adds a section to the Htmlbook (also updates table of contents)."""
      anchor = "section{:03d}".format(self.section_counter)
      name = str(self.section_counter) + " " + name
      anchor_style = "text-decoration: none;"
      self.section_counter += 1
      # Add section to main text
      self.doc.stag("br")
      self.doc.stag("hr", style="border: 2px solid")
      with self.tag("h3"):
          self.line("a", "", name=anchor)
          self.text(name + " ")
          self.line("a", "[top]", href="#top", style=anchor_style)
      # Add section to table of contents
      self.top_line("a", name, href="#" + anchor, style=anchor_style)
      self.top_doc.stag("br")
  
file_path: pycls/pycls/sweep/htmlbook.py
imports: import base64
  from io import BytesIO
  import matplotlib.pyplot
  from yattag import Doc, indent
label_desc: Use image node_id 2 for calling the Htmlbook obj's underlying member method code with example usage: obj.add_section(name) without return types