Style (rinoh.style
)¶
-
class rinoh.style.Styled(id=
None
, style=None
, parent=None
, source=None
)¶ A document element who’s style can be configured.
- Parameters:¶
-
configuration_class =
None
¶
-
class rinoh.style.Style(base=
None
, **attributes)¶ Dictionary storing style attributes.
The style attributes associated with this
Style
are specified as class attributes of typeAttribute
.Style attributes can also be accessed as object attributes.
Style Sheet¶
-
class rinoh.style.StyleSheet(name, matcher=
None
, base=None
, source=None
, description=None
, pygments_style=None
, **user_options)¶ Dictionary storing a collection of related styles by name.
Style
s stored in aStyleSheet
can refer to their base style by name.- Parameters:¶
- name : str¶
a label for this style sheet
- matcher : StyledMatcher¶
the matcher providing the selectors the styles contained in this style sheet map to. If no matcher is given and base is specified, the base‘s matcher is used. If base is not set, the default matcher is used.
- base : StyleSheet or str¶
the style sheet to extend
- description : str¶
a short string describing this style sheet
- pygments_style : str¶
the Pygments style to use for styling code blocks
-
class rinoh.style.StyleSheetFile(filename, base=
None
, source=None
, **kwargs)¶ Loads styles defined in a .rts file (INI format).
StyleSheetFile
takes the same optional arguments asStyleSheet
. These can also be specified in the[STYLESHEET]
section of the style sheet file. If an argument is specified in both places, the one passed as an argument overrides the one specified in the style sheet file.
-
class rinoh.style.StyledMatcher(mapping_or_iterable=
None
, **kwargs)¶ Dictionary mapping labels to selectors.
This matcher can be initialized in the same way as a
dict
by passing a mapping, an interable and/or keyword arguments.- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]