Span
Span class for “text:span” tag.
Classes:
| Name | Description |
|---|---|
Span |
A span tag (styled text in paragraph), “text:span”. |
Span
Bases: MDSpan, MDParagraph, UserDefinedMixin, LinkMixin, ParaFormattedTextMixin, ParaMixin, NoteMixin, Element
A span tag (styled text in paragraph), “text:span”.
This element is used for inline text styling within a paragraph. It can contain text content and is often associated with a text style.
Inherits from various mixins to provide markdown, paragraph, and note functionalities.
Methods:
| Name | Description |
|---|---|
__init__ |
Create a span element “text:span” of the given style containing the |
__str__ |
|
Attributes:
| Name | Type | Description |
|---|---|---|
style |
|
|
text |
|
Source code in odfdo/span.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
_properties
class-attribute
instance-attribute
_properties = (
PropDef("style", "text:style-name"),
PropDef("class_names", "text:class-names"),
)
_tag
class-attribute
instance-attribute
_tag = 'text:span'
style
instance-attribute
style = style
text
instance-attribute
text = ''
__init__
__init__(
text: str | None = None,
style: str | None = None,
formatted: bool = True,
**kwargs: Any,
) -> None
Create a span element “text:span” of the given style containing the optional given text.
If “formatted” is True (the default), the given text is appended with
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str | None
|
The text content for the span. |
None
|
style
|
str | None
|
The style name for the span. |
None
|
formatted
|
bool
|
If True, special characters in |
True
|
Source code in odfdo/span.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
__str__
__str__() -> str
Source code in odfdo/span.py
98 99 | |