header

Header markups.

Default section header line character:

  • header 1: =

  • header 2: -

  • header 3: ~

  • header 4: +

  • header 5: *

  • header 6: #

  • header 7: ^

rstobj.markup.header.to_label(title: str) str[source]

slugify title and convert to reference label.

Return type

str

class rstobj.markup.header.Header(title: str, header_level: int = 1, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None)[source]

A Section Header markup.

Parameters
  • title – str, title text

  • header_level – int, 1 ~ 7

  • ref_label – str, cross domain reference label string. a global key for this header.

  • auto_label – bool, if True, automatically slugify the title and use it as the reference label.

Example:

h = Header(title="Hello World", header_level=1, auto_label=True)
h.render()

Output:

.. _hello-world:

Hello World
===========
property header_char: str
property template_name
Return type

str

class rstobj.markup.header.HeaderLevel(title: str, header_level: int = 1, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None)[source]
class rstobj.markup.header.Header1(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 1)[source]

Example:

class rstobj.markup.header.Header2(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 2)[source]

Example:

class rstobj.markup.header.Header3(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 3)[source]

Example:

class rstobj.markup.header.Header4(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 4)[source]

Example:

class rstobj.markup.header.Header5(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 5)[source]

Example:

class rstobj.markup.header.Header6(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 6)[source]

Example:

class rstobj.markup.header.Header7(title: str, ref_label: Optional[str] = None, auto_label: bool = False, bar_length: Optional[int] = None, header_level: int = 7)[source]

Example: