diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..72e839d --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,15 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/README.md b/README.md index 2fcb536..2f5f811 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@

- - PyPI version + + PyPI Version + Supported Python Versions

PyDOM is a Python library that allows you to create web pages using a declarative syntax. diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css new file mode 100644 index 0000000..ad5d9e7 --- /dev/null +++ b/docs/_static/css/custom.css @@ -0,0 +1,30 @@ +html[data-theme="light"] { + --pst-color-primary: #564fa1; + --pst-color-secondary: #7f88c3; + --pst-color-secondary-hover: #e6e6e6; + --pst-color-secondary-highlight: #7f3f98 ; +} + +html[data-theme="dark"] { + --pst-color-primary: #7f88c3; + --pst-color-secondary: #f7f7f7; + --pst-color-secondary-hover: #e6e6e6; + --pst-color-secondary-highlight: #7f3f98; +} + +.navbar-brand { + gap: 1rem; +} + +.navbar-brand img { + height: 85%; +} + +.navbar-item nav { + border-left: 2px solid #5d5d5f; + padding-left: 8px; +} + +.index-logo { + max-width: 250px; +} \ No newline at end of file diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000..fa4a999 Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/docs/_static/images/logo-dark.svg b/docs/_static/images/logo-dark.svg new file mode 100644 index 0000000..59e0572 --- /dev/null +++ b/docs/_static/images/logo-dark.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_static/images/logo-light.svg b/docs/_static/images/logo-light.svg new file mode 100644 index 0000000..8358f8e --- /dev/null +++ b/docs/_static/images/logo-light.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_templates/.gitkeep b/docs/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/api-reference/index.rst b/docs/api-reference/index.rst new file mode 100644 index 0000000..d429764 --- /dev/null +++ b/docs/api-reference/index.rst @@ -0,0 +1,11 @@ +API Reference +============= + +This page contains auto-generated API reference documentation [#f1]_. + +.. toctree:: + :titlesonly: + + /api-reference/pydom/index + +.. [#f1] Created with `sphinx-autoapi `_ \ No newline at end of file diff --git a/docs/api-reference/pydom/component/index.rst b/docs/api-reference/pydom/component/index.rst new file mode 100644 index 0000000..fc39130 --- /dev/null +++ b/docs/api-reference/pydom/component/index.rst @@ -0,0 +1,43 @@ +pydom.component +=============== + +.. py:module:: pydom.component + + +Classes +------- + +.. autoapisummary:: + + pydom.component.Component + + +Module Contents +--------------- + +.. py:class:: Component(*children: pydom.types.rendering.ChildType) + + Bases: :py:obj:`abc.ABC` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: children + :type: Tuple[pydom.types.rendering.ChildType, Ellipsis] + + + .. py:method:: render(*_, **kwargs) -> pydom.types.rendering.RenderResult + :abstractmethod: + + + + .. py:method:: __init_subclass__(**kwargs) -> None + :classmethod: + + + + .. py:method:: __call__(*children: pydom.types.rendering.ChildType) + + diff --git a/docs/api-reference/pydom/context/context/index.rst b/docs/api-reference/pydom/context/context/index.rst new file mode 100644 index 0000000..d4fafde --- /dev/null +++ b/docs/api-reference/pydom/context/context/index.rst @@ -0,0 +1,70 @@ +pydom.context.context +===================== + +.. py:module:: pydom.context.context + + +Attributes +---------- + +.. autoapisummary:: + + pydom.context.context.T + pydom.context.context.P + + +Classes +------- + +.. autoapisummary:: + + pydom.context.context.Context + + +Functions +--------- + +.. autoapisummary:: + + pydom.context.context.get_context + pydom.context.context.set_default_context + + +Module Contents +--------------- + +.. py:data:: T + +.. py:data:: P + +.. py:class:: Context + + .. py:attribute:: injector + :type: pydom.utils.injector.Injector + + + .. py:method:: add_prop_transformer(transformer: pydom.context.transformers.PropertyTransformer, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + add_prop_transformer(matcher: pydom.context.transformers.PropertyMatcherFunction, transformer: pydom.context.transformers.PropertyTransformerFunction, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + + + .. py:method:: add_post_render_transformer(transformer: Union[pydom.context.transformers.PostRenderTransformerFunction, pydom.context.transformers.PostRenderTransformer], /, *, before: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None) + + + .. py:property:: prop_transformers + + + .. py:property:: post_render_transformers + + + .. py:method:: inject(callback: Callable) -> Callable + + + .. py:method:: standard() -> typing_extensions.Self + :classmethod: + + + +.. py:function:: get_context(context: Optional[Context] = None) -> Context + +.. py:function:: set_default_context(context: Context) -> None + diff --git a/docs/api-reference/pydom/context/feature/index.rst b/docs/api-reference/pydom/context/feature/index.rst new file mode 100644 index 0000000..cb4093a --- /dev/null +++ b/docs/api-reference/pydom/context/feature/index.rst @@ -0,0 +1,27 @@ +pydom.context.feature +===================== + +.. py:module:: pydom.context.feature + + +Classes +------- + +.. autoapisummary:: + + pydom.context.feature.Feature + + +Module Contents +--------------- + +.. py:class:: Feature(context: pydom.context.context.Context) + + .. py:attribute:: context + + + .. py:property:: feature_name + :type: str + + + diff --git a/docs/api-reference/pydom/context/index.rst b/docs/api-reference/pydom/context/index.rst new file mode 100644 index 0000000..ceaf2f1 --- /dev/null +++ b/docs/api-reference/pydom/context/index.rst @@ -0,0 +1,66 @@ +pydom.context +============= + +.. py:module:: pydom.context + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/context/context/index + /api-reference/pydom/context/feature/index + /api-reference/pydom/context/standard/index + /api-reference/pydom/context/transformers/index + + +Classes +------- + +.. autoapisummary:: + + pydom.context.Context + + +Functions +--------- + +.. autoapisummary:: + + pydom.context.get_context + + +Package Contents +---------------- + +.. py:class:: Context + + .. py:attribute:: injector + :type: pydom.utils.injector.Injector + + + .. py:method:: add_prop_transformer(transformer: pydom.context.transformers.PropertyTransformer, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + add_prop_transformer(matcher: pydom.context.transformers.PropertyMatcherFunction, transformer: pydom.context.transformers.PropertyTransformerFunction, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + + + .. py:method:: add_post_render_transformer(transformer: Union[pydom.context.transformers.PostRenderTransformerFunction, pydom.context.transformers.PostRenderTransformer], /, *, before: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None) + + + .. py:property:: prop_transformers + + + .. py:property:: post_render_transformers + + + .. py:method:: inject(callback: Callable) -> Callable + + + .. py:method:: standard() -> typing_extensions.Self + :classmethod: + + + +.. py:function:: get_context(context: Optional[Context] = None) -> Context + diff --git a/docs/api-reference/pydom/context/standard/index.rst b/docs/api-reference/pydom/context/standard/index.rst new file mode 100644 index 0000000..0ef8ef0 --- /dev/null +++ b/docs/api-reference/pydom/context/standard/index.rst @@ -0,0 +1,28 @@ +pydom.context.standard +====================== + +.. py:module:: pydom.context.standard + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/context/standard/transformers/index + + +Functions +--------- + +.. autoapisummary:: + + pydom.context.standard.add_standard_features + + +Package Contents +---------------- + +.. py:function:: add_standard_features(ctx: pydom.context.context.Context) + diff --git a/docs/api-reference/pydom/context/standard/transformers/class_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/class_transformer/index.rst new file mode 100644 index 0000000..d0edb2a --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/class_transformer/index.rst @@ -0,0 +1,37 @@ +pydom.context.standard.transformers.class_transformer +===================================================== + +.. py:module:: pydom.context.standard.transformers.class_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.class_transformer.ClassTransformer + + +Module Contents +--------------- + +.. py:class:: ClassTransformer(prop_name='classes') + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: prop_name + :value: 'classes' + + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(_, prop_value, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/dash_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/dash_transformer/index.rst new file mode 100644 index 0000000..57c7f6e --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/dash_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.dash_transformer +==================================================== + +.. py:module:: pydom.context.standard.transformers.dash_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.dash_transformer.DashTransformer + + +Module Contents +--------------- + +.. py:class:: DashTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(_, prop_value, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/falsy_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/falsy_transformer/index.rst new file mode 100644 index 0000000..2462f0e --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/falsy_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.falsy_transformer +===================================================== + +.. py:module:: pydom.context.standard.transformers.falsy_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.falsy_transformer.FalsyTransformer + + +Module Contents +--------------- + +.. py:class:: FalsyTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(_, prop_value) -> bool + + + .. py:method:: transform(prop_name, _, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/html_events_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/html_events_transformer/index.rst new file mode 100644 index 0000000..435e497 --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/html_events_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.html_events_transformer +=========================================================== + +.. py:module:: pydom.context.standard.transformers.html_events_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.html_events_transformer.HTMLEventsTransformer + + +Module Contents +--------------- + +.. py:class:: HTMLEventsTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, prop_value) -> bool + + + .. py:method:: transform(prop_name, prop_value, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/index.rst b/docs/api-reference/pydom/context/standard/transformers/index.rst new file mode 100644 index 0000000..28b1180 --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/index.rst @@ -0,0 +1,148 @@ +pydom.context.standard.transformers +=================================== + +.. py:module:: pydom.context.standard.transformers + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/context/standard/transformers/class_transformer/index + /api-reference/pydom/context/standard/transformers/dash_transformer/index + /api-reference/pydom/context/standard/transformers/falsy_transformer/index + /api-reference/pydom/context/standard/transformers/html_events_transformer/index + /api-reference/pydom/context/standard/transformers/inner_html_transformer/index + /api-reference/pydom/context/standard/transformers/simple_transformer/index + /api-reference/pydom/context/standard/transformers/style_transformer/index + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.ClassTransformer + pydom.context.standard.transformers.DashTransformer + pydom.context.standard.transformers.FalsyTransformer + pydom.context.standard.transformers.HTMLEventsTransformer + pydom.context.standard.transformers.InnerHTMLTransformer + pydom.context.standard.transformers.SimpleTransformer + pydom.context.standard.transformers.StyleTransformer + + +Package Contents +---------------- + +.. py:class:: ClassTransformer(prop_name='classes') + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: prop_name + :value: 'classes' + + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(_, prop_value, element) + + +.. py:class:: DashTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(_, prop_value, element) + + +.. py:class:: FalsyTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(_, prop_value) -> bool + + + .. py:method:: transform(prop_name, _, element) + + +.. py:class:: HTMLEventsTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, prop_value) -> bool + + + .. py:method:: transform(prop_name, prop_value, element) + + +.. py:class:: InnerHTMLTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name: str, _) -> bool + + + .. py:method:: transform(_, inner_html, element) + + +.. py:class:: SimpleTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(prop_name, _, element) + + +.. py:class:: StyleTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(_, value) + + + .. py:method:: transform(key: str, value: pydom.styling.StyleSheet, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/inner_html_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/inner_html_transformer/index.rst new file mode 100644 index 0000000..93087e4 --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/inner_html_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.inner_html_transformer +========================================================== + +.. py:module:: pydom.context.standard.transformers.inner_html_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.inner_html_transformer.InnerHTMLTransformer + + +Module Contents +--------------- + +.. py:class:: InnerHTMLTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name: str, _) -> bool + + + .. py:method:: transform(_, inner_html, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/simple_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/simple_transformer/index.rst new file mode 100644 index 0000000..da5afad --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/simple_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.simple_transformer +====================================================== + +.. py:module:: pydom.context.standard.transformers.simple_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.simple_transformer.SimpleTransformer + + +Module Contents +--------------- + +.. py:class:: SimpleTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name, _) -> bool + + + .. py:method:: transform(prop_name, _, element) + + diff --git a/docs/api-reference/pydom/context/standard/transformers/style_transformer/index.rst b/docs/api-reference/pydom/context/standard/transformers/style_transformer/index.rst new file mode 100644 index 0000000..918fd4e --- /dev/null +++ b/docs/api-reference/pydom/context/standard/transformers/style_transformer/index.rst @@ -0,0 +1,32 @@ +pydom.context.standard.transformers.style_transformer +===================================================== + +.. py:module:: pydom.context.standard.transformers.style_transformer + + +Classes +------- + +.. autoapisummary:: + + pydom.context.standard.transformers.style_transformer.StyleTransformer + + +Module Contents +--------------- + +.. py:class:: StyleTransformer + + Bases: :py:obj:`pydom.context.transformers.PropertyTransformer` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(_, value) + + + .. py:method:: transform(key: str, value: pydom.styling.StyleSheet, element) + + diff --git a/docs/api-reference/pydom/context/transformers/index.rst b/docs/api-reference/pydom/context/transformers/index.rst new file mode 100644 index 0000000..917b7f8 --- /dev/null +++ b/docs/api-reference/pydom/context/transformers/index.rst @@ -0,0 +1,76 @@ +pydom.context.transformers +========================== + +.. py:module:: pydom.context.transformers + + +Attributes +---------- + +.. autoapisummary:: + + pydom.context.transformers.T + pydom.context.transformers.P + pydom.context.transformers.PropertyMatcherFunction + pydom.context.transformers.PropertyTransformerFunction + pydom.context.transformers.PostRenderTransformerFunction + + +Classes +------- + +.. autoapisummary:: + + pydom.context.transformers.PropertyTransformer + pydom.context.transformers.PostRenderTransformer + + +Module Contents +--------------- + +.. py:data:: T + +.. py:data:: P + +.. py:data:: PropertyMatcherFunction + :type: typing_extensions.TypeAlias + +.. py:data:: PropertyTransformerFunction + :type: typing_extensions.TypeAlias + +.. py:data:: PostRenderTransformerFunction + :type: typing_extensions.TypeAlias + +.. py:class:: PropertyTransformer + + Bases: :py:obj:`abc.ABC`, :py:obj:`Tuple`\ [\ :py:obj:`PropertyMatcherFunction`\ , :py:obj:`PropertyTransformerFunction`\ ] + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: match(prop_name: str, prop_value, /) -> bool + :abstractmethod: + + + + .. py:method:: transform(prop_name: str, prop_value, element: pydom.rendering.tree.nodes.ContextNode, /) + :abstractmethod: + + + +.. py:class:: PostRenderTransformer + + Bases: :py:obj:`abc.ABC` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:method:: transform(element: pydom.rendering.tree.nodes.ContextNode) + :abstractmethod: + + + diff --git a/docs/api-reference/pydom/element/index.rst b/docs/api-reference/pydom/element/index.rst new file mode 100644 index 0000000..75bac6d --- /dev/null +++ b/docs/api-reference/pydom/element/index.rst @@ -0,0 +1,55 @@ +pydom.element +============= + +.. py:module:: pydom.element + + +Attributes +---------- + +.. autoapisummary:: + + pydom.element.PropsType + + +Classes +------- + +.. autoapisummary:: + + pydom.element.Element + + +Module Contents +--------------- + +.. py:data:: PropsType + +.. py:class:: Element(*args: pydom.types.rendering.ChildType, children: Optional[pydom.types.rendering.ChildrenType] = None, **kwargs: typing_extensions.Unpack[PropsType]) + + Bases: :py:obj:`Generic`\ [\ :py:obj:`PropsType`\ ] + + + .. py:attribute:: children + + + .. py:attribute:: props + + + .. py:attribute:: tag_name + :type: str + + + .. py:attribute:: inline + :value: False + + + + .. py:attribute:: escape_children + :value: True + + + + .. py:method:: __call__(*children: pydom.types.rendering.ChildType) + + diff --git a/docs/api-reference/pydom/errors/index.rst b/docs/api-reference/pydom/errors/index.rst new file mode 100644 index 0000000..5009cba --- /dev/null +++ b/docs/api-reference/pydom/errors/index.rst @@ -0,0 +1,43 @@ +pydom.errors +============ + +.. py:module:: pydom.errors + + +Exceptions +---------- + +.. autoapisummary:: + + pydom.errors.Error + pydom.errors.RenderError + pydom.errors.DependencyOutOfContextError + + +Module Contents +--------------- + +.. py:exception:: Error + + Bases: :py:obj:`Exception` + + + Base class for all pydom exceptions. + + +.. py:exception:: RenderError + + Bases: :py:obj:`Error` + + + Raised when an error occurs while rendering an element. + + +.. py:exception:: DependencyOutOfContextError + + Bases: :py:obj:`Error` + + + Raised when a dependency is requested that is not in the context. + + diff --git a/docs/api-reference/pydom/index.rst b/docs/api-reference/pydom/index.rst new file mode 100644 index 0000000..80a7ad9 --- /dev/null +++ b/docs/api-reference/pydom/index.rst @@ -0,0 +1,1689 @@ +pydom +===== + +.. py:module:: pydom + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/cli/index + /api-reference/pydom/component/index + /api-reference/pydom/context/index + /api-reference/pydom/element/index + /api-reference/pydom/errors/index + /api-reference/pydom/page/index + /api-reference/pydom/rendering/index + /api-reference/pydom/styling/index + /api-reference/pydom/types/index + /api-reference/pydom/version/index + + +Attributes +---------- + +.. autoapisummary:: + + pydom.__version__ + + +Classes +------- + +.. autoapisummary:: + + pydom.Component + pydom.Context + pydom.A + pydom.Abbr + pydom.Address + pydom.Area + pydom.Article + pydom.Aside + pydom.B + pydom.Base + pydom.BlockQuote + pydom.Body + pydom.Br + pydom.Button + pydom.Canvas + pydom.Cite + pydom.Code + pydom.Col + pydom.Div + pydom.Em + pydom.Embed + pydom.Footer + pydom.Form + pydom.Fragment + pydom.H1 + pydom.H2 + pydom.H3 + pydom.H4 + pydom.H5 + pydom.H6 + pydom.Head + pydom.Header + pydom.Hr + pydom.Html + pydom.I + pydom.Img + pydom.Input + pydom.Label + pydom.Li + pydom.Link + pydom.Main + pydom.Meta + pydom.Nav + pydom.Ol + pydom.Option + pydom.P + pydom.Param + pydom.Pre + pydom.Script + pydom.Section + pydom.Select + pydom.Small + pydom.Source + pydom.Span + pydom.Strong + pydom.Style + pydom.Sub + pydom.Sup + pydom.Table + pydom.TBody + pydom.Td + pydom.TextArea + pydom.Th + pydom.THead + pydom.Time + pydom.Title + pydom.Tr + pydom.Track + pydom.U + pydom.Ul + pydom.Wbr + pydom.Page + pydom.SvgA + pydom.Animate + pydom.AnimateMotion + pydom.AnimateTransform + pydom.Circle + pydom.ClipPath + pydom.Defs + pydom.Desc + pydom.Ellipse + pydom.FeBlend + pydom.FeColorMatrix + pydom.FeComponentTransfer + pydom.FeComposite + pydom.FeConvolveMatrix + pydom.FeDiffuseLighting + pydom.FeDisplacementMap + pydom.FeDistantLight + pydom.FeDropShadow + pydom.FeFlood + pydom.FeFuncA + pydom.FeFuncB + pydom.FeFuncG + pydom.FeFuncR + pydom.FeGaussianBlur + pydom.FeImage + pydom.FeMerge + pydom.FeMergeNode + pydom.FeMorphology + pydom.FeOffset + pydom.FePointLight + pydom.FeSpecularLighting + pydom.FeSpotLight + pydom.FeTile + pydom.FeTurbulence + pydom.Filter + pydom.ForeignObject + pydom.G + pydom.Image + pydom.Line + pydom.LinearGradient + pydom.Marker + pydom.Mask + pydom.Metadata + pydom.MPath + pydom.Path + pydom.Pattern + pydom.Polygon + pydom.Polyline + pydom.RadialGradient + pydom.Rect + pydom.SvgScript + pydom.Set + pydom.Stop + pydom.SvgStyle + pydom.Svg + pydom.Switch + pydom.Symbol + pydom.Text + pydom.TextPath + pydom.Title + pydom.TSpan + pydom.Use + pydom.View + + +Functions +--------- + +.. autoapisummary:: + + pydom.render + + +Package Contents +---------------- + +.. py:class:: Component(*children: pydom.types.rendering.ChildType) + + Bases: :py:obj:`abc.ABC` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: children + :type: Tuple[pydom.types.rendering.ChildType, Ellipsis] + + + .. py:method:: render(*_, **kwargs) -> pydom.types.rendering.RenderResult + :abstractmethod: + + + + .. py:method:: __init_subclass__(**kwargs) -> None + :classmethod: + + + + .. py:method:: __call__(*children: pydom.types.rendering.ChildType) + + +.. py:class:: Context + + .. py:attribute:: injector + :type: pydom.utils.injector.Injector + + + .. py:method:: add_prop_transformer(transformer: pydom.context.transformers.PropertyTransformer, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + add_prop_transformer(matcher: pydom.context.transformers.PropertyMatcherFunction, transformer: pydom.context.transformers.PropertyTransformerFunction, /, *, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) -> None + + + .. py:method:: add_post_render_transformer(transformer: Union[pydom.context.transformers.PostRenderTransformerFunction, pydom.context.transformers.PostRenderTransformer], /, *, before: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None) + + + .. py:property:: prop_transformers + + + .. py:property:: post_render_transformers + + + .. py:method:: inject(callback: Callable) -> Callable + + + .. py:method:: standard() -> typing_extensions.Self + :classmethod: + + + +.. py:class:: A(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLAnchorElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'a' + + + +.. py:class:: Abbr(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'abbr' + + + +.. py:class:: Address(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'address' + + + +.. py:class:: Area(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLAreaElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'area' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Article(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'article' + + + +.. py:class:: Aside(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'aside' + + + +.. py:class:: B(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'b' + + + +.. py:class:: Base(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLBaseElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'base' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: BlockQuote(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'blockquote' + + + +.. py:class:: Body(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLBodyElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'body' + + + +.. py:class:: Br(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLBRElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'br' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Button(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLButtonElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'button' + + + +.. py:class:: Canvas(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLCanvasElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'canvas' + + + +.. py:class:: Cite(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'cite' + + + +.. py:class:: Code(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'code' + + + +.. py:class:: Col(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableColElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'col' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Div(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLDivElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'div' + + + +.. py:class:: Em(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'em' + + + +.. py:class:: Embed(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLEmbedElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'embed' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Footer(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'footer' + + + +.. py:class:: Form(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLFormElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'form' + + + +.. py:class:: Fragment(*args: pydom.types.rendering.ChildType, children: Optional[pydom.types.rendering.ChildrenType] = None, **kwargs: typing_extensions.Unpack[PropsType]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: '' + + + +.. py:class:: H1(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h1' + + + +.. py:class:: H2(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h2' + + + +.. py:class:: H3(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h3' + + + +.. py:class:: H4(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h4' + + + +.. py:class:: H5(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h5' + + + +.. py:class:: H6(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'h6' + + + +.. py:class:: Head(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHeadElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'head' + + + +.. py:class:: Header(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'header' + + + +.. py:class:: Hr(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHRElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'hr' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Html(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLHtmlElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'html' + + + +.. py:class:: I(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'i' + + + +.. py:class:: Img(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLImageElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'img' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Input(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLInputElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'input' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Label(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLLabelElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'label' + + + +.. py:class:: Li(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLListItemElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'li' + + + +.. py:class:: Link(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLLinkElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'link' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Main(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'main' + + + +.. py:class:: Meta(*children: pydom.types.ChildType, http_equiv: HttpEquivOptions, content: str) + Meta(*children: pydom.types.ChildType, name: str, content: str) + Meta(*children: pydom.types.ChildType, charset: str) + Meta(*children: pydom.types.ChildType, itemprop: str) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'meta' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Nav(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'nav' + + + +.. py:class:: Ol(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLOrderedListElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'ol' + + + +.. py:class:: Option(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLOptionElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'option' + + + +.. py:class:: P(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLParagraphElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'p' + + + +.. py:class:: Param(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLParamElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'param' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Pre(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLPreElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'pre' + + + +.. py:class:: Script(*children: str, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLScriptElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'script' + + + + .. py:attribute:: escape_children + :value: False + + + +.. py:class:: Section(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'section' + + + +.. py:class:: Select(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLSelectElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'select' + + + +.. py:class:: Small(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'small' + + + +.. py:class:: Source(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLSourceElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'source' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Span(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLSpanElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'span' + + + +.. py:class:: Strong(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'strong' + + + +.. py:class:: Style(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLStyleElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'style' + + + + .. py:attribute:: escape_children + :value: False + + + +.. py:class:: Sub(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'sub' + + + +.. py:class:: Sup(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'sup' + + + +.. py:class:: Table(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'table' + + + +.. py:class:: TBody(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableSectionElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'tbody' + + + +.. py:class:: Td(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableDataCellElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'td' + + + +.. py:class:: TextArea(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTextAreaElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'textarea' + + + +.. py:class:: Th(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableHeaderCellElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'th' + + + +.. py:class:: THead(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableSectionElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'thead' + + + +.. py:class:: Time(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTimeElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'time' + + + +.. py:class:: Title(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTitleElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'title' + + + +.. py:class:: Tr(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTableRowElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'tr' + + + +.. py:class:: Track(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLTrackElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'track' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: U(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'u' + + + +.. py:class:: Ul(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLUnorderedListElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'ul' + + + +.. py:class:: Wbr(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.html.HTMLElementProps]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'wbr' + + + + .. py:attribute:: inline + :value: True + + + +.. py:class:: Page(*children: pydom.types.ChildType, title: Optional[str] = None, html_props: Optional[pydom.types.html.HTMLHtmlElement] = None, head_props: Optional[pydom.types.html.HTMLHeadElement] = None, body_props: Optional[pydom.types.html.HTMLBodyElement] = None) + Page(*, children: pydom.types.ChildrenType, title: Optional[str] = None, html_props: Optional[pydom.types.html.HTMLHtmlElement] = None, head_props: Optional[pydom.types.html.HTMLHeadElement] = None, body_props: Optional[pydom.types.html.HTMLBodyElement] = None) + + Bases: :py:obj:`pydom.component.Component` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: title + :value: None + + + + .. py:method:: head() -> Iterable[pydom.types.ChildType] + + The children that will be inside the `head` tag. + + + + .. py:method:: body() -> Iterable[pydom.types.ChildType] + + The children that will be inside the `body` tag. + + + + .. py:method:: render() + + + .. py:method:: __init_subclass__(title: Optional[str] = None, **kwargs) -> None + :classmethod: + + + +.. py:class:: SvgA(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGAnchorElement]) + + Bases: :py:obj:`pydom.element.Element` + + + The SVG element provides a way to create hyperlinks within SVG content. It supports any SVG element or graphics element. + + :Notice: The SVG element is not the same as the HTML element. The SVG element is a container for graphics, while the HTML element is a hypertext link. + + + .. py:attribute:: tag_name + :value: 'a' + + + +.. py:class:: Animate(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGAnimateElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'animate' + + + +.. py:class:: AnimateMotion(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGAnimateMotionElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'animatemotion' + + + +.. py:class:: AnimateTransform(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGAnimateTransformElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'animatetransform' + + + +.. py:class:: Circle(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGCircleElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'circle' + + + +.. py:class:: ClipPath(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGClipPathElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'clippath' + + + +.. py:class:: Defs(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGDefsElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'defs' + + + +.. py:class:: Desc(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGDescElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'desc' + + + +.. py:class:: Ellipse(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGEllipseElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'ellipse' + + + +.. py:class:: FeBlend(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEBlendElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feblend' + + + +.. py:class:: FeColorMatrix(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEColorMatrixElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fecolormatrix' + + + +.. py:class:: FeComponentTransfer(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEComponentTransferElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fecomponenttransfer' + + + +.. py:class:: FeComposite(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFECompositeElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fecomposite' + + + +.. py:class:: FeConvolveMatrix(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEConvolveMatrixElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feconvolvematrix' + + + +.. py:class:: FeDiffuseLighting(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEDiffuseLightingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fediffuselighting' + + + +.. py:class:: FeDisplacementMap(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEDisplacementMapElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fedisplacementmap' + + + +.. py:class:: FeDistantLight(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEDistantLightElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fedistantlight' + + + +.. py:class:: FeDropShadow(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEDropShadowElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fedropshadow' + + + +.. py:class:: FeFlood(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEFloodElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feflood' + + + +.. py:class:: FeFuncA(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEFuncAElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fefunca' + + + +.. py:class:: FeFuncB(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEFuncBElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fefuncb' + + + +.. py:class:: FeFuncG(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEFuncGElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fefuncg' + + + +.. py:class:: FeFuncR(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEFuncRElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fefuncr' + + + +.. py:class:: FeGaussianBlur(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEGaussianBlurElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fegaussianblur' + + + +.. py:class:: FeImage(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEImageElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feimage' + + + +.. py:class:: FeMerge(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEMergeElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'femerge' + + + +.. py:class:: FeMergeNode(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEMergeNodeElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'femergenode' + + + +.. py:class:: FeMorphology(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEMorphologyElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'femorphology' + + + +.. py:class:: FeOffset(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEOffsetElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feoffset' + + + +.. py:class:: FePointLight(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFEPointLightElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fepointlight' + + + +.. py:class:: FeSpecularLighting(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFESpecularLightingElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fespecularlighting' + + + +.. py:class:: FeSpotLight(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFESpotLightElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fespotlight' + + + +.. py:class:: FeTile(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFETileElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'fetile' + + + +.. py:class:: FeTurbulence(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFETurbulenceElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'feturbulence' + + + +.. py:class:: Filter(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGFilterElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'filter' + + + +.. py:class:: ForeignObject(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGForeignObjectElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'foreignobject' + + + +.. py:class:: G(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGGElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'g' + + + +.. py:class:: Image(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGImageElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'image' + + + +.. py:class:: Line(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGLineElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'line' + + + +.. py:class:: LinearGradient(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGLinearGradientElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'lineargradient' + + + +.. py:class:: Marker(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGMarkerElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'marker' + + + +.. py:class:: Mask(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGMaskElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'mask' + + + +.. py:class:: Metadata(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGMetadataElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'metadata' + + + +.. py:class:: MPath(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGMPathElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'mpath' + + + +.. py:class:: Path(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGPathElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'path' + + + +.. py:class:: Pattern(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGPatternElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'pattern' + + + +.. py:class:: Polygon(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGPolygonElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'polygon' + + + +.. py:class:: Polyline(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGPolylineElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'polyline' + + + +.. py:class:: RadialGradient(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGRadialGradientElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'radialgradient' + + + +.. py:class:: Rect(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGRectElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'rect' + + + +.. py:class:: SvgScript(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGScriptElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'script' + + + +.. py:class:: Set(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGSetElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'set' + + + +.. py:class:: Stop(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGStopElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'stop' + + + +.. py:class:: SvgStyle(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGStyleElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'style' + + + +.. py:class:: Svg(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGSVGElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'svg' + + + +.. py:class:: Switch(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGSwitchElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'switch' + + + +.. py:class:: Symbol(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGSymbolElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'symbol' + + + +.. py:class:: Text(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGTextElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'text' + + + +.. py:class:: TextPath(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGTextPathElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'textpath' + + + +.. py:class:: Title(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGTitleElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'title' + + + +.. py:class:: TSpan(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGTSpanElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'tspan' + + + +.. py:class:: Use(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGUseElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'use' + + + +.. py:class:: View(*children: pydom.types.ChildType, **kwargs: typing_extensions.Unpack[pydom.types.svg.SVGViewElement]) + + Bases: :py:obj:`pydom.element.Element` + + + .. py:attribute:: tag_name + :value: 'view' + + + +.. py:function:: render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, to: Literal['html'], pretty: bool = False, tab_indent: int = 1, context: Optional[pydom.context.Context] = None, **render_state_data) -> str + render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, to: Literal['json'], context: Optional[pydom.context.Context] = None, **render_state_data) -> pydom.types.rendering.RenderResultJSON + render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, pretty: bool = False, tab_indent: int = 1, context: Optional[pydom.context.Context] = None, **render_state_data) -> str + +.. py:data:: __version__ + :value: '0.3.1' + + diff --git a/docs/api-reference/pydom/page/index.rst b/docs/api-reference/pydom/page/index.rst new file mode 100644 index 0000000..af78b5c --- /dev/null +++ b/docs/api-reference/pydom/page/index.rst @@ -0,0 +1,52 @@ +pydom.page +========== + +.. py:module:: pydom.page + + +Classes +------- + +.. autoapisummary:: + + pydom.page.Page + + +Module Contents +--------------- + +.. py:class:: Page(*children: pydom.types.ChildType, title: Optional[str] = None, html_props: Optional[pydom.types.html.HTMLHtmlElement] = None, head_props: Optional[pydom.types.html.HTMLHeadElement] = None, body_props: Optional[pydom.types.html.HTMLBodyElement] = None) + Page(*, children: pydom.types.ChildrenType, title: Optional[str] = None, html_props: Optional[pydom.types.html.HTMLHtmlElement] = None, head_props: Optional[pydom.types.html.HTMLHeadElement] = None, body_props: Optional[pydom.types.html.HTMLBodyElement] = None) + + Bases: :py:obj:`pydom.component.Component` + + + Helper class that provides a standard way to create an ABC using + inheritance. + + + .. py:attribute:: title + :value: None + + + + .. py:method:: head() -> Iterable[pydom.types.ChildType] + + The children that will be inside the `head` tag. + + + + .. py:method:: body() -> Iterable[pydom.types.ChildType] + + The children that will be inside the `body` tag. + + + + .. py:method:: render() + + + .. py:method:: __init_subclass__(title: Optional[str] = None, **kwargs) -> None + :classmethod: + + + diff --git a/docs/api-reference/pydom/rendering/html/index.rst b/docs/api-reference/pydom/rendering/html/index.rst new file mode 100644 index 0000000..96412b6 --- /dev/null +++ b/docs/api-reference/pydom/rendering/html/index.rst @@ -0,0 +1,30 @@ +pydom.rendering.html +==================== + +.. py:module:: pydom.rendering.html + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.html.render_html + + +Module Contents +--------------- + +.. py:function:: render_html(element: pydom.types.RenderResult, *, context: Optional[pydom.context.Context] = None, pretty=False, tab_indent=1, **render_state_data) -> str + + Renders the given element into an HTML string. + + Args: + element (Renderable | Primitive): The element to be rendered. + pretty (bool, optional): Whether to format the HTML string with indentation and line breaks. Defaults to False. + tab_indent (int, optional): The number of spaces to use for indentation when pretty is True. Defaults to 1. + + Returns: + str: The rendered HTML string. + + diff --git a/docs/api-reference/pydom/rendering/index.rst b/docs/api-reference/pydom/rendering/index.rst new file mode 100644 index 0000000..51dae93 --- /dev/null +++ b/docs/api-reference/pydom/rendering/index.rst @@ -0,0 +1,52 @@ +pydom.rendering +=============== + +.. py:module:: pydom.rendering + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/rendering/html/index + /api-reference/pydom/rendering/json/index + /api-reference/pydom/rendering/props/index + /api-reference/pydom/rendering/render_state/index + /api-reference/pydom/rendering/transformers/index + /api-reference/pydom/rendering/tree/index + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.render_html + pydom.rendering.render_json + pydom.rendering.render + + +Package Contents +---------------- + +.. py:function:: render_html(element: pydom.types.RenderResult, *, context: Optional[pydom.context.Context] = None, pretty=False, tab_indent=1, **render_state_data) -> str + + Renders the given element into an HTML string. + + Args: + element (Renderable | Primitive): The element to be rendered. + pretty (bool, optional): Whether to format the HTML string with indentation and line breaks. Defaults to False. + tab_indent (int, optional): The number of spaces to use for indentation when pretty is True. Defaults to 1. + + Returns: + str: The rendered HTML string. + + +.. py:function:: render_json(element: pydom.types.RenderResult, *, context: Optional[pydom.context.Context] = None, **render_state_data) + +.. py:function:: render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, to: Literal['html'], pretty: bool = False, tab_indent: int = 1, context: Optional[pydom.context.Context] = None, **render_state_data) -> str + render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, to: Literal['json'], context: Optional[pydom.context.Context] = None, **render_state_data) -> pydom.types.rendering.RenderResultJSON + render(element: Union[pydom.types.Renderable, pydom.types.Primitive], *, pretty: bool = False, tab_indent: int = 1, context: Optional[pydom.context.Context] = None, **render_state_data) -> str + diff --git a/docs/api-reference/pydom/rendering/json/index.rst b/docs/api-reference/pydom/rendering/json/index.rst new file mode 100644 index 0000000..6f509db --- /dev/null +++ b/docs/api-reference/pydom/rendering/json/index.rst @@ -0,0 +1,19 @@ +pydom.rendering.json +==================== + +.. py:module:: pydom.rendering.json + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.json.render_json + + +Module Contents +--------------- + +.. py:function:: render_json(element: pydom.types.RenderResult, *, context: Optional[pydom.context.Context] = None, **render_state_data) + diff --git a/docs/api-reference/pydom/rendering/props/index.rst b/docs/api-reference/pydom/rendering/props/index.rst new file mode 100644 index 0000000..83fddcc --- /dev/null +++ b/docs/api-reference/pydom/rendering/props/index.rst @@ -0,0 +1,22 @@ +pydom.rendering.props +===================== + +.. py:module:: pydom.rendering.props + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.props.transform_props + pydom.rendering.props.render_props + + +Module Contents +--------------- + +.. py:function:: transform_props(element: pydom.rendering.tree.nodes.context_node.ContextNode, *, context: pydom.context.Context) + +.. py:function:: render_props(props: Dict[str, Any]) -> str + diff --git a/docs/api-reference/pydom/rendering/render_state/index.rst b/docs/api-reference/pydom/rendering/render_state/index.rst new file mode 100644 index 0000000..ea9efc0 --- /dev/null +++ b/docs/api-reference/pydom/rendering/render_state/index.rst @@ -0,0 +1,29 @@ +pydom.rendering.render_state +============================ + +.. py:module:: pydom.rendering.render_state + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.render_state.RenderState + + +Module Contents +--------------- + +.. py:class:: RenderState(*, root: Union[pydom.types.Renderable, pydom.types.Primitive], render_target: pydom.types.RenderTarget, **kwargs) + + .. py:attribute:: root + + + .. py:attribute:: render_target + :type: pydom.types.RenderTarget + + + .. py:attribute:: custom_data + + diff --git a/docs/api-reference/pydom/rendering/transformers/index.rst b/docs/api-reference/pydom/rendering/transformers/index.rst new file mode 100644 index 0000000..09208f8 --- /dev/null +++ b/docs/api-reference/pydom/rendering/transformers/index.rst @@ -0,0 +1,73 @@ +pydom.rendering.transformers +============================ + +.. py:module:: pydom.rendering.transformers + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/rendering/transformers/post_render_transformer/index + /api-reference/pydom/rendering/transformers/property_transformer/index + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.transformers.post_render_transformer + pydom.rendering.transformers.property_transformer + + +Package Contents +---------------- + +.. py:function:: post_render_transformer(*, context: Union[pydom.context.context.Context, None] = None, before: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None) + + A decorator to register a function as a post-render transformer. + + Args: + context: The context to register the transformer with. If not provided, the default context is used. + + Returns: + A decorator that takes a transformer function and registers it. + + Example: + >>> @post_render_transformer() + ... def add_custom_script(root: ElementNode): + ... root.get_by_tag("head").append_child( + ... ElementNode( + ... tag_name="script", + ... props={"src": "/custom.js"}, + ... ) + ... ) + + + +.. py:function:: property_transformer(matcher: Union[Callable[[str, Any], bool], str], *, context: Optional[pydom.context.context.Context] = None, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) + + A decorator to register a function as a property transformer. + + Args: + matcher: A callable that takes a key and a value and returns a boolean + indicating whether the transformer should be applied. + If a string is provided, it is assumed to be a key that should be matched exactly. + context: The context to register the transformer in. If not provided, the default context is used. + + Returns: + A decorator that takes a transformer function and registers it. + + Example: + >>> @property_transformer("class_name") + ... def class_name_mapper(key, value, element): + ... if isinstance(class_name, list): + ... class_name = " ".join(class_name) + ... + ... element.props["class"] = " ".join(str(class_name).split()) + + + diff --git a/docs/api-reference/pydom/rendering/transformers/post_render_transformer/index.rst b/docs/api-reference/pydom/rendering/transformers/post_render_transformer/index.rst new file mode 100644 index 0000000..59921f5 --- /dev/null +++ b/docs/api-reference/pydom/rendering/transformers/post_render_transformer/index.rst @@ -0,0 +1,39 @@ +pydom.rendering.transformers.post_render_transformer +==================================================== + +.. py:module:: pydom.rendering.transformers.post_render_transformer + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.transformers.post_render_transformer.post_render_transformer + + +Module Contents +--------------- + +.. py:function:: post_render_transformer(*, context: Union[pydom.context.context.Context, None] = None, before: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PostRenderTransformer]]] = None) + + A decorator to register a function as a post-render transformer. + + Args: + context: The context to register the transformer with. If not provided, the default context is used. + + Returns: + A decorator that takes a transformer function and registers it. + + Example: + >>> @post_render_transformer() + ... def add_custom_script(root: ElementNode): + ... root.get_by_tag("head").append_child( + ... ElementNode( + ... tag_name="script", + ... props={"src": "/custom.js"}, + ... ) + ... ) + + + diff --git a/docs/api-reference/pydom/rendering/transformers/property_transformer/index.rst b/docs/api-reference/pydom/rendering/transformers/property_transformer/index.rst new file mode 100644 index 0000000..2bc9665 --- /dev/null +++ b/docs/api-reference/pydom/rendering/transformers/property_transformer/index.rst @@ -0,0 +1,40 @@ +pydom.rendering.transformers.property_transformer +================================================= + +.. py:module:: pydom.rendering.transformers.property_transformer + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.transformers.property_transformer.property_transformer + + +Module Contents +--------------- + +.. py:function:: property_transformer(matcher: Union[Callable[[str, Any], bool], str], *, context: Optional[pydom.context.context.Context] = None, before: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None, after: Optional[List[Type[pydom.context.transformers.PropertyTransformer]]] = None) + + A decorator to register a function as a property transformer. + + Args: + matcher: A callable that takes a key and a value and returns a boolean + indicating whether the transformer should be applied. + If a string is provided, it is assumed to be a key that should be matched exactly. + context: The context to register the transformer in. If not provided, the default context is used. + + Returns: + A decorator that takes a transformer function and registers it. + + Example: + >>> @property_transformer("class_name") + ... def class_name_mapper(key, value, element): + ... if isinstance(class_name, list): + ... class_name = " ".join(class_name) + ... + ... element.props["class"] = " ".join(str(class_name).split()) + + + diff --git a/docs/api-reference/pydom/rendering/tree/index.rst b/docs/api-reference/pydom/rendering/tree/index.rst new file mode 100644 index 0000000..2ee2b7b --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/index.rst @@ -0,0 +1,70 @@ +pydom.rendering.tree +==================== + +.. py:module:: pydom.rendering.tree + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/rendering/tree/nodes/index + /api-reference/pydom/rendering/tree/tree/index + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.TreeNode + pydom.rendering.tree.TextNode + pydom.rendering.tree.ElementNode + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.tree.build_tree + + +Package Contents +---------------- + +.. py:function:: build_tree(renderable: Union[pydom.types.Renderable, pydom.types.Primitive], *, context: pydom.context.Context) -> pydom.rendering.tree.nodes.TreeNode + +.. py:class:: TreeNode(*, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + .. py:attribute:: parent + :value: None + + + +.. py:class:: TextNode(text: str, *, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: text + + +.. py:class:: ElementNode(tag_name: str, props: Optional[dict] = None, children: Optional[List[pydom.rendering.tree.nodes.tree_node.TreeNode]] = None, parent: Optional[ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: tag_name + + + .. py:attribute:: props + + + .. py:attribute:: children + :value: None + + + diff --git a/docs/api-reference/pydom/rendering/tree/nodes/context_node/index.rst b/docs/api-reference/pydom/rendering/tree/nodes/context_node/index.rst new file mode 100644 index 0000000..f668063 --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/nodes/context_node/index.rst @@ -0,0 +1,52 @@ +pydom.rendering.tree.nodes.context_node +======================================= + +.. py:module:: pydom.rendering.tree.nodes.context_node + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.nodes.context_node.ContextNode + + +Module Contents +--------------- + +.. py:class:: ContextNode(node: pydom.rendering.tree.nodes.element_node.ElementNode, context: pydom.context.Context) + + .. py:attribute:: node + + + .. py:attribute:: context + + + .. py:method:: get_by_tag(tag: str) + + + .. py:method:: get_all_by_tag(tag: str) + + + .. py:method:: insert_after(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: insert_before(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: insert_child(index: int, node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: append_child(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:property:: children + + + .. py:property:: parent + + + .. py:property:: props + + diff --git a/docs/api-reference/pydom/rendering/tree/nodes/element_node/index.rst b/docs/api-reference/pydom/rendering/tree/nodes/element_node/index.rst new file mode 100644 index 0000000..0a412f6 --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/nodes/element_node/index.rst @@ -0,0 +1,33 @@ +pydom.rendering.tree.nodes.element_node +======================================= + +.. py:module:: pydom.rendering.tree.nodes.element_node + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.nodes.element_node.ElementNode + + +Module Contents +--------------- + +.. py:class:: ElementNode(tag_name: str, props: Optional[dict] = None, children: Optional[List[pydom.rendering.tree.nodes.tree_node.TreeNode]] = None, parent: Optional[ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: tag_name + + + .. py:attribute:: props + + + .. py:attribute:: children + :value: None + + + diff --git a/docs/api-reference/pydom/rendering/tree/nodes/index.rst b/docs/api-reference/pydom/rendering/tree/nodes/index.rst new file mode 100644 index 0000000..019f953 --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/nodes/index.rst @@ -0,0 +1,98 @@ +pydom.rendering.tree.nodes +========================== + +.. py:module:: pydom.rendering.tree.nodes + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/rendering/tree/nodes/context_node/index + /api-reference/pydom/rendering/tree/nodes/element_node/index + /api-reference/pydom/rendering/tree/nodes/text_node/index + /api-reference/pydom/rendering/tree/nodes/tree_node/index + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.nodes.ContextNode + pydom.rendering.tree.nodes.ElementNode + pydom.rendering.tree.nodes.TreeNode + pydom.rendering.tree.nodes.TextNode + + +Package Contents +---------------- + +.. py:class:: ContextNode(node: pydom.rendering.tree.nodes.element_node.ElementNode, context: pydom.context.Context) + + .. py:attribute:: node + + + .. py:attribute:: context + + + .. py:method:: get_by_tag(tag: str) + + + .. py:method:: get_all_by_tag(tag: str) + + + .. py:method:: insert_after(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: insert_before(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: insert_child(index: int, node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:method:: append_child(node: Union[pydom.types.Renderable, pydom.types.Primitive]) + + + .. py:property:: children + + + .. py:property:: parent + + + .. py:property:: props + + +.. py:class:: ElementNode(tag_name: str, props: Optional[dict] = None, children: Optional[List[pydom.rendering.tree.nodes.tree_node.TreeNode]] = None, parent: Optional[ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: tag_name + + + .. py:attribute:: props + + + .. py:attribute:: children + :value: None + + + +.. py:class:: TreeNode(*, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + .. py:attribute:: parent + :value: None + + + +.. py:class:: TextNode(text: str, *, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: text + + diff --git a/docs/api-reference/pydom/rendering/tree/nodes/text_node/index.rst b/docs/api-reference/pydom/rendering/tree/nodes/text_node/index.rst new file mode 100644 index 0000000..409cafe --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/nodes/text_node/index.rst @@ -0,0 +1,25 @@ +pydom.rendering.tree.nodes.text_node +==================================== + +.. py:module:: pydom.rendering.tree.nodes.text_node + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.nodes.text_node.TextNode + + +Module Contents +--------------- + +.. py:class:: TextNode(text: str, *, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + Bases: :py:obj:`pydom.rendering.tree.nodes.tree_node.TreeNode` + + + .. py:attribute:: text + + diff --git a/docs/api-reference/pydom/rendering/tree/nodes/tree_node/index.rst b/docs/api-reference/pydom/rendering/tree/nodes/tree_node/index.rst new file mode 100644 index 0000000..a4db14d --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/nodes/tree_node/index.rst @@ -0,0 +1,24 @@ +pydom.rendering.tree.nodes.tree_node +==================================== + +.. py:module:: pydom.rendering.tree.nodes.tree_node + + +Classes +------- + +.. autoapisummary:: + + pydom.rendering.tree.nodes.tree_node.TreeNode + + +Module Contents +--------------- + +.. py:class:: TreeNode(*, parent: Optional[pydom.rendering.tree.nodes.element_node.ElementNode] = None) + + .. py:attribute:: parent + :value: None + + + diff --git a/docs/api-reference/pydom/rendering/tree/tree/index.rst b/docs/api-reference/pydom/rendering/tree/tree/index.rst new file mode 100644 index 0000000..cf7a80c --- /dev/null +++ b/docs/api-reference/pydom/rendering/tree/tree/index.rst @@ -0,0 +1,22 @@ +pydom.rendering.tree.tree +========================= + +.. py:module:: pydom.rendering.tree.tree + + +Functions +--------- + +.. autoapisummary:: + + pydom.rendering.tree.tree.build_raw_tree + pydom.rendering.tree.tree.build_tree + + +Module Contents +--------------- + +.. py:function:: build_raw_tree(renderable: Union[pydom.types.Renderable, pydom.types.Primitive], *, context: pydom.context.Context, escape_string=True) -> pydom.rendering.tree.nodes.TreeNode + +.. py:function:: build_tree(renderable: Union[pydom.types.Renderable, pydom.types.Primitive], *, context: pydom.context.Context) -> pydom.rendering.tree.nodes.TreeNode + diff --git a/docs/api-reference/pydom/styling/color/index.rst b/docs/api-reference/pydom/styling/color/index.rst new file mode 100644 index 0000000..01f0b53 --- /dev/null +++ b/docs/api-reference/pydom/styling/color/index.rst @@ -0,0 +1,266 @@ +pydom.styling.color +=================== + +.. py:module:: pydom.styling.color + + +Classes +------- + +.. autoapisummary:: + + pydom.styling.color.Color + + +Module Contents +--------------- + +.. py:class:: Color(r, g, b, a=1) + + .. py:attribute:: BLACK + :type: Color + + + .. py:attribute:: BLUE + :type: Color + + + .. py:attribute:: DARK_BLUE + :type: Color + + + .. py:attribute:: MIDNIGHT_BLUE + :type: Color + + + .. py:attribute:: DARK_SLATE_BLUE + :type: Color + + + .. py:attribute:: SLATE_BLUE + :type: Color + + + .. py:attribute:: MEDIUM_SLATE_BLUE + :type: Color + + + .. py:attribute:: MEDIUM_BLUE + :type: Color + + + .. py:attribute:: ROYAL_BLUE + :type: Color + + + .. py:attribute:: CORNFLOWER_BLUE + :type: Color + + + .. py:attribute:: DODGER_BLUE + :type: Color + + + .. py:attribute:: DEEP_SKY_BLUE + :type: Color + + + .. py:attribute:: LIGHT_SKY_BLUE + :type: Color + + + .. py:attribute:: SKY_BLUE + :type: Color + + + .. py:attribute:: LIGHT_BLUE + :type: Color + + + .. py:attribute:: STEEL_BLUE + :type: Color + + + .. py:attribute:: ALICE_BLUE + :type: Color + + + .. py:attribute:: WHITE + :type: Color + + + .. py:attribute:: GAINSBORO + :type: Color + + + .. py:attribute:: LIGHT_GREY + :type: Color + + + .. py:attribute:: SILVER + :type: Color + + + .. py:attribute:: DIM_GREY + :type: Color + + + .. py:attribute:: GREY + :type: Color + + + .. py:attribute:: DARK_GREY + :type: Color + + + .. py:attribute:: SLATE_GREY + :type: Color + + + .. py:attribute:: LIGHT_SLATE_GREY + :type: Color + + + .. py:attribute:: LIGHT_STEEL_BLUE + :type: Color + + + .. py:attribute:: YELLOW + :type: Color + + + .. py:attribute:: ORANGE + :type: Color + + + .. py:attribute:: RED + :type: Color + + + .. py:attribute:: BROWN + :type: Color + + + .. py:attribute:: WHITE_SMOKE + :type: Color + + + .. py:attribute:: GREEN + :type: Color + + + .. py:attribute:: DARK_SLATE_GREY + :type: Color + + + .. py:attribute:: LAVENDER + :type: Color + + + .. py:attribute:: MEDIUM_PURPLE + :type: Color + + + .. py:attribute:: VIOLET + :type: Color + + + .. py:attribute:: PLUM + :type: Color + + + .. py:attribute:: THISTLE + :type: Color + + + .. py:attribute:: LAVENDER_BLUSH + :type: Color + + + .. py:attribute:: MISTY_ROSE + :type: Color + + + .. py:attribute:: ANTIQUE_WHITE + :type: Color + + + .. py:attribute:: LINEN + :type: Color + + + .. py:attribute:: BEIGE + :type: Color + + + .. py:attribute:: PINK + :type: Color + + + .. py:attribute:: r + + + .. py:attribute:: g + + + .. py:attribute:: b + + + .. py:attribute:: a + :value: 1 + + + + .. py:method:: from_hex(hex) + :classmethod: + + + + .. py:method:: from_rgb(r, g, b) + :classmethod: + + + + .. py:method:: from_rgba(r, g, b, a) + :classmethod: + + + + .. py:method:: from_hsl(h, s, l) + :classmethod: + + + + .. py:method:: from_hsla(h, s, l, a) + :classmethod: + + + + .. py:method:: to_hex() + + + .. py:method:: to_rgb() + + + .. py:method:: to_rgba() + + + .. py:method:: to_hsl() + + + .. py:method:: to_hsla() + + + .. py:method:: rgb_to_hsl(r, g, b) + :staticmethod: + + + + .. py:method:: hsl_to_rgb(h, s, l) + :staticmethod: + + + + .. py:method:: __str__() + + diff --git a/docs/api-reference/pydom/styling/css_modules/index.rst b/docs/api-reference/pydom/styling/css_modules/index.rst new file mode 100644 index 0000000..9f348b0 --- /dev/null +++ b/docs/api-reference/pydom/styling/css_modules/index.rst @@ -0,0 +1,19 @@ +pydom.styling.css_modules +========================= + +.. py:module:: pydom.styling.css_modules + + +Classes +------- + +.. autoapisummary:: + + pydom.styling.css_modules.CSS + + +Module Contents +--------------- + +.. py:class:: CSS + diff --git a/docs/api-reference/pydom/styling/index.rst b/docs/api-reference/pydom/styling/index.rst new file mode 100644 index 0000000..de2817f --- /dev/null +++ b/docs/api-reference/pydom/styling/index.rst @@ -0,0 +1,299 @@ +pydom.styling +============= + +.. py:module:: pydom.styling + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/styling/color/index + /api-reference/pydom/styling/css_modules/index + /api-reference/pydom/styling/stylesheet/index + + +Classes +------- + +.. autoapisummary:: + + pydom.styling.Color + pydom.styling.StyleSheet + pydom.styling.CSS + + +Package Contents +---------------- + +.. py:class:: Color(r, g, b, a=1) + + .. py:attribute:: BLACK + :type: Color + + + .. py:attribute:: BLUE + :type: Color + + + .. py:attribute:: DARK_BLUE + :type: Color + + + .. py:attribute:: MIDNIGHT_BLUE + :type: Color + + + .. py:attribute:: DARK_SLATE_BLUE + :type: Color + + + .. py:attribute:: SLATE_BLUE + :type: Color + + + .. py:attribute:: MEDIUM_SLATE_BLUE + :type: Color + + + .. py:attribute:: MEDIUM_BLUE + :type: Color + + + .. py:attribute:: ROYAL_BLUE + :type: Color + + + .. py:attribute:: CORNFLOWER_BLUE + :type: Color + + + .. py:attribute:: DODGER_BLUE + :type: Color + + + .. py:attribute:: DEEP_SKY_BLUE + :type: Color + + + .. py:attribute:: LIGHT_SKY_BLUE + :type: Color + + + .. py:attribute:: SKY_BLUE + :type: Color + + + .. py:attribute:: LIGHT_BLUE + :type: Color + + + .. py:attribute:: STEEL_BLUE + :type: Color + + + .. py:attribute:: ALICE_BLUE + :type: Color + + + .. py:attribute:: WHITE + :type: Color + + + .. py:attribute:: GAINSBORO + :type: Color + + + .. py:attribute:: LIGHT_GREY + :type: Color + + + .. py:attribute:: SILVER + :type: Color + + + .. py:attribute:: DIM_GREY + :type: Color + + + .. py:attribute:: GREY + :type: Color + + + .. py:attribute:: DARK_GREY + :type: Color + + + .. py:attribute:: SLATE_GREY + :type: Color + + + .. py:attribute:: LIGHT_SLATE_GREY + :type: Color + + + .. py:attribute:: LIGHT_STEEL_BLUE + :type: Color + + + .. py:attribute:: YELLOW + :type: Color + + + .. py:attribute:: ORANGE + :type: Color + + + .. py:attribute:: RED + :type: Color + + + .. py:attribute:: BROWN + :type: Color + + + .. py:attribute:: WHITE_SMOKE + :type: Color + + + .. py:attribute:: GREEN + :type: Color + + + .. py:attribute:: DARK_SLATE_GREY + :type: Color + + + .. py:attribute:: LAVENDER + :type: Color + + + .. py:attribute:: MEDIUM_PURPLE + :type: Color + + + .. py:attribute:: VIOLET + :type: Color + + + .. py:attribute:: PLUM + :type: Color + + + .. py:attribute:: THISTLE + :type: Color + + + .. py:attribute:: LAVENDER_BLUSH + :type: Color + + + .. py:attribute:: MISTY_ROSE + :type: Color + + + .. py:attribute:: ANTIQUE_WHITE + :type: Color + + + .. py:attribute:: LINEN + :type: Color + + + .. py:attribute:: BEIGE + :type: Color + + + .. py:attribute:: PINK + :type: Color + + + .. py:attribute:: r + + + .. py:attribute:: g + + + .. py:attribute:: b + + + .. py:attribute:: a + :value: 1 + + + + .. py:method:: from_hex(hex) + :classmethod: + + + + .. py:method:: from_rgb(r, g, b) + :classmethod: + + + + .. py:method:: from_rgba(r, g, b, a) + :classmethod: + + + + .. py:method:: from_hsl(h, s, l) + :classmethod: + + + + .. py:method:: from_hsla(h, s, l, a) + :classmethod: + + + + .. py:method:: to_hex() + + + .. py:method:: to_rgb() + + + .. py:method:: to_rgba() + + + .. py:method:: to_hsl() + + + .. py:method:: to_hsla() + + + .. py:method:: rgb_to_hsl(r, g, b) + :staticmethod: + + + + .. py:method:: hsl_to_rgb(h, s, l) + :staticmethod: + + + + .. py:method:: __str__() + + +.. py:class:: StyleSheet(*styles: Union[StyleSheet, pydom.types.styling.css_properties.CSSProperties], **kwargs: typing_extensions.Unpack[pydom.types.styling.css_properties.CSSProperties]) + + .. py:attribute:: style + :type: Dict[str, object] + + + .. py:method:: copy() + + + .. py:method:: to_css() + + + .. py:method:: __str__() + + + .. py:method:: __getattr__(name: str) + + +.. py:class:: CSS + diff --git a/docs/api-reference/pydom/styling/stylesheet/index.rst b/docs/api-reference/pydom/styling/stylesheet/index.rst new file mode 100644 index 0000000..d25534d --- /dev/null +++ b/docs/api-reference/pydom/styling/stylesheet/index.rst @@ -0,0 +1,45 @@ +pydom.styling.stylesheet +======================== + +.. py:module:: pydom.styling.stylesheet + + +Attributes +---------- + +.. autoapisummary:: + + pydom.styling.stylesheet.T + + +Classes +------- + +.. autoapisummary:: + + pydom.styling.stylesheet.StyleSheet + + +Module Contents +--------------- + +.. py:data:: T + +.. py:class:: StyleSheet(*styles: Union[StyleSheet, pydom.types.styling.css_properties.CSSProperties], **kwargs: typing_extensions.Unpack[pydom.types.styling.css_properties.CSSProperties]) + + .. py:attribute:: style + :type: Dict[str, object] + + + .. py:method:: copy() + + + .. py:method:: to_css() + + + .. py:method:: __str__() + + + .. py:method:: __getattr__(name: str) + + diff --git a/docs/api-reference/pydom/types/element/index.rst b/docs/api-reference/pydom/types/element/index.rst new file mode 100644 index 0000000..8639c64 --- /dev/null +++ b/docs/api-reference/pydom/types/element/index.rst @@ -0,0 +1,101 @@ +pydom.types.element +=================== + +.. py:module:: pydom.types.element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.element.ElementProps + + +Module Contents +--------------- + +.. py:class:: ElementProps + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: access_key + :type: str + + + .. py:attribute:: auto_capitalize + :type: str + + + .. py:attribute:: classes + :type: str + + + .. py:attribute:: content_editable + :type: str + + + .. py:attribute:: dangerously_set_inner_html + :type: str + + + .. py:attribute:: dir + :type: str + + + .. py:attribute:: draggable + :type: str + + + .. py:attribute:: hidden + :type: str + + + .. py:attribute:: id + :type: str + + + .. py:attribute:: input_mode + :type: str + + + .. py:attribute:: lang + :type: str + + + .. py:attribute:: role + :type: str + + + .. py:attribute:: spell_check + :type: str + + + .. py:attribute:: style + :type: str + + + .. py:attribute:: tab_index + :type: str + + + .. py:attribute:: title + :type: str + + + .. py:attribute:: translate + :type: str + + diff --git a/docs/api-reference/pydom/types/index.rst b/docs/api-reference/pydom/types/index.rst new file mode 100644 index 0000000..f679ef6 --- /dev/null +++ b/docs/api-reference/pydom/types/index.rst @@ -0,0 +1,3677 @@ +pydom.types +=========== + +.. py:module:: pydom.types + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/types/element/index + /api-reference/pydom/types/rendering/index + /api-reference/pydom/types/styling/index + /api-reference/pydom/types/svg/index + + +Attributes +---------- + +.. autoapisummary:: + + pydom.types.ChildType + pydom.types.ChildrenType + pydom.types.Primitive + pydom.types.Renderable + pydom.types.RenderResult + pydom.types.RenderTarget + + +Classes +------- + +.. autoapisummary:: + + pydom.types.AriaProps + pydom.types.HTMLAnchorElement + pydom.types.HTMLAreaElement + pydom.types.HTMLAudioElement + pydom.types.HTMLBaseElement + pydom.types.HTMLBodyElement + pydom.types.HTMLBRElement + pydom.types.HTMLButtonElement + pydom.types.HTMLCanvasElement + pydom.types.HTMLCharsetMetaElement + pydom.types.HTMLDataElement + pydom.types.HTMLDataListElement + pydom.types.HTMLDetailsElement + pydom.types.HTMLDialogElement + pydom.types.HTMLDivElement + pydom.types.HTMLDocumentMetaElement + pydom.types.HTMLElement + pydom.types.HTMLElementProps + pydom.types.HTMLEmbedElement + pydom.types.HTMLEventProps + pydom.types.HTMLFieldSetElement + pydom.types.HTMLFormElement + pydom.types.HTMLHeadElement + pydom.types.HTMLHeadingElement + pydom.types.HTMLHRElement + pydom.types.HTMLHtmlElement + pydom.types.HTMLIFrameElement + pydom.types.HTMLImageElement + pydom.types.HTMLInputElement + pydom.types.HTMLLabelElement + pydom.types.HTMLLegendElement + pydom.types.HTMLLinkElement + pydom.types.HTMLListItemElement + pydom.types.HTMLMapElement + pydom.types.HTMLMeterElement + pydom.types.HTMLModElement + pydom.types.HTMLObjectElement + pydom.types.HTMLOptGroupElement + pydom.types.HTMLOptionElement + pydom.types.HTMLOrderedListElement + pydom.types.HTMLOutputElement + pydom.types.HTMLParagraphElement + pydom.types.HTMLParamElement + pydom.types.HTMLPictureElement + pydom.types.HTMLPragmaMetaElement + pydom.types.HTMLPreElement + pydom.types.HTMLProgressElement + pydom.types.HTMLQuoteElement + pydom.types.HTMLScriptElement + pydom.types.HTMLSelectElement + pydom.types.HTMLSlotElement + pydom.types.HTMLSourceElement + pydom.types.HTMLSpanElement + pydom.types.HTMLStyleElement + pydom.types.HTMLTableCaptionElement + pydom.types.HTMLTableCellElement + pydom.types.HTMLTableColElement + pydom.types.HTMLTableDataCellElement + pydom.types.HTMLTableElement + pydom.types.HTMLTableHeaderCellElement + pydom.types.HTMLTableRowElement + pydom.types.HTMLTableSectionElement + pydom.types.HTMLTemplateElement + pydom.types.HTMLTextAreaElement + pydom.types.HTMLTimeElement + pydom.types.HTMLTitleElement + pydom.types.HTMLTrackElement + pydom.types.HTMLUnorderedListElement + pydom.types.HTMLUserMetaElement + pydom.types.HTMLVideoElement + pydom.types.RenderResultJSON + pydom.types.CSSProperties + + +Package Contents +---------------- + +.. py:class:: AriaProps + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: aria_active_descendant + :type: Optional[str] + + + .. py:attribute:: aria_atomic + :type: Optional[str] + + + .. py:attribute:: aria_auto_complete + :type: Optional[str] + + + .. py:attribute:: aria_busy + :type: Optional[str] + + + .. py:attribute:: aria_checked + :type: Optional[str] + + + .. py:attribute:: aria_col_count + :type: Optional[str] + + + .. py:attribute:: aria_col_index + :type: Optional[str] + + + .. py:attribute:: aria_col_span + :type: Optional[str] + + + .. py:attribute:: aria_controls + :type: Optional[str] + + + .. py:attribute:: aria_current + :type: Optional[str] + + + .. py:attribute:: aria_described_by + :type: Optional[str] + + + .. py:attribute:: aria_details + :type: Optional[str] + + + .. py:attribute:: aria_disabled + :type: Optional[str] + + + .. py:attribute:: aria_drop_effect + :type: Optional[str] + + + .. py:attribute:: aria_error_message + :type: Optional[str] + + + .. py:attribute:: aria_expanded + :type: Optional[str] + + + .. py:attribute:: aria_flow_to + :type: Optional[str] + + + .. py:attribute:: aria_grabbed + :type: Optional[str] + + + .. py:attribute:: aria_has_popup + :type: Optional[str] + + + .. py:attribute:: aria_hidden + :type: Optional[str] + + + .. py:attribute:: aria_invalid + :type: Optional[str] + + + .. py:attribute:: aria_key_shortcuts + :type: Optional[str] + + + .. py:attribute:: aria_label + :type: Optional[str] + + + .. py:attribute:: aria_labelled_by + :type: Optional[str] + + + .. py:attribute:: aria_level + :type: Optional[str] + + + .. py:attribute:: aria_live + :type: Optional[str] + + + .. py:attribute:: aria_modal + :type: Optional[str] + + + .. py:attribute:: aria_multiline + :type: Optional[str] + + + .. py:attribute:: aria_multi_selectable + :type: Optional[str] + + + .. py:attribute:: aria_orientation + :type: Optional[str] + + + .. py:attribute:: aria_owns + :type: Optional[str] + + + .. py:attribute:: aria_placeholder + :type: Optional[str] + + + .. py:attribute:: aria_pos_inset + :type: Optional[str] + + + .. py:attribute:: aria_pressed + :type: Optional[str] + + + .. py:attribute:: aria_readonly + :type: Optional[str] + + + .. py:attribute:: aria_relevant + :type: Optional[str] + + + .. py:attribute:: aria_required + :type: Optional[str] + + + .. py:attribute:: aria_role_description + :type: Optional[str] + + + .. py:attribute:: aria_row_count + :type: Optional[str] + + + .. py:attribute:: aria_row_index + :type: Optional[str] + + + .. py:attribute:: aria_row_span + :type: Optional[str] + + + .. py:attribute:: aria_selected + :type: Optional[str] + + + .. py:attribute:: aria_set_size + :type: Optional[str] + + + .. py:attribute:: aria_sort + :type: Optional[str] + + + .. py:attribute:: aria_value_max + :type: Optional[str] + + + .. py:attribute:: aria_value_min + :type: Optional[str] + + + .. py:attribute:: aria_value_now + :type: Optional[str] + + + .. py:attribute:: aria_value_text + :type: Optional[str] + + +.. py:class:: HTMLAnchorElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: download + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: href_lang + :type: Optional[str] + + + .. py:attribute:: ping + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: rel + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + +.. py:class:: HTMLAreaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: alt + :type: Optional[str] + + + .. py:attribute:: coords + :type: Optional[str] + + + .. py:attribute:: download + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: href_lang + :type: Optional[str] + + + .. py:attribute:: ping + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: rel + :type: Optional[str] + + + .. py:attribute:: shape + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[str] + + +.. py:class:: HTMLAudioElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: auto_play + :type: Optional[str] + + + .. py:attribute:: controls + :type: Optional[str] + + + .. py:attribute:: loop + :type: Optional[str] + + + .. py:attribute:: muted + :type: Optional[str] + + + .. py:attribute:: preload + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + +.. py:class:: HTMLBaseElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[str] + + +.. py:class:: HTMLBodyElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: alink + :type: Optional[str] + + **@deprecated** Use the CSS color property in conjunction with the :active pseudo-class instead + + Specifies the color of text for hyperlinks when selected + + + + .. py:attribute:: background + :type: Optional[str] + + **@deprecated** Use the CSS background property on the element instead + + Specifies the URI of an image to use as a background + + + + .. py:attribute:: bgcolor + :type: Optional[str] + + **@deprecated** Use the CSS background-color property on the element instead + + Specifies the background color of the document + + + + .. py:attribute:: bottom_margin + :type: Optional[int] + + **@deprecated** Use the CSS margin-bottom property on the element instead + + Specifies the bottom margin of the body + + + + .. py:attribute:: left_margin + :type: Optional[int] + + **@deprecated** Use the CSS margin-left property on the element instead + + Specifies the left margin of the body + + + + .. py:attribute:: link + :type: Optional[str] + + **@deprecated** Use the CSS color property in conjunction with the :link pseudo-class instead + + Specifies the color of text for unvisited hypertext links + + + + .. py:attribute:: on_after_print + :type: Optional[str] + + Function to call after the user has printed the document + + + + .. py:attribute:: on_before_print + :type: Optional[str] + + Function to call before the user prints the document + + + + .. py:attribute:: on_before_unload + :type: Optional[str] + + Function to call when the document is about to be unloaded + + + + .. py:attribute:: on_hash_change + :type: Optional[str] + + Function to call when the fragment identifier part (starting with the hash (`#`) character) + of the document's current address has changed + + + + .. py:attribute:: on_language_change + :type: Optional[str] + + Function to call when the preferred languages changed + + + + .. py:attribute:: on_message + :type: Optional[str] + + Function to call when the document has received a message + + + + .. py:attribute:: on_offline + :type: Optional[str] + + Function to call when network communication has failed + + + + .. py:attribute:: on_online + :type: Optional[str] + + Function to call when network communication has been restored + + + + .. py:attribute:: on_pop_state + :type: Optional[str] + + Function to call when the user has navigated session history + + + + .. py:attribute:: on_storage + :type: Optional[str] + + Function to call when the storage area has changed + + + + .. py:attribute:: on_unload + :type: Optional[str] + + Function to call when the document is going away + + + + .. py:attribute:: right_margin + :type: Optional[int] + + **@deprecated** Use the CSS margin-right property on the element instead + + Specifies the right margin of the body + + + + .. py:attribute:: text + :type: Optional[str] + + **@deprecated** Use the CSS color property on the element instead + + Specifies the color of text + + + + .. py:attribute:: top_margin + :type: Optional[int] + + **@deprecated** Use the CSS margin-top property on the element instead + + Specifies the top margin of the body + + + + .. py:attribute:: vlink + :type: Optional[str] + + **@deprecated** Use the CSS color property in conjunction with the :visited pseudo-class instead + + Specifies the color of text for visited hypertext links + + + +.. py:class:: HTMLBRElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + +.. py:class:: HTMLButtonElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: auto_focus + :type: Optional[str] + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: form_action + :type: Optional[str] + + + .. py:attribute:: form_enctype + :type: Optional[str] + + + .. py:attribute:: form_method + :type: Optional[str] + + + .. py:attribute:: form_no_validate + :type: Optional[str] + + + .. py:attribute:: form_target + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLCanvasElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLCharsetMetaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: charset + :type: Optional[str] + + +.. py:class:: HTMLDataElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLDataListElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + +.. py:class:: HTMLDetailsElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: open + :type: Optional[str] + + +.. py:class:: HTMLDialogElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: open + :type: Optional[str] + + +.. py:class:: HTMLDivElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + +.. py:class:: HTMLDocumentMetaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: content + :type: Optional[str] + + +.. py:class:: HTMLElement + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: access_key + :type: Optional[str] + + + .. py:attribute:: auto_capitalize + :type: Optional[str] + + + .. py:attribute:: classes + :type: Optional[Union[str, Iterable[str]]] + + + .. py:attribute:: content_editable + :type: Optional[str] + + + .. py:attribute:: dangerously_set_inner_html + :type: Optional[Dict[Literal['__html'], str]] + + + .. py:attribute:: dir + :type: Optional[Literal['ltr', 'rtl', 'auto']] + + + .. py:attribute:: draggable + :type: Optional[str] + + + .. py:attribute:: hidden + :type: Optional[str] + + + .. py:attribute:: id + :type: Optional[str] + + + .. py:attribute:: input_mode + :type: Optional[str] + + + .. py:attribute:: lang + :type: Optional[str] + + + .. py:attribute:: role + :type: Optional[str] + + + .. py:attribute:: spell_check + :type: Optional[str] + + + .. py:attribute:: style + :type: Optional[Union[str, pydom.styling.StyleSheet]] + + + .. py:attribute:: tab_index + :type: Optional[str] + + + .. py:attribute:: title + :type: Optional[str] + + + .. py:attribute:: translate + :type: Optional[str] + + +.. py:class:: HTMLElementProps + + Bases: :py:obj:`pydom.types.html.html_element.HTMLElement`, :py:obj:`pydom.types.html.aria_props.AriaProps`, :py:obj:`pydom.types.html.html_event_props.HTMLEventProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLEmbedElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLEventProps + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: on_abort + :type: Optional[str] + + + .. py:attribute:: on_auto_complete + :type: Optional[str] + + + .. py:attribute:: on_auto_complete_error + :type: Optional[str] + + + .. py:attribute:: on_blur + :type: Optional[str] + + + .. py:attribute:: on_cancel + :type: Optional[str] + + + .. py:attribute:: on_can_play + :type: Optional[str] + + + .. py:attribute:: on_can_play_through + :type: Optional[str] + + + .. py:attribute:: on_change + :type: Optional[str] + + + .. py:attribute:: on_click + :type: Optional[str] + + + .. py:attribute:: on_close + :type: Optional[str] + + + .. py:attribute:: on_context_menu + :type: Optional[str] + + + .. py:attribute:: on_cue_change + :type: Optional[str] + + + .. py:attribute:: on_dbl_click + :type: Optional[str] + + + .. py:attribute:: on_drag + :type: Optional[str] + + + .. py:attribute:: on_drag_end + :type: Optional[str] + + + .. py:attribute:: on_drag_enter + :type: Optional[str] + + + .. py:attribute:: on_drag_leave + :type: Optional[str] + + + .. py:attribute:: on_drag_over + :type: Optional[str] + + + .. py:attribute:: on_drag_start + :type: Optional[str] + + + .. py:attribute:: on_drop + :type: Optional[str] + + + .. py:attribute:: on_duration_change + :type: Optional[str] + + + .. py:attribute:: on_emptied + :type: Optional[str] + + + .. py:attribute:: on_ended + :type: Optional[str] + + + .. py:attribute:: on_error + :type: Optional[str] + + + .. py:attribute:: on_focus + :type: Optional[str] + + + .. py:attribute:: on_input + :type: Optional[str] + + + .. py:attribute:: on_invalid + :type: Optional[str] + + + .. py:attribute:: on_key_down + :type: Optional[str] + + + .. py:attribute:: on_key_press + :type: Optional[str] + + + .. py:attribute:: on_key_up + :type: Optional[str] + + + .. py:attribute:: on_load + :type: Optional[str] + + + .. py:attribute:: on_loaded_data + :type: Optional[str] + + + .. py:attribute:: on_loaded_metadata + :type: Optional[str] + + + .. py:attribute:: on_load_start + :type: Optional[str] + + + .. py:attribute:: on_mouse_down + :type: Optional[str] + + + .. py:attribute:: on_mouse_enter + :type: Optional[str] + + + .. py:attribute:: on_mouse_leave + :type: Optional[str] + + + .. py:attribute:: on_mouse_move + :type: Optional[str] + + + .. py:attribute:: on_mouse_out + :type: Optional[str] + + + .. py:attribute:: on_mouse_over + :type: Optional[str] + + + .. py:attribute:: on_mouse_up + :type: Optional[str] + + + .. py:attribute:: on_mouse_wheel + :type: Optional[str] + + + .. py:attribute:: on_pause + :type: Optional[str] + + + .. py:attribute:: on_play + :type: Optional[str] + + + .. py:attribute:: on_playing + :type: Optional[str] + + + .. py:attribute:: on_progress + :type: Optional[str] + + + .. py:attribute:: on_rate_change + :type: Optional[str] + + + .. py:attribute:: on_reset + :type: Optional[str] + + + .. py:attribute:: on_resize + :type: Optional[str] + + + .. py:attribute:: on_scroll + :type: Optional[str] + + + .. py:attribute:: on_seeked + :type: Optional[str] + + + .. py:attribute:: on_seeking + :type: Optional[str] + + + .. py:attribute:: on_select + :type: Optional[str] + + + .. py:attribute:: on_show + :type: Optional[str] + + + .. py:attribute:: on_sort + :type: Optional[str] + + + .. py:attribute:: on_stalled + :type: Optional[str] + + + .. py:attribute:: on_submit + :type: Optional[str] + + + .. py:attribute:: on_suspend + :type: Optional[str] + + + .. py:attribute:: on_time_update + :type: Optional[str] + + + .. py:attribute:: on_toggle + :type: Optional[str] + + + .. py:attribute:: on_volume_change + :type: Optional[str] + + + .. py:attribute:: on_waiting + :type: Optional[str] + + +.. py:class:: HTMLFieldSetElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + +.. py:class:: HTMLFormElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: accept_charset + :type: Optional[str] + + + .. py:attribute:: action + :type: Optional[str] + + + .. py:attribute:: auto_complete + :type: Optional[str] + + + .. py:attribute:: enctype + :type: Optional[str] + + + .. py:attribute:: method + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: no_validate + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[str] + + +.. py:class:: HTMLHeadElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: profile + :type: Optional[str] + + +.. py:class:: HTMLHeadingElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLHRElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLHtmlElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: version + :type: Optional[str] + + + .. py:attribute:: xmlns + :type: Optional[str] + + +.. py:class:: HTMLIFrameElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: allow + :type: Optional[str] + + + .. py:attribute:: allow_fullscreen + :type: Optional[str] + + + .. py:attribute:: csp + :type: Optional[str] + + + .. py:attribute:: frame_border + :type: Optional[str] + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: importance + :type: Optional[str] + + + .. py:attribute:: loading + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: sandbox + :type: Optional[str] + + + .. py:attribute:: scrolling + :type: Optional[str] + + + .. py:attribute:: seamless + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: srcdoc + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLImageElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: alt + :type: Optional[str] + + + .. py:attribute:: cross_origin + :type: Optional[str] + + + .. py:attribute:: decoding + :type: Optional[str] + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: importance + :type: Optional[str] + + + .. py:attribute:: intrinsicsize + :type: Optional[str] + + + .. py:attribute:: ismap + :type: Optional[str] + + + .. py:attribute:: loading + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: sizes + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: srcset + :type: Optional[str] + + + .. py:attribute:: usemap + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLInputElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: accept + :type: Optional[str] + + + .. py:attribute:: alt + :type: Optional[str] + + + .. py:attribute:: auto_complete + :type: Optional[str] + + + .. py:attribute:: auto_focus + :type: Optional[str] + + + .. py:attribute:: capture + :type: Optional[str] + + + .. py:attribute:: checked + :type: Optional[str] + + + .. py:attribute:: cross_origin + :type: Optional[str] + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: form_action + :type: Optional[str] + + + .. py:attribute:: form_enctype + :type: Optional[str] + + + .. py:attribute:: form_method + :type: Optional[str] + + + .. py:attribute:: form_no_validate + :type: Optional[str] + + + .. py:attribute:: form_target + :type: Optional[str] + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: list + :type: Optional[str] + + + .. py:attribute:: max + :type: Optional[str] + + + .. py:attribute:: max_length + :type: Optional[str] + + + .. py:attribute:: min + :type: Optional[str] + + + .. py:attribute:: min_length + :type: Optional[str] + + + .. py:attribute:: multiple + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: pattern + :type: Optional[str] + + + .. py:attribute:: placeholder + :type: Optional[str] + + + .. py:attribute:: readonly + :type: Optional[str] + + + .. py:attribute:: required + :type: Optional[str] + + + .. py:attribute:: selection_direction + :type: Optional[str] + + + .. py:attribute:: selection_end + :type: Optional[str] + + + .. py:attribute:: selection_start + :type: Optional[str] + + + .. py:attribute:: size + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: step + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLLabelElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: html_for + :type: Optional[str] + + +.. py:class:: HTMLLegendElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align + :type: Optional[str] + + +.. py:class:: HTMLLinkElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: html_as + :type: Optional[str] + + + .. py:attribute:: cross_origin + :type: Optional[str] + + + .. py:attribute:: disabled + :type: Optional[str] + + + .. py:attribute:: fetch_priority + :type: Optional[Literal['high', 'low', 'auto']] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: hreflang + :type: Optional[str] + + + .. py:attribute:: image_sizes + :type: Optional[str] + + + .. py:attribute:: integrity + :type: Optional[str] + + + .. py:attribute:: media + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: rel + :type: Optional[str] + + + .. py:attribute:: sizes + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + +.. py:class:: HTMLListItemElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLMapElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: name + :type: Optional[str] + + +.. py:class:: HTMLMeterElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: high + :type: Optional[str] + + + .. py:attribute:: low + :type: Optional[str] + + + .. py:attribute:: max + :type: Optional[str] + + + .. py:attribute:: min + :type: Optional[str] + + + .. py:attribute:: optimum + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLModElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: cite + :type: Optional[str] + + + .. py:attribute:: datetime + :type: str + + +.. py:class:: HTMLObjectElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: data + :type: Optional[str] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + + .. py:attribute:: usemap + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLOptGroupElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: label + :type: Optional[str] + + +.. py:class:: HTMLOptionElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: label + :type: Optional[str] + + + .. py:attribute:: selected + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLOrderedListElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: reversed + :type: Optional[str] + + + .. py:attribute:: start + :type: Optional[str] + + +.. py:class:: HTMLOutputElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: html_for + :type: Optional[str] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + +.. py:class:: HTMLParagraphElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLParamElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLPictureElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLPragmaMetaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: http_equiv + :type: Optional[str] + + +.. py:class:: HTMLPreElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLProgressElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: max + :type: Optional[str] + + + .. py:attribute:: value + :type: Optional[str] + + +.. py:class:: HTMLQuoteElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: cite + :type: Optional[str] + + +.. py:class:: HTMLScriptElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: async_ + :type: Optional[bool] + + + .. py:attribute:: cross_origin + :type: Optional[str] + + + .. py:attribute:: defer + :type: Optional[bool] + + + .. py:attribute:: integrity + :type: Optional[str] + + + .. py:attribute:: nonce + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + +.. py:class:: HTMLSelectElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: auto_complete + :type: Optional[str] + + + .. py:attribute:: auto_focus + :type: Optional[str] + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: multiple + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: required + :type: Optional[str] + + + .. py:attribute:: size + :type: Optional[str] + + +.. py:class:: HTMLSlotElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: name + :type: Optional[str] + + +.. py:class:: HTMLSourceElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: media + :type: Optional[str] + + + .. py:attribute:: sizes + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: srcset + :type: Optional[str] + + + .. py:attribute:: type + :type: Optional[str] + + +.. py:class:: HTMLSpanElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLStyleElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: media + :type: Optional[str] + + + .. py:attribute:: nonce + :type: Optional[str] + + + .. py:attribute:: scoped + :type: Optional[str] + + +.. py:class:: HTMLTableCaptionElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLTableCellElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: abbr + :type: Optional[str] + + + .. py:attribute:: colspan + :type: Optional[str] + + + .. py:attribute:: headers + :type: Optional[str] + + + .. py:attribute:: rowspan + :type: Optional[str] + + + .. py:attribute:: scope + :type: Optional[str] + + +.. py:class:: HTMLTableColElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: span + :type: Optional[str] + + +.. py:class:: HTMLTableDataCellElement + + Bases: :py:obj:`pydom.types.html.html_table_cell_element.HTMLTableCellElement` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLTableElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: border + :type: Optional[str] + + + .. py:attribute:: cellpadding + :type: Optional[str] + + + .. py:attribute:: cellspacing + :type: Optional[str] + + + .. py:attribute:: frame + :type: Optional[str] + + + .. py:attribute:: rules + :type: Optional[str] + + + .. py:attribute:: summary + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:class:: HTMLTableHeaderCellElement + + Bases: :py:obj:`pydom.types.html.html_table_cell_element.HTMLTableCellElement` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLTableRowElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align + :type: Optional[str] + + + .. py:attribute:: bgcolor + :type: Optional[str] + + + .. py:attribute:: ch + :type: Optional[str] + + + .. py:attribute:: choff + :type: Optional[str] + + + .. py:attribute:: v_align + :type: Optional[str] + + +.. py:class:: HTMLTableSectionElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align + :type: Optional[str] + + + .. py:attribute:: ch + :type: Optional[str] + + + .. py:attribute:: choff + :type: Optional[str] + + + .. py:attribute:: v_align + :type: Optional[str] + + +.. py:class:: HTMLTemplateElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLTextAreaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: auto_complete + :type: Optional[str] + + + .. py:attribute:: auto_focus + :type: Optional[str] + + + .. py:attribute:: cols + :type: Optional[str] + + + .. py:attribute:: dirname + :type: Optional[str] + + + .. py:attribute:: disabled + :type: Optional[bool] + + + .. py:attribute:: form + :type: Optional[str] + + + .. py:attribute:: max_length + :type: Optional[str] + + + .. py:attribute:: min_length + :type: Optional[str] + + + .. py:attribute:: name + :type: Optional[str] + + + .. py:attribute:: placeholder + :type: Optional[str] + + + .. py:attribute:: readonly + :type: Optional[str] + + + .. py:attribute:: required + :type: Optional[str] + + + .. py:attribute:: rows + :type: Optional[str] + + + .. py:attribute:: wrap + :type: Optional[str] + + +.. py:class:: HTMLTimeElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: datetime + :type: Optional[str] + + +.. py:class:: HTMLTitleElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLTrackElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: default + :type: Optional[str] + + + .. py:attribute:: kind + :type: Optional[str] + + + .. py:attribute:: label + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: srclang + :type: Optional[str] + + +.. py:class:: HTMLUnorderedListElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: HTMLUserMetaElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: itemprop + :type: Optional[str] + + +.. py:class:: HTMLVideoElement + + Bases: :py:obj:`pydom.types.html.html_element_props.HTMLElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: auto_play + :type: Optional[str] + + + .. py:attribute:: controls + :type: Optional[str] + + + .. py:attribute:: cross_origin + :type: Optional[str] + + + .. py:attribute:: height + :type: Optional[str] + + + .. py:attribute:: loop + :type: Optional[str] + + + .. py:attribute:: muted + :type: Optional[str] + + + .. py:attribute:: plays_inline + :type: Optional[str] + + + .. py:attribute:: poster + :type: Optional[str] + + + .. py:attribute:: preload + :type: Optional[str] + + + .. py:attribute:: src + :type: Optional[str] + + + .. py:attribute:: width + :type: Optional[str] + + +.. py:data:: ChildType + :type: typing_extensions.TypeAlias + +.. py:data:: ChildrenType + :type: typing_extensions.TypeAlias + +.. py:data:: Primitive + :type: typing_extensions.TypeAlias + +.. py:data:: Renderable + :type: typing_extensions.TypeAlias + +.. py:data:: RenderResult + :type: typing_extensions.TypeAlias + +.. py:data:: RenderTarget + :type: typing_extensions.TypeAlias + +.. py:class:: RenderResultJSON + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: type + :type: str + + + .. py:attribute:: props + :type: Dict[str, Primitive] + + + .. py:attribute:: children + :type: List[RenderResultJSON] + + +.. py:class:: CSSProperties + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align_content + :type: AlignContent + + + .. py:attribute:: align_items + :type: Literal['flex-start', 'flex-end', 'center', 'baseline', 'stretch'] + + + .. py:attribute:: align_self + :type: Union[str, Literal['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch']] + + + .. py:attribute:: animation + :type: str + + + .. py:attribute:: animation_delay + :type: str + + + .. py:attribute:: animation_direction + :type: Union[str, Literal['normal', 'reverse', 'alternate', 'alternate-reverse']] + + + .. py:attribute:: animation_duration + :type: str + + + .. py:attribute:: animation_fill_mode + :type: Union[str, Literal['none', 'forwards', 'backwards', 'both']] + + + .. py:attribute:: animation_iteration_count + :type: Union[str, Literal['infinite', 'n']] + + + .. py:attribute:: animation_name + :type: str + + + .. py:attribute:: animation_play_state + :type: Union[str, Literal['running', 'paused']] + + + .. py:attribute:: animation_timing_function + :type: str + + + .. py:attribute:: backface_visibility + :type: Union[str, Literal['visible', 'hidden']] + + + .. py:attribute:: background + :type: str + + + .. py:attribute:: background_attachment + :type: Union[str, Literal['scroll', 'fixed', 'local']] + + + .. py:attribute:: background_blend_mode + :type: str + + + .. py:attribute:: background_clip + :type: Union[str, Literal['border-box', 'padding-box', 'content-box']] + + + .. py:attribute:: background_color + :type: str + + + .. py:attribute:: background_image + :type: str + + + .. py:attribute:: background_origin + :type: Union[str, Literal['padding-box', 'border-box', 'content-box']] + + + .. py:attribute:: background_position + :type: str + + + .. py:attribute:: background_repeat + :type: Union[str, Literal['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']] + + + .. py:attribute:: background_size + :type: str + + + .. py:attribute:: border + :type: str + + + .. py:attribute:: border_bottom + :type: str + + + .. py:attribute:: border_bottom_color + :type: str + + + .. py:attribute:: border_bottom_left_radius + :type: str + + + .. py:attribute:: border_bottom_right_radius + :type: str + + + .. py:attribute:: border_bottom_style + :type: str + + + .. py:attribute:: border_bottom_width + :type: str + + + .. py:attribute:: border_collapse + :type: Union[str, Literal['collapse', 'separate']] + + + .. py:attribute:: border_color + :type: str + + + .. py:attribute:: border_image + :type: str + + + .. py:attribute:: border_image_outset + :type: str + + + .. py:attribute:: border_image_repeat + :type: Union[str, Literal['stretch', 'repeat', 'round']] + + + .. py:attribute:: border_image_slice + :type: str + + + .. py:attribute:: border_image_source + :type: str + + + .. py:attribute:: border_image_width + :type: str + + + .. py:attribute:: border_left + :type: str + + + .. py:attribute:: border_left_color + :type: str + + + .. py:attribute:: border_left_style + :type: str + + + .. py:attribute:: border_left_width + :type: str + + + .. py:attribute:: border_radius + :type: str + + + .. py:attribute:: border_right + :type: str + + + .. py:attribute:: border_right_color + :type: str + + + .. py:attribute:: border_right_style + :type: str + + + .. py:attribute:: border_right_width + :type: str + + + .. py:attribute:: border_spacing + :type: str + + + .. py:attribute:: border_style + :type: str + + + .. py:attribute:: border_top + :type: str + + + .. py:attribute:: border_top_color + :type: str + + + .. py:attribute:: border_top_left_radius + :type: str + + + .. py:attribute:: border_top_right_radius + :type: str + + + .. py:attribute:: border_top_style + :type: str + + + .. py:attribute:: border_top_width + :type: str + + + .. py:attribute:: border_width + :type: str + + + .. py:attribute:: bottom + :type: str + + + .. py:attribute:: box_shadow + :type: str + + + .. py:attribute:: box_sizing + :type: Union[str, Literal['content-box', 'border-box']] + + + .. py:attribute:: caption_side + :type: Union[str, Literal['top', 'bottom']] + + + .. py:attribute:: clear + :type: Union[str, Literal['none', 'left', 'right', 'both']] + + D.clear() -> None. Remove all items from D. + + + + .. py:attribute:: clip + :type: str + + + .. py:attribute:: color + :type: str + + + .. py:attribute:: column_count + :type: Union[str, int] + + + .. py:attribute:: column_fill + :type: Union[str, Literal['balance', 'auto']] + + + .. py:attribute:: column_gap + :type: str + + + .. py:attribute:: column_rule + :type: str + + + .. py:attribute:: column_rule_color + :type: str + + + .. py:attribute:: column_rule_style + :type: str + + + .. py:attribute:: column_rule_width + :type: str + + + .. py:attribute:: column_span + :type: Union[str, Literal['none', 'all']] + + + .. py:attribute:: column_width + :type: Union[str, int] + + + .. py:attribute:: columns + :type: str + + + .. py:attribute:: content + :type: str + + + .. py:attribute:: counter_increment + :type: str + + + .. py:attribute:: counter_reset + :type: str + + + .. py:attribute:: cursor + :type: str + + + .. py:attribute:: direction + :type: Union[str, Literal['ltr', 'rtl']] + + + .. py:attribute:: display + :type: Union[str, Literal['block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid', 'inline-grid', 'table', 'table-row', 'table-cell', 'none']] + + + .. py:attribute:: empty_cells + :type: Union[str, Literal['show', 'hide']] + + + .. py:attribute:: filter + :type: str + + + .. py:attribute:: flex + :type: str + + + .. py:attribute:: flex_basis + :type: str + + + .. py:attribute:: flex_direction + :type: Union[str, Literal['row', 'row-reverse', 'column', 'column-reverse']] + + + .. py:attribute:: flex_flow + :type: str + + + .. py:attribute:: flex_grow + :type: str + + + .. py:attribute:: flex_shrink + :type: str + + + .. py:attribute:: flex_wrap + :type: Union[str, Literal['nowrap', 'wrap', 'wrap-reverse']] + + + .. py:attribute:: float + :type: Union[str, Literal['left', 'right', 'none']] + + + .. py:attribute:: font + :type: str + + + .. py:attribute:: font_family + :type: str + + + .. py:attribute:: font_feature_settings + :type: str + + + .. py:attribute:: font_kerning + :type: Union[str, Literal['auto', 'normal', 'none']] + + + .. py:attribute:: font_language_override + :type: str + + + .. py:attribute:: font_size + :type: str + + + .. py:attribute:: font_size_adjust + :type: Union[str, Literal['none']] + + + .. py:attribute:: font_stretch + :type: str + + + .. py:attribute:: font_style + :type: Union[str, Literal['normal', 'italic', 'oblique']] + + + .. py:attribute:: font_synthesis + :type: str + + + .. py:attribute:: font_variant + :type: str + + + .. py:attribute:: font_variant_alternates + :type: str + + + .. py:attribute:: font_variant_caps + :type: Union[str, Literal['normal', 'small-caps']] + + + .. py:attribute:: font_variant_east_asian + :type: str + + + .. py:attribute:: font_variant_ligatures + :type: str + + + .. py:attribute:: font_variant_numeric + :type: str + + + .. py:attribute:: font_variant_position + :type: Union[str, Literal['normal', 'sub', 'super']] + + + .. py:attribute:: font_weight + :type: Union[str, Literal['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900']] + + + .. py:attribute:: grid + :type: str + + + .. py:attribute:: grid_area + :type: str + + + .. py:attribute:: grid_auto_columns + :type: str + + + .. py:attribute:: grid_auto_flow + :type: str + + + .. py:attribute:: grid_auto_rows + :type: str + + + .. py:attribute:: grid_column + :type: str + + + .. py:attribute:: grid_column_end + :type: str + + + .. py:attribute:: grid_column_gap + :type: str + + + .. py:attribute:: grid_column_start + :type: str + + + .. py:attribute:: grid_gap + :type: str + + + .. py:attribute:: grid_row + :type: str + + + .. py:attribute:: grid_row_end + :type: str + + + .. py:attribute:: grid_row_gap + :type: str + + + .. py:attribute:: grid_row_start + :type: str + + + .. py:attribute:: grid_template + :type: str + + + .. py:attribute:: grid_template_areas + :type: str + + + .. py:attribute:: grid_template_columns + :type: str + + + .. py:attribute:: grid_template_rows + :type: str + + + .. py:attribute:: height + :type: str + + + .. py:attribute:: hyphens + :type: Union[str, Literal['none', 'manual', 'auto']] + + + .. py:attribute:: image_rendering + :type: str + + + .. py:attribute:: isolation + :type: Union[str, Literal['auto', 'isolate']] + + + .. py:attribute:: justify_content + :type: Union[str, Literal['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']] + + + .. py:attribute:: left + :type: str + + + .. py:attribute:: letter_spacing + :type: str + + + .. py:attribute:: line_break + :type: Union[str, Literal['auto', 'loose', 'normal', 'strict']] + + + .. py:attribute:: line_height + :type: Union[str, int] + + + .. py:attribute:: list_style + :type: str + + + .. py:attribute:: list_style_image + :type: str + + + .. py:attribute:: list_style_position + :type: Union[str, Literal['inside', 'outside']] + + + .. py:attribute:: list_style_type + :type: str + + + .. py:attribute:: margin + :type: str + + + .. py:attribute:: margin_bottom + :type: str + + + .. py:attribute:: margin_left + :type: str + + + .. py:attribute:: margin_right + :type: str + + + .. py:attribute:: margin_top + :type: str + + + .. py:attribute:: max_height + :type: str + + + .. py:attribute:: max_width + :type: str + + + .. py:attribute:: min_height + :type: str + + + .. py:attribute:: min_width + :type: str + + + .. py:attribute:: mix_blend_mode + :type: str + + + .. py:attribute:: object_fit + :type: Union[str, Literal['fill', 'contain', 'cover', 'none', 'scale-down']] + + + .. py:attribute:: object_position + :type: str + + + .. py:attribute:: opacity + :type: Union[str, float_] + + + .. py:attribute:: order + :type: Union[str, int] + + + .. py:attribute:: outline + :type: str + + + .. py:attribute:: outline_color + :type: str + + + .. py:attribute:: outline_offset + :type: str + + + .. py:attribute:: outline_style + :type: str + + + .. py:attribute:: outline_width + :type: str + + + .. py:attribute:: overflow + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_wrap + :type: Union[str, Literal['normal', 'break-word', 'anywhere']] + + + .. py:attribute:: overflow_x + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_y + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: padding + :type: str + + + .. py:attribute:: padding_bottom + :type: str + + + .. py:attribute:: padding_left + :type: str + + + .. py:attribute:: padding_right + :type: str + + + .. py:attribute:: padding_top + :type: str + + + .. py:attribute:: page_break_after + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_before + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_inside + :type: Union[str, Literal['auto', 'avoid']] + + + .. py:attribute:: perspective + :type: str + + + .. py:attribute:: perspective_origin + :type: str + + + .. py:attribute:: position + :type: Union[str, Literal['static', 'relative', 'absolute', 'fixed', 'sticky']] + + + .. py:attribute:: quotes + :type: str + + + .. py:attribute:: resize + :type: Union[str, Literal['none', 'both', 'horizontal', 'vertical']] + + + .. py:attribute:: right + :type: str + + + .. py:attribute:: scroll_behavior + :type: Union[str, Literal['auto', 'smooth']] + + + .. py:attribute:: tab_size + :type: Union[str, int] + + + .. py:attribute:: table_layout + :type: Union[str, Literal['auto', 'fixed']] + + + .. py:attribute:: text_align + :type: Union[str, Literal['left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_align_last + :type: Union[str, Literal['auto', 'left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_decoration + :type: str + + + .. py:attribute:: text_decoration_color + :type: str + + + .. py:attribute:: text_decoration_line + :type: str + + + .. py:attribute:: text_decoration_style + :type: str + + + .. py:attribute:: text_indent + :type: str + + + .. py:attribute:: text_justify + :type: Union[str, Literal['auto', 'inter-word', 'inter-character', 'none']] + + + .. py:attribute:: text_overflow + :type: Union[str, Literal['clip', 'ellipsis']] + + + .. py:attribute:: text_shadow + :type: str + + + .. py:attribute:: text_transform + :type: Union[str, Literal['none', 'capitalize', 'uppercase', 'lowercase', 'full-width']] + + + .. py:attribute:: text_underline_position + :type: str + + + .. py:attribute:: top + :type: str + + + .. py:attribute:: transform + :type: str + + + .. py:attribute:: transform_origin + :type: str + + + .. py:attribute:: transform_style + :type: Union[str, Literal['flat', 'preserve-3d']] + + + .. py:attribute:: transition + :type: str + + + .. py:attribute:: transition_delay + :type: str + + + .. py:attribute:: transition_duration + :type: str + + + .. py:attribute:: transition_property + :type: str + + + .. py:attribute:: transition_timing_function + :type: str + + + .. py:attribute:: unicode_bidi + :type: Union[str, Literal['normal', 'embed', 'isolate', 'bidi-override']] + + + .. py:attribute:: user_select + :type: Union[str, Literal['auto', 'text', 'none', 'contain', 'all']] + + + .. py:attribute:: vertical_align + :type: str + + + .. py:attribute:: visibility + :type: Union[str, Literal['visible', 'hidden', 'collapse']] + + + .. py:attribute:: white_space + :type: Union[str, Literal['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap']] + + + .. py:attribute:: widows + :type: Union[str, int] + + + .. py:attribute:: width + :type: str + + + .. py:attribute:: will_change + :type: str + + + .. py:attribute:: word_break + :type: Union[str, Literal['normal', 'break-all', 'keep-all', 'break-word']] + + + .. py:attribute:: word_spacing + :type: str + + + .. py:attribute:: writing_mode + :type: Union[str, Literal['horizontal-tb', 'vertical-rl', 'vertical-lr', 'sideways-rl', 'sideways-lr']] + + + .. py:attribute:: z_index + :type: Union[str, int] + + diff --git a/docs/api-reference/pydom/types/rendering/index.rst b/docs/api-reference/pydom/types/rendering/index.rst new file mode 100644 index 0000000..532d311 --- /dev/null +++ b/docs/api-reference/pydom/types/rendering/index.rst @@ -0,0 +1,76 @@ +pydom.types.rendering +===================== + +.. py:module:: pydom.types.rendering + + +Attributes +---------- + +.. autoapisummary:: + + pydom.types.rendering.Primitive + pydom.types.rendering.Renderable + pydom.types.rendering.ChildType + pydom.types.rendering.RenderResult + pydom.types.rendering.ChildrenType + pydom.types.rendering.RenderTarget + + +Classes +------- + +.. autoapisummary:: + + pydom.types.rendering.RenderResultJSON + + +Module Contents +--------------- + +.. py:data:: Primitive + :type: typing_extensions.TypeAlias + +.. py:data:: Renderable + :type: typing_extensions.TypeAlias + +.. py:data:: ChildType + :type: typing_extensions.TypeAlias + +.. py:data:: RenderResult + :type: typing_extensions.TypeAlias + +.. py:data:: ChildrenType + :type: typing_extensions.TypeAlias + +.. py:data:: RenderTarget + :type: typing_extensions.TypeAlias + +.. py:class:: RenderResultJSON + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: type + :type: str + + + .. py:attribute:: props + :type: Dict[str, Primitive] + + + .. py:attribute:: children + :type: List[RenderResultJSON] + + diff --git a/docs/api-reference/pydom/types/styling/css_properties/index.rst b/docs/api-reference/pydom/types/styling/css_properties/index.rst new file mode 100644 index 0000000..5242b5a --- /dev/null +++ b/docs/api-reference/pydom/types/styling/css_properties/index.rst @@ -0,0 +1,880 @@ +pydom.types.styling.css_properties +================================== + +.. py:module:: pydom.types.styling.css_properties + + +Classes +------- + +.. autoapisummary:: + + pydom.types.styling.css_properties.CSSProperties + + +Module Contents +--------------- + +.. py:class:: CSSProperties + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align_content + :type: AlignContent + + + .. py:attribute:: align_items + :type: Literal['flex-start', 'flex-end', 'center', 'baseline', 'stretch'] + + + .. py:attribute:: align_self + :type: Union[str, Literal['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch']] + + + .. py:attribute:: animation + :type: str + + + .. py:attribute:: animation_delay + :type: str + + + .. py:attribute:: animation_direction + :type: Union[str, Literal['normal', 'reverse', 'alternate', 'alternate-reverse']] + + + .. py:attribute:: animation_duration + :type: str + + + .. py:attribute:: animation_fill_mode + :type: Union[str, Literal['none', 'forwards', 'backwards', 'both']] + + + .. py:attribute:: animation_iteration_count + :type: Union[str, Literal['infinite', 'n']] + + + .. py:attribute:: animation_name + :type: str + + + .. py:attribute:: animation_play_state + :type: Union[str, Literal['running', 'paused']] + + + .. py:attribute:: animation_timing_function + :type: str + + + .. py:attribute:: backface_visibility + :type: Union[str, Literal['visible', 'hidden']] + + + .. py:attribute:: background + :type: str + + + .. py:attribute:: background_attachment + :type: Union[str, Literal['scroll', 'fixed', 'local']] + + + .. py:attribute:: background_blend_mode + :type: str + + + .. py:attribute:: background_clip + :type: Union[str, Literal['border-box', 'padding-box', 'content-box']] + + + .. py:attribute:: background_color + :type: str + + + .. py:attribute:: background_image + :type: str + + + .. py:attribute:: background_origin + :type: Union[str, Literal['padding-box', 'border-box', 'content-box']] + + + .. py:attribute:: background_position + :type: str + + + .. py:attribute:: background_repeat + :type: Union[str, Literal['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']] + + + .. py:attribute:: background_size + :type: str + + + .. py:attribute:: border + :type: str + + + .. py:attribute:: border_bottom + :type: str + + + .. py:attribute:: border_bottom_color + :type: str + + + .. py:attribute:: border_bottom_left_radius + :type: str + + + .. py:attribute:: border_bottom_right_radius + :type: str + + + .. py:attribute:: border_bottom_style + :type: str + + + .. py:attribute:: border_bottom_width + :type: str + + + .. py:attribute:: border_collapse + :type: Union[str, Literal['collapse', 'separate']] + + + .. py:attribute:: border_color + :type: str + + + .. py:attribute:: border_image + :type: str + + + .. py:attribute:: border_image_outset + :type: str + + + .. py:attribute:: border_image_repeat + :type: Union[str, Literal['stretch', 'repeat', 'round']] + + + .. py:attribute:: border_image_slice + :type: str + + + .. py:attribute:: border_image_source + :type: str + + + .. py:attribute:: border_image_width + :type: str + + + .. py:attribute:: border_left + :type: str + + + .. py:attribute:: border_left_color + :type: str + + + .. py:attribute:: border_left_style + :type: str + + + .. py:attribute:: border_left_width + :type: str + + + .. py:attribute:: border_radius + :type: str + + + .. py:attribute:: border_right + :type: str + + + .. py:attribute:: border_right_color + :type: str + + + .. py:attribute:: border_right_style + :type: str + + + .. py:attribute:: border_right_width + :type: str + + + .. py:attribute:: border_spacing + :type: str + + + .. py:attribute:: border_style + :type: str + + + .. py:attribute:: border_top + :type: str + + + .. py:attribute:: border_top_color + :type: str + + + .. py:attribute:: border_top_left_radius + :type: str + + + .. py:attribute:: border_top_right_radius + :type: str + + + .. py:attribute:: border_top_style + :type: str + + + .. py:attribute:: border_top_width + :type: str + + + .. py:attribute:: border_width + :type: str + + + .. py:attribute:: bottom + :type: str + + + .. py:attribute:: box_shadow + :type: str + + + .. py:attribute:: box_sizing + :type: Union[str, Literal['content-box', 'border-box']] + + + .. py:attribute:: caption_side + :type: Union[str, Literal['top', 'bottom']] + + + .. py:attribute:: clear + :type: Union[str, Literal['none', 'left', 'right', 'both']] + + D.clear() -> None. Remove all items from D. + + + + .. py:attribute:: clip + :type: str + + + .. py:attribute:: color + :type: str + + + .. py:attribute:: column_count + :type: Union[str, int] + + + .. py:attribute:: column_fill + :type: Union[str, Literal['balance', 'auto']] + + + .. py:attribute:: column_gap + :type: str + + + .. py:attribute:: column_rule + :type: str + + + .. py:attribute:: column_rule_color + :type: str + + + .. py:attribute:: column_rule_style + :type: str + + + .. py:attribute:: column_rule_width + :type: str + + + .. py:attribute:: column_span + :type: Union[str, Literal['none', 'all']] + + + .. py:attribute:: column_width + :type: Union[str, int] + + + .. py:attribute:: columns + :type: str + + + .. py:attribute:: content + :type: str + + + .. py:attribute:: counter_increment + :type: str + + + .. py:attribute:: counter_reset + :type: str + + + .. py:attribute:: cursor + :type: str + + + .. py:attribute:: direction + :type: Union[str, Literal['ltr', 'rtl']] + + + .. py:attribute:: display + :type: Union[str, Literal['block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid', 'inline-grid', 'table', 'table-row', 'table-cell', 'none']] + + + .. py:attribute:: empty_cells + :type: Union[str, Literal['show', 'hide']] + + + .. py:attribute:: filter + :type: str + + + .. py:attribute:: flex + :type: str + + + .. py:attribute:: flex_basis + :type: str + + + .. py:attribute:: flex_direction + :type: Union[str, Literal['row', 'row-reverse', 'column', 'column-reverse']] + + + .. py:attribute:: flex_flow + :type: str + + + .. py:attribute:: flex_grow + :type: str + + + .. py:attribute:: flex_shrink + :type: str + + + .. py:attribute:: flex_wrap + :type: Union[str, Literal['nowrap', 'wrap', 'wrap-reverse']] + + + .. py:attribute:: float + :type: Union[str, Literal['left', 'right', 'none']] + + + .. py:attribute:: font + :type: str + + + .. py:attribute:: font_family + :type: str + + + .. py:attribute:: font_feature_settings + :type: str + + + .. py:attribute:: font_kerning + :type: Union[str, Literal['auto', 'normal', 'none']] + + + .. py:attribute:: font_language_override + :type: str + + + .. py:attribute:: font_size + :type: str + + + .. py:attribute:: font_size_adjust + :type: Union[str, Literal['none']] + + + .. py:attribute:: font_stretch + :type: str + + + .. py:attribute:: font_style + :type: Union[str, Literal['normal', 'italic', 'oblique']] + + + .. py:attribute:: font_synthesis + :type: str + + + .. py:attribute:: font_variant + :type: str + + + .. py:attribute:: font_variant_alternates + :type: str + + + .. py:attribute:: font_variant_caps + :type: Union[str, Literal['normal', 'small-caps']] + + + .. py:attribute:: font_variant_east_asian + :type: str + + + .. py:attribute:: font_variant_ligatures + :type: str + + + .. py:attribute:: font_variant_numeric + :type: str + + + .. py:attribute:: font_variant_position + :type: Union[str, Literal['normal', 'sub', 'super']] + + + .. py:attribute:: font_weight + :type: Union[str, Literal['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900']] + + + .. py:attribute:: grid + :type: str + + + .. py:attribute:: grid_area + :type: str + + + .. py:attribute:: grid_auto_columns + :type: str + + + .. py:attribute:: grid_auto_flow + :type: str + + + .. py:attribute:: grid_auto_rows + :type: str + + + .. py:attribute:: grid_column + :type: str + + + .. py:attribute:: grid_column_end + :type: str + + + .. py:attribute:: grid_column_gap + :type: str + + + .. py:attribute:: grid_column_start + :type: str + + + .. py:attribute:: grid_gap + :type: str + + + .. py:attribute:: grid_row + :type: str + + + .. py:attribute:: grid_row_end + :type: str + + + .. py:attribute:: grid_row_gap + :type: str + + + .. py:attribute:: grid_row_start + :type: str + + + .. py:attribute:: grid_template + :type: str + + + .. py:attribute:: grid_template_areas + :type: str + + + .. py:attribute:: grid_template_columns + :type: str + + + .. py:attribute:: grid_template_rows + :type: str + + + .. py:attribute:: height + :type: str + + + .. py:attribute:: hyphens + :type: Union[str, Literal['none', 'manual', 'auto']] + + + .. py:attribute:: image_rendering + :type: str + + + .. py:attribute:: isolation + :type: Union[str, Literal['auto', 'isolate']] + + + .. py:attribute:: justify_content + :type: Union[str, Literal['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']] + + + .. py:attribute:: left + :type: str + + + .. py:attribute:: letter_spacing + :type: str + + + .. py:attribute:: line_break + :type: Union[str, Literal['auto', 'loose', 'normal', 'strict']] + + + .. py:attribute:: line_height + :type: Union[str, int] + + + .. py:attribute:: list_style + :type: str + + + .. py:attribute:: list_style_image + :type: str + + + .. py:attribute:: list_style_position + :type: Union[str, Literal['inside', 'outside']] + + + .. py:attribute:: list_style_type + :type: str + + + .. py:attribute:: margin + :type: str + + + .. py:attribute:: margin_bottom + :type: str + + + .. py:attribute:: margin_left + :type: str + + + .. py:attribute:: margin_right + :type: str + + + .. py:attribute:: margin_top + :type: str + + + .. py:attribute:: max_height + :type: str + + + .. py:attribute:: max_width + :type: str + + + .. py:attribute:: min_height + :type: str + + + .. py:attribute:: min_width + :type: str + + + .. py:attribute:: mix_blend_mode + :type: str + + + .. py:attribute:: object_fit + :type: Union[str, Literal['fill', 'contain', 'cover', 'none', 'scale-down']] + + + .. py:attribute:: object_position + :type: str + + + .. py:attribute:: opacity + :type: Union[str, float_] + + + .. py:attribute:: order + :type: Union[str, int] + + + .. py:attribute:: outline + :type: str + + + .. py:attribute:: outline_color + :type: str + + + .. py:attribute:: outline_offset + :type: str + + + .. py:attribute:: outline_style + :type: str + + + .. py:attribute:: outline_width + :type: str + + + .. py:attribute:: overflow + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_wrap + :type: Union[str, Literal['normal', 'break-word', 'anywhere']] + + + .. py:attribute:: overflow_x + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_y + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: padding + :type: str + + + .. py:attribute:: padding_bottom + :type: str + + + .. py:attribute:: padding_left + :type: str + + + .. py:attribute:: padding_right + :type: str + + + .. py:attribute:: padding_top + :type: str + + + .. py:attribute:: page_break_after + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_before + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_inside + :type: Union[str, Literal['auto', 'avoid']] + + + .. py:attribute:: perspective + :type: str + + + .. py:attribute:: perspective_origin + :type: str + + + .. py:attribute:: position + :type: Union[str, Literal['static', 'relative', 'absolute', 'fixed', 'sticky']] + + + .. py:attribute:: quotes + :type: str + + + .. py:attribute:: resize + :type: Union[str, Literal['none', 'both', 'horizontal', 'vertical']] + + + .. py:attribute:: right + :type: str + + + .. py:attribute:: scroll_behavior + :type: Union[str, Literal['auto', 'smooth']] + + + .. py:attribute:: tab_size + :type: Union[str, int] + + + .. py:attribute:: table_layout + :type: Union[str, Literal['auto', 'fixed']] + + + .. py:attribute:: text_align + :type: Union[str, Literal['left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_align_last + :type: Union[str, Literal['auto', 'left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_decoration + :type: str + + + .. py:attribute:: text_decoration_color + :type: str + + + .. py:attribute:: text_decoration_line + :type: str + + + .. py:attribute:: text_decoration_style + :type: str + + + .. py:attribute:: text_indent + :type: str + + + .. py:attribute:: text_justify + :type: Union[str, Literal['auto', 'inter-word', 'inter-character', 'none']] + + + .. py:attribute:: text_overflow + :type: Union[str, Literal['clip', 'ellipsis']] + + + .. py:attribute:: text_shadow + :type: str + + + .. py:attribute:: text_transform + :type: Union[str, Literal['none', 'capitalize', 'uppercase', 'lowercase', 'full-width']] + + + .. py:attribute:: text_underline_position + :type: str + + + .. py:attribute:: top + :type: str + + + .. py:attribute:: transform + :type: str + + + .. py:attribute:: transform_origin + :type: str + + + .. py:attribute:: transform_style + :type: Union[str, Literal['flat', 'preserve-3d']] + + + .. py:attribute:: transition + :type: str + + + .. py:attribute:: transition_delay + :type: str + + + .. py:attribute:: transition_duration + :type: str + + + .. py:attribute:: transition_property + :type: str + + + .. py:attribute:: transition_timing_function + :type: str + + + .. py:attribute:: unicode_bidi + :type: Union[str, Literal['normal', 'embed', 'isolate', 'bidi-override']] + + + .. py:attribute:: user_select + :type: Union[str, Literal['auto', 'text', 'none', 'contain', 'all']] + + + .. py:attribute:: vertical_align + :type: str + + + .. py:attribute:: visibility + :type: Union[str, Literal['visible', 'hidden', 'collapse']] + + + .. py:attribute:: white_space + :type: Union[str, Literal['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap']] + + + .. py:attribute:: widows + :type: Union[str, int] + + + .. py:attribute:: width + :type: str + + + .. py:attribute:: will_change + :type: str + + + .. py:attribute:: word_break + :type: Union[str, Literal['normal', 'break-all', 'keep-all', 'break-word']] + + + .. py:attribute:: word_spacing + :type: str + + + .. py:attribute:: writing_mode + :type: Union[str, Literal['horizontal-tb', 'vertical-rl', 'vertical-lr', 'sideways-rl', 'sideways-lr']] + + + .. py:attribute:: z_index + :type: Union[str, int] + + diff --git a/docs/api-reference/pydom/types/styling/index.rst b/docs/api-reference/pydom/types/styling/index.rst new file mode 100644 index 0000000..f18f6f7 --- /dev/null +++ b/docs/api-reference/pydom/types/styling/index.rst @@ -0,0 +1,889 @@ +pydom.types.styling +=================== + +.. py:module:: pydom.types.styling + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/types/styling/css_properties/index + + +Classes +------- + +.. autoapisummary:: + + pydom.types.styling.CSSProperties + + +Package Contents +---------------- + +.. py:class:: CSSProperties + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: align_content + :type: AlignContent + + + .. py:attribute:: align_items + :type: Literal['flex-start', 'flex-end', 'center', 'baseline', 'stretch'] + + + .. py:attribute:: align_self + :type: Union[str, Literal['auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch']] + + + .. py:attribute:: animation + :type: str + + + .. py:attribute:: animation_delay + :type: str + + + .. py:attribute:: animation_direction + :type: Union[str, Literal['normal', 'reverse', 'alternate', 'alternate-reverse']] + + + .. py:attribute:: animation_duration + :type: str + + + .. py:attribute:: animation_fill_mode + :type: Union[str, Literal['none', 'forwards', 'backwards', 'both']] + + + .. py:attribute:: animation_iteration_count + :type: Union[str, Literal['infinite', 'n']] + + + .. py:attribute:: animation_name + :type: str + + + .. py:attribute:: animation_play_state + :type: Union[str, Literal['running', 'paused']] + + + .. py:attribute:: animation_timing_function + :type: str + + + .. py:attribute:: backface_visibility + :type: Union[str, Literal['visible', 'hidden']] + + + .. py:attribute:: background + :type: str + + + .. py:attribute:: background_attachment + :type: Union[str, Literal['scroll', 'fixed', 'local']] + + + .. py:attribute:: background_blend_mode + :type: str + + + .. py:attribute:: background_clip + :type: Union[str, Literal['border-box', 'padding-box', 'content-box']] + + + .. py:attribute:: background_color + :type: str + + + .. py:attribute:: background_image + :type: str + + + .. py:attribute:: background_origin + :type: Union[str, Literal['padding-box', 'border-box', 'content-box']] + + + .. py:attribute:: background_position + :type: str + + + .. py:attribute:: background_repeat + :type: Union[str, Literal['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']] + + + .. py:attribute:: background_size + :type: str + + + .. py:attribute:: border + :type: str + + + .. py:attribute:: border_bottom + :type: str + + + .. py:attribute:: border_bottom_color + :type: str + + + .. py:attribute:: border_bottom_left_radius + :type: str + + + .. py:attribute:: border_bottom_right_radius + :type: str + + + .. py:attribute:: border_bottom_style + :type: str + + + .. py:attribute:: border_bottom_width + :type: str + + + .. py:attribute:: border_collapse + :type: Union[str, Literal['collapse', 'separate']] + + + .. py:attribute:: border_color + :type: str + + + .. py:attribute:: border_image + :type: str + + + .. py:attribute:: border_image_outset + :type: str + + + .. py:attribute:: border_image_repeat + :type: Union[str, Literal['stretch', 'repeat', 'round']] + + + .. py:attribute:: border_image_slice + :type: str + + + .. py:attribute:: border_image_source + :type: str + + + .. py:attribute:: border_image_width + :type: str + + + .. py:attribute:: border_left + :type: str + + + .. py:attribute:: border_left_color + :type: str + + + .. py:attribute:: border_left_style + :type: str + + + .. py:attribute:: border_left_width + :type: str + + + .. py:attribute:: border_radius + :type: str + + + .. py:attribute:: border_right + :type: str + + + .. py:attribute:: border_right_color + :type: str + + + .. py:attribute:: border_right_style + :type: str + + + .. py:attribute:: border_right_width + :type: str + + + .. py:attribute:: border_spacing + :type: str + + + .. py:attribute:: border_style + :type: str + + + .. py:attribute:: border_top + :type: str + + + .. py:attribute:: border_top_color + :type: str + + + .. py:attribute:: border_top_left_radius + :type: str + + + .. py:attribute:: border_top_right_radius + :type: str + + + .. py:attribute:: border_top_style + :type: str + + + .. py:attribute:: border_top_width + :type: str + + + .. py:attribute:: border_width + :type: str + + + .. py:attribute:: bottom + :type: str + + + .. py:attribute:: box_shadow + :type: str + + + .. py:attribute:: box_sizing + :type: Union[str, Literal['content-box', 'border-box']] + + + .. py:attribute:: caption_side + :type: Union[str, Literal['top', 'bottom']] + + + .. py:attribute:: clear + :type: Union[str, Literal['none', 'left', 'right', 'both']] + + D.clear() -> None. Remove all items from D. + + + + .. py:attribute:: clip + :type: str + + + .. py:attribute:: color + :type: str + + + .. py:attribute:: column_count + :type: Union[str, int] + + + .. py:attribute:: column_fill + :type: Union[str, Literal['balance', 'auto']] + + + .. py:attribute:: column_gap + :type: str + + + .. py:attribute:: column_rule + :type: str + + + .. py:attribute:: column_rule_color + :type: str + + + .. py:attribute:: column_rule_style + :type: str + + + .. py:attribute:: column_rule_width + :type: str + + + .. py:attribute:: column_span + :type: Union[str, Literal['none', 'all']] + + + .. py:attribute:: column_width + :type: Union[str, int] + + + .. py:attribute:: columns + :type: str + + + .. py:attribute:: content + :type: str + + + .. py:attribute:: counter_increment + :type: str + + + .. py:attribute:: counter_reset + :type: str + + + .. py:attribute:: cursor + :type: str + + + .. py:attribute:: direction + :type: Union[str, Literal['ltr', 'rtl']] + + + .. py:attribute:: display + :type: Union[str, Literal['block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid', 'inline-grid', 'table', 'table-row', 'table-cell', 'none']] + + + .. py:attribute:: empty_cells + :type: Union[str, Literal['show', 'hide']] + + + .. py:attribute:: filter + :type: str + + + .. py:attribute:: flex + :type: str + + + .. py:attribute:: flex_basis + :type: str + + + .. py:attribute:: flex_direction + :type: Union[str, Literal['row', 'row-reverse', 'column', 'column-reverse']] + + + .. py:attribute:: flex_flow + :type: str + + + .. py:attribute:: flex_grow + :type: str + + + .. py:attribute:: flex_shrink + :type: str + + + .. py:attribute:: flex_wrap + :type: Union[str, Literal['nowrap', 'wrap', 'wrap-reverse']] + + + .. py:attribute:: float + :type: Union[str, Literal['left', 'right', 'none']] + + + .. py:attribute:: font + :type: str + + + .. py:attribute:: font_family + :type: str + + + .. py:attribute:: font_feature_settings + :type: str + + + .. py:attribute:: font_kerning + :type: Union[str, Literal['auto', 'normal', 'none']] + + + .. py:attribute:: font_language_override + :type: str + + + .. py:attribute:: font_size + :type: str + + + .. py:attribute:: font_size_adjust + :type: Union[str, Literal['none']] + + + .. py:attribute:: font_stretch + :type: str + + + .. py:attribute:: font_style + :type: Union[str, Literal['normal', 'italic', 'oblique']] + + + .. py:attribute:: font_synthesis + :type: str + + + .. py:attribute:: font_variant + :type: str + + + .. py:attribute:: font_variant_alternates + :type: str + + + .. py:attribute:: font_variant_caps + :type: Union[str, Literal['normal', 'small-caps']] + + + .. py:attribute:: font_variant_east_asian + :type: str + + + .. py:attribute:: font_variant_ligatures + :type: str + + + .. py:attribute:: font_variant_numeric + :type: str + + + .. py:attribute:: font_variant_position + :type: Union[str, Literal['normal', 'sub', 'super']] + + + .. py:attribute:: font_weight + :type: Union[str, Literal['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900']] + + + .. py:attribute:: grid + :type: str + + + .. py:attribute:: grid_area + :type: str + + + .. py:attribute:: grid_auto_columns + :type: str + + + .. py:attribute:: grid_auto_flow + :type: str + + + .. py:attribute:: grid_auto_rows + :type: str + + + .. py:attribute:: grid_column + :type: str + + + .. py:attribute:: grid_column_end + :type: str + + + .. py:attribute:: grid_column_gap + :type: str + + + .. py:attribute:: grid_column_start + :type: str + + + .. py:attribute:: grid_gap + :type: str + + + .. py:attribute:: grid_row + :type: str + + + .. py:attribute:: grid_row_end + :type: str + + + .. py:attribute:: grid_row_gap + :type: str + + + .. py:attribute:: grid_row_start + :type: str + + + .. py:attribute:: grid_template + :type: str + + + .. py:attribute:: grid_template_areas + :type: str + + + .. py:attribute:: grid_template_columns + :type: str + + + .. py:attribute:: grid_template_rows + :type: str + + + .. py:attribute:: height + :type: str + + + .. py:attribute:: hyphens + :type: Union[str, Literal['none', 'manual', 'auto']] + + + .. py:attribute:: image_rendering + :type: str + + + .. py:attribute:: isolation + :type: Union[str, Literal['auto', 'isolate']] + + + .. py:attribute:: justify_content + :type: Union[str, Literal['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']] + + + .. py:attribute:: left + :type: str + + + .. py:attribute:: letter_spacing + :type: str + + + .. py:attribute:: line_break + :type: Union[str, Literal['auto', 'loose', 'normal', 'strict']] + + + .. py:attribute:: line_height + :type: Union[str, int] + + + .. py:attribute:: list_style + :type: str + + + .. py:attribute:: list_style_image + :type: str + + + .. py:attribute:: list_style_position + :type: Union[str, Literal['inside', 'outside']] + + + .. py:attribute:: list_style_type + :type: str + + + .. py:attribute:: margin + :type: str + + + .. py:attribute:: margin_bottom + :type: str + + + .. py:attribute:: margin_left + :type: str + + + .. py:attribute:: margin_right + :type: str + + + .. py:attribute:: margin_top + :type: str + + + .. py:attribute:: max_height + :type: str + + + .. py:attribute:: max_width + :type: str + + + .. py:attribute:: min_height + :type: str + + + .. py:attribute:: min_width + :type: str + + + .. py:attribute:: mix_blend_mode + :type: str + + + .. py:attribute:: object_fit + :type: Union[str, Literal['fill', 'contain', 'cover', 'none', 'scale-down']] + + + .. py:attribute:: object_position + :type: str + + + .. py:attribute:: opacity + :type: Union[str, float_] + + + .. py:attribute:: order + :type: Union[str, int] + + + .. py:attribute:: outline + :type: str + + + .. py:attribute:: outline_color + :type: str + + + .. py:attribute:: outline_offset + :type: str + + + .. py:attribute:: outline_style + :type: str + + + .. py:attribute:: outline_width + :type: str + + + .. py:attribute:: overflow + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_wrap + :type: Union[str, Literal['normal', 'break-word', 'anywhere']] + + + .. py:attribute:: overflow_x + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: overflow_y + :type: Union[str, Literal['auto', 'hidden', 'scroll', 'visible']] + + + .. py:attribute:: padding + :type: str + + + .. py:attribute:: padding_bottom + :type: str + + + .. py:attribute:: padding_left + :type: str + + + .. py:attribute:: padding_right + :type: str + + + .. py:attribute:: padding_top + :type: str + + + .. py:attribute:: page_break_after + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_before + :type: Union[str, Literal['auto', 'always', 'avoid', 'left', 'right']] + + + .. py:attribute:: page_break_inside + :type: Union[str, Literal['auto', 'avoid']] + + + .. py:attribute:: perspective + :type: str + + + .. py:attribute:: perspective_origin + :type: str + + + .. py:attribute:: position + :type: Union[str, Literal['static', 'relative', 'absolute', 'fixed', 'sticky']] + + + .. py:attribute:: quotes + :type: str + + + .. py:attribute:: resize + :type: Union[str, Literal['none', 'both', 'horizontal', 'vertical']] + + + .. py:attribute:: right + :type: str + + + .. py:attribute:: scroll_behavior + :type: Union[str, Literal['auto', 'smooth']] + + + .. py:attribute:: tab_size + :type: Union[str, int] + + + .. py:attribute:: table_layout + :type: Union[str, Literal['auto', 'fixed']] + + + .. py:attribute:: text_align + :type: Union[str, Literal['left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_align_last + :type: Union[str, Literal['auto', 'left', 'right', 'center', 'justify', 'start', 'end']] + + + .. py:attribute:: text_decoration + :type: str + + + .. py:attribute:: text_decoration_color + :type: str + + + .. py:attribute:: text_decoration_line + :type: str + + + .. py:attribute:: text_decoration_style + :type: str + + + .. py:attribute:: text_indent + :type: str + + + .. py:attribute:: text_justify + :type: Union[str, Literal['auto', 'inter-word', 'inter-character', 'none']] + + + .. py:attribute:: text_overflow + :type: Union[str, Literal['clip', 'ellipsis']] + + + .. py:attribute:: text_shadow + :type: str + + + .. py:attribute:: text_transform + :type: Union[str, Literal['none', 'capitalize', 'uppercase', 'lowercase', 'full-width']] + + + .. py:attribute:: text_underline_position + :type: str + + + .. py:attribute:: top + :type: str + + + .. py:attribute:: transform + :type: str + + + .. py:attribute:: transform_origin + :type: str + + + .. py:attribute:: transform_style + :type: Union[str, Literal['flat', 'preserve-3d']] + + + .. py:attribute:: transition + :type: str + + + .. py:attribute:: transition_delay + :type: str + + + .. py:attribute:: transition_duration + :type: str + + + .. py:attribute:: transition_property + :type: str + + + .. py:attribute:: transition_timing_function + :type: str + + + .. py:attribute:: unicode_bidi + :type: Union[str, Literal['normal', 'embed', 'isolate', 'bidi-override']] + + + .. py:attribute:: user_select + :type: Union[str, Literal['auto', 'text', 'none', 'contain', 'all']] + + + .. py:attribute:: vertical_align + :type: str + + + .. py:attribute:: visibility + :type: Union[str, Literal['visible', 'hidden', 'collapse']] + + + .. py:attribute:: white_space + :type: Union[str, Literal['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap']] + + + .. py:attribute:: widows + :type: Union[str, int] + + + .. py:attribute:: width + :type: str + + + .. py:attribute:: will_change + :type: str + + + .. py:attribute:: word_break + :type: Union[str, Literal['normal', 'break-all', 'keep-all', 'break-word']] + + + .. py:attribute:: word_spacing + :type: str + + + .. py:attribute:: writing_mode + :type: Union[str, Literal['horizontal-tb', 'vertical-rl', 'vertical-lr', 'sideways-rl', 'sideways-lr']] + + + .. py:attribute:: z_index + :type: Union[str, int] + + diff --git a/docs/api-reference/pydom/types/svg/index.rst b/docs/api-reference/pydom/types/svg/index.rst new file mode 100644 index 0000000..c6dfab0 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/index.rst @@ -0,0 +1,1148 @@ +pydom.types.svg +=============== + +.. py:module:: pydom.types.svg + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /api-reference/pydom/types/svg/svg_a_element/index + /api-reference/pydom/types/svg/svg_animate_element/index + /api-reference/pydom/types/svg/svg_animate_motion_element/index + /api-reference/pydom/types/svg/svg_animate_transform_element/index + /api-reference/pydom/types/svg/svg_circle_element/index + /api-reference/pydom/types/svg/svg_clip_path_element/index + /api-reference/pydom/types/svg/svg_defs_element/index + /api-reference/pydom/types/svg/svg_desc_element/index + /api-reference/pydom/types/svg/svg_element_props/index + /api-reference/pydom/types/svg/svg_ellipse_element/index + /api-reference/pydom/types/svg/svg_event_props/index + /api-reference/pydom/types/svg/svg_fe_blend_element/index + /api-reference/pydom/types/svg/svg_fe_color_matrix_element/index + /api-reference/pydom/types/svg/svg_fe_component_transfer_element/index + /api-reference/pydom/types/svg/svg_fe_composite_element/index + /api-reference/pydom/types/svg/svg_fe_convolve_matrix_element/index + /api-reference/pydom/types/svg/svg_fe_diffuse_lighting_element/index + /api-reference/pydom/types/svg/svg_fe_displacement_map_element/index + /api-reference/pydom/types/svg/svg_fe_distant_light_element/index + /api-reference/pydom/types/svg/svg_fe_drop_shadow_element/index + /api-reference/pydom/types/svg/svg_fe_flood_element/index + /api-reference/pydom/types/svg/svg_fe_func_a_element/index + /api-reference/pydom/types/svg/svg_fe_func_b_element/index + /api-reference/pydom/types/svg/svg_fe_func_g_element/index + /api-reference/pydom/types/svg/svg_fe_func_r_element/index + /api-reference/pydom/types/svg/svg_fe_gaussian_blur_element/index + /api-reference/pydom/types/svg/svg_fe_image_element/index + /api-reference/pydom/types/svg/svg_fe_merge_element/index + /api-reference/pydom/types/svg/svg_fe_merge_node_element/index + /api-reference/pydom/types/svg/svg_fe_morphology_element/index + /api-reference/pydom/types/svg/svg_fe_offset_element/index + /api-reference/pydom/types/svg/svg_fe_point_light_element/index + /api-reference/pydom/types/svg/svg_fe_specular_lighting_element/index + /api-reference/pydom/types/svg/svg_fe_spot_light_element/index + /api-reference/pydom/types/svg/svg_fe_tile_element/index + /api-reference/pydom/types/svg/svg_fe_turbulence_element/index + /api-reference/pydom/types/svg/svg_filter_element/index + /api-reference/pydom/types/svg/svg_foreign_object_element/index + /api-reference/pydom/types/svg/svg_g_element/index + /api-reference/pydom/types/svg/svg_image_element/index + /api-reference/pydom/types/svg/svg_line_element/index + /api-reference/pydom/types/svg/svg_linear_gradient_element/index + /api-reference/pydom/types/svg/svg_m_path_element/index + /api-reference/pydom/types/svg/svg_marker_element/index + /api-reference/pydom/types/svg/svg_mask_element/index + /api-reference/pydom/types/svg/svg_metadata_element/index + /api-reference/pydom/types/svg/svg_path_element/index + /api-reference/pydom/types/svg/svg_pattern_element/index + /api-reference/pydom/types/svg/svg_polygon_element/index + /api-reference/pydom/types/svg/svg_polyline_element/index + /api-reference/pydom/types/svg/svg_radial_gradient_element/index + /api-reference/pydom/types/svg/svg_rect_element/index + /api-reference/pydom/types/svg/svg_script_element/index + /api-reference/pydom/types/svg/svg_set_element/index + /api-reference/pydom/types/svg/svg_stop_element/index + /api-reference/pydom/types/svg/svg_style_element/index + /api-reference/pydom/types/svg/svg_svg_element/index + /api-reference/pydom/types/svg/svg_switch_element/index + /api-reference/pydom/types/svg/svg_symbol_element/index + /api-reference/pydom/types/svg/svg_t_span_element/index + /api-reference/pydom/types/svg/svg_text_element/index + /api-reference/pydom/types/svg/svg_text_path_element/index + /api-reference/pydom/types/svg/svg_title_element/index + /api-reference/pydom/types/svg/svg_use_element/index + /api-reference/pydom/types/svg/svg_view_element/index + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.SVGAnchorElement + pydom.types.svg.SVGAnimateElement + pydom.types.svg.SVGAnimateMotionElement + pydom.types.svg.SVGAnimateTransformElement + pydom.types.svg.SVGCircleElement + pydom.types.svg.SVGClipPathElement + pydom.types.svg.SVGDefsElement + pydom.types.svg.SVGDescElement + pydom.types.svg.SVGEllipseElement + pydom.types.svg.SVGFEBlendElement + pydom.types.svg.SVGFEColorMatrixElement + pydom.types.svg.SVGFEComponentTransferElement + pydom.types.svg.SVGFECompositeElement + pydom.types.svg.SVGFEConvolveMatrixElement + pydom.types.svg.SVGFEDiffuseLightingElement + pydom.types.svg.SVGFEDisplacementMapElement + pydom.types.svg.SVGFEDistantLightElement + pydom.types.svg.SVGFEDropShadowElement + pydom.types.svg.SVGFEFloodElement + pydom.types.svg.SVGFEFuncAElement + pydom.types.svg.SVGFEFuncBElement + pydom.types.svg.SVGFEFuncGElement + pydom.types.svg.SVGFEFuncRElement + pydom.types.svg.SVGFEGaussianBlurElement + pydom.types.svg.SVGFEImageElement + pydom.types.svg.SVGFEMergeElement + pydom.types.svg.SVGFEMergeNodeElement + pydom.types.svg.SVGFEMorphologyElement + pydom.types.svg.SVGFEOffsetElement + pydom.types.svg.SVGFEPointLightElement + pydom.types.svg.SVGFESpecularLightingElement + pydom.types.svg.SVGFESpotLightElement + pydom.types.svg.SVGFETileElement + pydom.types.svg.SVGFETurbulenceElement + pydom.types.svg.SVGFilterElement + pydom.types.svg.SVGForeignObjectElement + pydom.types.svg.SVGGElement + pydom.types.svg.SVGImageElement + pydom.types.svg.SVGLineElement + pydom.types.svg.SVGLinearGradientElement + pydom.types.svg.SVGMarkerElement + pydom.types.svg.SVGMaskElement + pydom.types.svg.SVGMetadataElement + pydom.types.svg.SVGMPathElement + pydom.types.svg.SVGPathElement + pydom.types.svg.SVGPatternElement + pydom.types.svg.SVGPolygonElement + pydom.types.svg.SVGPolylineElement + pydom.types.svg.SVGRadialGradientElement + pydom.types.svg.SVGRectElement + pydom.types.svg.SVGScriptElement + pydom.types.svg.SVGSetElement + pydom.types.svg.SVGStopElement + pydom.types.svg.SVGStyleElement + pydom.types.svg.SVGSVGElement + pydom.types.svg.SVGSwitchElement + pydom.types.svg.SVGSymbolElement + pydom.types.svg.SVGTextElement + pydom.types.svg.SVGTextPathElement + pydom.types.svg.SVGTitleElement + pydom.types.svg.SVGTSpanElement + pydom.types.svg.SVGUseElement + pydom.types.svg.SVGViewElement + + +Package Contents +---------------- + +.. py:class:: SVGAnchorElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + .. py:attribute:: download + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: href_lang + :type: Optional[str] + + + .. py:attribute:: ping + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[Literal['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url']] + + + .. py:attribute:: rel + :type: Optional[str] + + + .. py:attribute:: system_language + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[Literal['_blank', '_self', '_parent', '_top']] + + + .. py:attribute:: type + :type: Optional[str] + + +.. py:class:: SVGAnimateElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + .. py:attribute:: attribute_name + :type: Optional[str] + + + .. py:attribute:: attribute_type + :type: Optional[str] + + + .. py:attribute:: dur + :type: Optional[str] + + + .. py:attribute:: fill + :type: Optional[str] + + + .. py:attribute:: svg_from + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: repeat_count + :type: Optional[Union[int, Literal['indefinite']]] + + + .. py:attribute:: system_language + :type: Optional[str] + + + .. py:attribute:: to + :type: Optional[str] + + + .. py:attribute:: values + :type: Optional[str] + + +.. py:class:: SVGAnimateMotionElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGAnimateTransformElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGCircleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGClipPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGDefsElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGDescElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + +.. py:class:: SVGEllipseElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEBlendElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEColorMatrixElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEComponentTransferElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFECompositeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEConvolveMatrixElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEDiffuseLightingElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEDisplacementMapElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEDistantLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEDropShadowElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEFloodElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEFuncAElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEFuncBElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEFuncGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEFuncRElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEGaussianBlurElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEImageElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEMergeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEMergeNodeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEMorphologyElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEOffsetElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFEPointLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFESpecularLightingElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFESpotLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFETileElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFETurbulenceElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGFilterElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGForeignObjectElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGImageElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGLineElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGLinearGradientElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGMarkerElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGMaskElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGMetadataElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGMPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGPatternElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGPolygonElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGPolylineElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGRadialGradientElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGRectElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGScriptElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGSetElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGStopElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGStyleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGSVGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGSwitchElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGSymbolElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGTextElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGTextPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGTitleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGTSpanElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGUseElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + +.. py:class:: SVGViewElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_a_element/index.rst b/docs/api-reference/pydom/types/svg/svg_a_element/index.rst new file mode 100644 index 0000000..f59153c --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_a_element/index.rst @@ -0,0 +1,58 @@ +pydom.types.svg.svg_a_element +============================= + +.. py:module:: pydom.types.svg.svg_a_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_a_element.SVGAnchorElement + + +Module Contents +--------------- + +.. py:class:: SVGAnchorElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + .. py:attribute:: download + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: href_lang + :type: Optional[str] + + + .. py:attribute:: ping + :type: Optional[str] + + + .. py:attribute:: referrer_policy + :type: Optional[Literal['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url']] + + + .. py:attribute:: rel + :type: Optional[str] + + + .. py:attribute:: system_language + :type: Optional[str] + + + .. py:attribute:: target + :type: Optional[Literal['_blank', '_self', '_parent', '_top']] + + + .. py:attribute:: type + :type: Optional[str] + + diff --git a/docs/api-reference/pydom/types/svg/svg_animate_element/index.rst b/docs/api-reference/pydom/types/svg/svg_animate_element/index.rst new file mode 100644 index 0000000..eff0fb7 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_animate_element/index.rst @@ -0,0 +1,62 @@ +pydom.types.svg.svg_animate_element +=================================== + +.. py:module:: pydom.types.svg.svg_animate_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_animate_element.SVGAnimateElement + + +Module Contents +--------------- + +.. py:class:: SVGAnimateElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + .. py:attribute:: attribute_name + :type: Optional[str] + + + .. py:attribute:: attribute_type + :type: Optional[str] + + + .. py:attribute:: dur + :type: Optional[str] + + + .. py:attribute:: fill + :type: Optional[str] + + + .. py:attribute:: svg_from + :type: Optional[str] + + + .. py:attribute:: href + :type: Optional[str] + + + .. py:attribute:: repeat_count + :type: Optional[Union[int, Literal['indefinite']]] + + + .. py:attribute:: system_language + :type: Optional[str] + + + .. py:attribute:: to + :type: Optional[str] + + + .. py:attribute:: values + :type: Optional[str] + + diff --git a/docs/api-reference/pydom/types/svg/svg_animate_motion_element/index.rst b/docs/api-reference/pydom/types/svg/svg_animate_motion_element/index.rst new file mode 100644 index 0000000..2e0cd4d --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_animate_motion_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_animate_motion_element +========================================== + +.. py:module:: pydom.types.svg.svg_animate_motion_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_animate_motion_element.SVGAnimateMotionElement + + +Module Contents +--------------- + +.. py:class:: SVGAnimateMotionElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_animate_transform_element/index.rst b/docs/api-reference/pydom/types/svg/svg_animate_transform_element/index.rst new file mode 100644 index 0000000..17797dd --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_animate_transform_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_animate_transform_element +============================================= + +.. py:module:: pydom.types.svg.svg_animate_transform_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_animate_transform_element.SVGAnimateTransformElement + + +Module Contents +--------------- + +.. py:class:: SVGAnimateTransformElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_circle_element/index.rst b/docs/api-reference/pydom/types/svg/svg_circle_element/index.rst new file mode 100644 index 0000000..5ea2fdf --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_circle_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_circle_element +================================== + +.. py:module:: pydom.types.svg.svg_circle_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_circle_element.SVGCircleElement + + +Module Contents +--------------- + +.. py:class:: SVGCircleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_clip_path_element/index.rst b/docs/api-reference/pydom/types/svg/svg_clip_path_element/index.rst new file mode 100644 index 0000000..279b9cd --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_clip_path_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_clip_path_element +===================================== + +.. py:module:: pydom.types.svg.svg_clip_path_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_clip_path_element.SVGClipPathElement + + +Module Contents +--------------- + +.. py:class:: SVGClipPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_defs_element/index.rst b/docs/api-reference/pydom/types/svg/svg_defs_element/index.rst new file mode 100644 index 0000000..03810d3 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_defs_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_defs_element +================================ + +.. py:module:: pydom.types.svg.svg_defs_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_defs_element.SVGDefsElement + + +Module Contents +--------------- + +.. py:class:: SVGDefsElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_desc_element/index.rst b/docs/api-reference/pydom/types/svg/svg_desc_element/index.rst new file mode 100644 index 0000000..7d002ad --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_desc_element/index.rst @@ -0,0 +1,22 @@ +pydom.types.svg.svg_desc_element +================================ + +.. py:module:: pydom.types.svg.svg_desc_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_desc_element.SVGDescElement + + +Module Contents +--------------- + +.. py:class:: SVGDescElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + diff --git a/docs/api-reference/pydom/types/svg/svg_element_props/index.rst b/docs/api-reference/pydom/types/svg/svg_element_props/index.rst new file mode 100644 index 0000000..603bd37 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_element_props/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_element_props +================================= + +.. py:module:: pydom.types.svg.svg_element_props + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_element_props.SVGElementProps + + +Module Contents +--------------- + +.. py:class:: SVGElementProps + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_ellipse_element/index.rst b/docs/api-reference/pydom/types/svg/svg_ellipse_element/index.rst new file mode 100644 index 0000000..cff8299 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_ellipse_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_ellipse_element +=================================== + +.. py:module:: pydom.types.svg.svg_ellipse_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_ellipse_element.SVGEllipseElement + + +Module Contents +--------------- + +.. py:class:: SVGEllipseElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_event_props/index.rst b/docs/api-reference/pydom/types/svg/svg_event_props/index.rst new file mode 100644 index 0000000..fa11aac --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_event_props/index.rst @@ -0,0 +1,57 @@ +pydom.types.svg.svg_event_props +=============================== + +.. py:module:: pydom.types.svg.svg_event_props + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_event_props.SVGEventProps + + +Module Contents +--------------- + +.. py:class:: SVGEventProps + + Bases: :py:obj:`typing_extensions.TypedDict` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + + .. py:attribute:: on_abort + :type: str + + + .. py:attribute:: on_error + :type: str + + + .. py:attribute:: on_load + :type: str + + + .. py:attribute:: on_resize + :type: str + + + .. py:attribute:: on_scroll + :type: str + + + .. py:attribute:: on_unload + :type: str + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_blend_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_blend_element/index.rst new file mode 100644 index 0000000..fb4f4d7 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_blend_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_blend_element +==================================== + +.. py:module:: pydom.types.svg.svg_fe_blend_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_blend_element.SVGFEBlendElement + + +Module Contents +--------------- + +.. py:class:: SVGFEBlendElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_color_matrix_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_color_matrix_element/index.rst new file mode 100644 index 0000000..6bf9e31 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_color_matrix_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_color_matrix_element +=========================================== + +.. py:module:: pydom.types.svg.svg_fe_color_matrix_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_color_matrix_element.SVGFEColorMatrixElement + + +Module Contents +--------------- + +.. py:class:: SVGFEColorMatrixElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_component_transfer_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_component_transfer_element/index.rst new file mode 100644 index 0000000..20cb1a4 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_component_transfer_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_component_transfer_element +================================================= + +.. py:module:: pydom.types.svg.svg_fe_component_transfer_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_component_transfer_element.SVGFEComponentTransferElement + + +Module Contents +--------------- + +.. py:class:: SVGFEComponentTransferElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_composite_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_composite_element/index.rst new file mode 100644 index 0000000..9a4c1b2 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_composite_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_composite_element +======================================== + +.. py:module:: pydom.types.svg.svg_fe_composite_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_composite_element.SVGFECompositeElement + + +Module Contents +--------------- + +.. py:class:: SVGFECompositeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_convolve_matrix_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_convolve_matrix_element/index.rst new file mode 100644 index 0000000..cfc4a21 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_convolve_matrix_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_convolve_matrix_element +============================================== + +.. py:module:: pydom.types.svg.svg_fe_convolve_matrix_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_convolve_matrix_element.SVGFEConvolveMatrixElement + + +Module Contents +--------------- + +.. py:class:: SVGFEConvolveMatrixElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_diffuse_lighting_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_diffuse_lighting_element/index.rst new file mode 100644 index 0000000..af65221 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_diffuse_lighting_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_diffuse_lighting_element +=============================================== + +.. py:module:: pydom.types.svg.svg_fe_diffuse_lighting_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_diffuse_lighting_element.SVGFEDiffuseLightingElement + + +Module Contents +--------------- + +.. py:class:: SVGFEDiffuseLightingElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_displacement_map_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_displacement_map_element/index.rst new file mode 100644 index 0000000..bc059fd --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_displacement_map_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_displacement_map_element +=============================================== + +.. py:module:: pydom.types.svg.svg_fe_displacement_map_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_displacement_map_element.SVGFEDisplacementMapElement + + +Module Contents +--------------- + +.. py:class:: SVGFEDisplacementMapElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_distant_light_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_distant_light_element/index.rst new file mode 100644 index 0000000..5ecb516 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_distant_light_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_distant_light_element +============================================ + +.. py:module:: pydom.types.svg.svg_fe_distant_light_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_distant_light_element.SVGFEDistantLightElement + + +Module Contents +--------------- + +.. py:class:: SVGFEDistantLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_drop_shadow_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_drop_shadow_element/index.rst new file mode 100644 index 0000000..a1b02e1 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_drop_shadow_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_drop_shadow_element +========================================== + +.. py:module:: pydom.types.svg.svg_fe_drop_shadow_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_drop_shadow_element.SVGFEDropShadowElement + + +Module Contents +--------------- + +.. py:class:: SVGFEDropShadowElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_flood_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_flood_element/index.rst new file mode 100644 index 0000000..be17a97 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_flood_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_flood_element +==================================== + +.. py:module:: pydom.types.svg.svg_fe_flood_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_flood_element.SVGFEFloodElement + + +Module Contents +--------------- + +.. py:class:: SVGFEFloodElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_func_a_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_func_a_element/index.rst new file mode 100644 index 0000000..faa35ea --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_func_a_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_func_a_element +===================================== + +.. py:module:: pydom.types.svg.svg_fe_func_a_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_func_a_element.SVGFEFuncAElement + + +Module Contents +--------------- + +.. py:class:: SVGFEFuncAElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_func_b_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_func_b_element/index.rst new file mode 100644 index 0000000..870c97d --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_func_b_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_func_b_element +===================================== + +.. py:module:: pydom.types.svg.svg_fe_func_b_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_func_b_element.SVGFEFuncBElement + + +Module Contents +--------------- + +.. py:class:: SVGFEFuncBElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_func_g_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_func_g_element/index.rst new file mode 100644 index 0000000..40c5557 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_func_g_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_func_g_element +===================================== + +.. py:module:: pydom.types.svg.svg_fe_func_g_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_func_g_element.SVGFEFuncGElement + + +Module Contents +--------------- + +.. py:class:: SVGFEFuncGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_func_r_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_func_r_element/index.rst new file mode 100644 index 0000000..3931dd8 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_func_r_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_func_r_element +===================================== + +.. py:module:: pydom.types.svg.svg_fe_func_r_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_func_r_element.SVGFEFuncRElement + + +Module Contents +--------------- + +.. py:class:: SVGFEFuncRElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_gaussian_blur_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_gaussian_blur_element/index.rst new file mode 100644 index 0000000..096d58c --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_gaussian_blur_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_gaussian_blur_element +============================================ + +.. py:module:: pydom.types.svg.svg_fe_gaussian_blur_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_gaussian_blur_element.SVGFEGaussianBlurElement + + +Module Contents +--------------- + +.. py:class:: SVGFEGaussianBlurElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_image_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_image_element/index.rst new file mode 100644 index 0000000..0fe4ceb --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_image_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_image_element +==================================== + +.. py:module:: pydom.types.svg.svg_fe_image_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_image_element.SVGFEImageElement + + +Module Contents +--------------- + +.. py:class:: SVGFEImageElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_merge_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_merge_element/index.rst new file mode 100644 index 0000000..341040e --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_merge_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_merge_element +==================================== + +.. py:module:: pydom.types.svg.svg_fe_merge_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_merge_element.SVGFEMergeElement + + +Module Contents +--------------- + +.. py:class:: SVGFEMergeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_merge_node_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_merge_node_element/index.rst new file mode 100644 index 0000000..dee6b37 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_merge_node_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_merge_node_element +========================================= + +.. py:module:: pydom.types.svg.svg_fe_merge_node_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_merge_node_element.SVGFEMergeNodeElement + + +Module Contents +--------------- + +.. py:class:: SVGFEMergeNodeElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_morphology_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_morphology_element/index.rst new file mode 100644 index 0000000..4627577 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_morphology_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_morphology_element +========================================= + +.. py:module:: pydom.types.svg.svg_fe_morphology_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_morphology_element.SVGFEMorphologyElement + + +Module Contents +--------------- + +.. py:class:: SVGFEMorphologyElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_offset_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_offset_element/index.rst new file mode 100644 index 0000000..e73031c --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_offset_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_offset_element +===================================== + +.. py:module:: pydom.types.svg.svg_fe_offset_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_offset_element.SVGFEOffsetElement + + +Module Contents +--------------- + +.. py:class:: SVGFEOffsetElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_point_light_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_point_light_element/index.rst new file mode 100644 index 0000000..1fed24b --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_point_light_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_point_light_element +========================================== + +.. py:module:: pydom.types.svg.svg_fe_point_light_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_point_light_element.SVGFEPointLightElement + + +Module Contents +--------------- + +.. py:class:: SVGFEPointLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_specular_lighting_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_specular_lighting_element/index.rst new file mode 100644 index 0000000..ec28f64 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_specular_lighting_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_specular_lighting_element +================================================ + +.. py:module:: pydom.types.svg.svg_fe_specular_lighting_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_specular_lighting_element.SVGFESpecularLightingElement + + +Module Contents +--------------- + +.. py:class:: SVGFESpecularLightingElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_spot_light_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_spot_light_element/index.rst new file mode 100644 index 0000000..da97614 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_spot_light_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_spot_light_element +========================================= + +.. py:module:: pydom.types.svg.svg_fe_spot_light_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_spot_light_element.SVGFESpotLightElement + + +Module Contents +--------------- + +.. py:class:: SVGFESpotLightElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_tile_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_tile_element/index.rst new file mode 100644 index 0000000..83d74ce --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_tile_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_tile_element +=================================== + +.. py:module:: pydom.types.svg.svg_fe_tile_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_tile_element.SVGFETileElement + + +Module Contents +--------------- + +.. py:class:: SVGFETileElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_fe_turbulence_element/index.rst b/docs/api-reference/pydom/types/svg/svg_fe_turbulence_element/index.rst new file mode 100644 index 0000000..663cd0c --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_fe_turbulence_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_fe_turbulence_element +========================================= + +.. py:module:: pydom.types.svg.svg_fe_turbulence_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_fe_turbulence_element.SVGFETurbulenceElement + + +Module Contents +--------------- + +.. py:class:: SVGFETurbulenceElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_filter_element/index.rst b/docs/api-reference/pydom/types/svg/svg_filter_element/index.rst new file mode 100644 index 0000000..d6fea28 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_filter_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_filter_element +================================== + +.. py:module:: pydom.types.svg.svg_filter_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_filter_element.SVGFilterElement + + +Module Contents +--------------- + +.. py:class:: SVGFilterElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_foreign_object_element/index.rst b/docs/api-reference/pydom/types/svg/svg_foreign_object_element/index.rst new file mode 100644 index 0000000..9a79f0d --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_foreign_object_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_foreign_object_element +========================================== + +.. py:module:: pydom.types.svg.svg_foreign_object_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_foreign_object_element.SVGForeignObjectElement + + +Module Contents +--------------- + +.. py:class:: SVGForeignObjectElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_g_element/index.rst b/docs/api-reference/pydom/types/svg/svg_g_element/index.rst new file mode 100644 index 0000000..509c921 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_g_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_g_element +============================= + +.. py:module:: pydom.types.svg.svg_g_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_g_element.SVGGElement + + +Module Contents +--------------- + +.. py:class:: SVGGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_image_element/index.rst b/docs/api-reference/pydom/types/svg/svg_image_element/index.rst new file mode 100644 index 0000000..e5bcb58 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_image_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_image_element +================================= + +.. py:module:: pydom.types.svg.svg_image_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_image_element.SVGImageElement + + +Module Contents +--------------- + +.. py:class:: SVGImageElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_line_element/index.rst b/docs/api-reference/pydom/types/svg/svg_line_element/index.rst new file mode 100644 index 0000000..07b1e7f --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_line_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_line_element +================================ + +.. py:module:: pydom.types.svg.svg_line_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_line_element.SVGLineElement + + +Module Contents +--------------- + +.. py:class:: SVGLineElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_linear_gradient_element/index.rst b/docs/api-reference/pydom/types/svg/svg_linear_gradient_element/index.rst new file mode 100644 index 0000000..36e63f3 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_linear_gradient_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_linear_gradient_element +=========================================== + +.. py:module:: pydom.types.svg.svg_linear_gradient_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_linear_gradient_element.SVGLinearGradientElement + + +Module Contents +--------------- + +.. py:class:: SVGLinearGradientElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_m_path_element/index.rst b/docs/api-reference/pydom/types/svg/svg_m_path_element/index.rst new file mode 100644 index 0000000..c06ad7d --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_m_path_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_m_path_element +================================== + +.. py:module:: pydom.types.svg.svg_m_path_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_m_path_element.SVGMPathElement + + +Module Contents +--------------- + +.. py:class:: SVGMPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_marker_element/index.rst b/docs/api-reference/pydom/types/svg/svg_marker_element/index.rst new file mode 100644 index 0000000..2228129 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_marker_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_marker_element +================================== + +.. py:module:: pydom.types.svg.svg_marker_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_marker_element.SVGMarkerElement + + +Module Contents +--------------- + +.. py:class:: SVGMarkerElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_mask_element/index.rst b/docs/api-reference/pydom/types/svg/svg_mask_element/index.rst new file mode 100644 index 0000000..5a3dce7 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_mask_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_mask_element +================================ + +.. py:module:: pydom.types.svg.svg_mask_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_mask_element.SVGMaskElement + + +Module Contents +--------------- + +.. py:class:: SVGMaskElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_metadata_element/index.rst b/docs/api-reference/pydom/types/svg/svg_metadata_element/index.rst new file mode 100644 index 0000000..0ffd876 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_metadata_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_metadata_element +==================================== + +.. py:module:: pydom.types.svg.svg_metadata_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_metadata_element.SVGMetadataElement + + +Module Contents +--------------- + +.. py:class:: SVGMetadataElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_path_element/index.rst b/docs/api-reference/pydom/types/svg/svg_path_element/index.rst new file mode 100644 index 0000000..f5c9d20 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_path_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_path_element +================================ + +.. py:module:: pydom.types.svg.svg_path_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_path_element.SVGPathElement + + +Module Contents +--------------- + +.. py:class:: SVGPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_pattern_element/index.rst b/docs/api-reference/pydom/types/svg/svg_pattern_element/index.rst new file mode 100644 index 0000000..5dd5ed6 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_pattern_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_pattern_element +=================================== + +.. py:module:: pydom.types.svg.svg_pattern_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_pattern_element.SVGPatternElement + + +Module Contents +--------------- + +.. py:class:: SVGPatternElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_polygon_element/index.rst b/docs/api-reference/pydom/types/svg/svg_polygon_element/index.rst new file mode 100644 index 0000000..01f6bcc --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_polygon_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_polygon_element +=================================== + +.. py:module:: pydom.types.svg.svg_polygon_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_polygon_element.SVGPolygonElement + + +Module Contents +--------------- + +.. py:class:: SVGPolygonElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_polyline_element/index.rst b/docs/api-reference/pydom/types/svg/svg_polyline_element/index.rst new file mode 100644 index 0000000..2d16f7f --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_polyline_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_polyline_element +==================================== + +.. py:module:: pydom.types.svg.svg_polyline_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_polyline_element.SVGPolylineElement + + +Module Contents +--------------- + +.. py:class:: SVGPolylineElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_radial_gradient_element/index.rst b/docs/api-reference/pydom/types/svg/svg_radial_gradient_element/index.rst new file mode 100644 index 0000000..e0b5296 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_radial_gradient_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_radial_gradient_element +=========================================== + +.. py:module:: pydom.types.svg.svg_radial_gradient_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_radial_gradient_element.SVGRadialGradientElement + + +Module Contents +--------------- + +.. py:class:: SVGRadialGradientElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_rect_element/index.rst b/docs/api-reference/pydom/types/svg/svg_rect_element/index.rst new file mode 100644 index 0000000..8660610 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_rect_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_rect_element +================================ + +.. py:module:: pydom.types.svg.svg_rect_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_rect_element.SVGRectElement + + +Module Contents +--------------- + +.. py:class:: SVGRectElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_script_element/index.rst b/docs/api-reference/pydom/types/svg/svg_script_element/index.rst new file mode 100644 index 0000000..51c3520 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_script_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_script_element +================================== + +.. py:module:: pydom.types.svg.svg_script_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_script_element.SVGScriptElement + + +Module Contents +--------------- + +.. py:class:: SVGScriptElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_set_element/index.rst b/docs/api-reference/pydom/types/svg/svg_set_element/index.rst new file mode 100644 index 0000000..83397e7 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_set_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_set_element +=============================== + +.. py:module:: pydom.types.svg.svg_set_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_set_element.SVGSetElement + + +Module Contents +--------------- + +.. py:class:: SVGSetElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_stop_element/index.rst b/docs/api-reference/pydom/types/svg/svg_stop_element/index.rst new file mode 100644 index 0000000..e7886fc --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_stop_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_stop_element +================================ + +.. py:module:: pydom.types.svg.svg_stop_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_stop_element.SVGStopElement + + +Module Contents +--------------- + +.. py:class:: SVGStopElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_style_element/index.rst b/docs/api-reference/pydom/types/svg/svg_style_element/index.rst new file mode 100644 index 0000000..a45aa01 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_style_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_style_element +================================= + +.. py:module:: pydom.types.svg.svg_style_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_style_element.SVGStyleElement + + +Module Contents +--------------- + +.. py:class:: SVGStyleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_svg_element/index.rst b/docs/api-reference/pydom/types/svg/svg_svg_element/index.rst new file mode 100644 index 0000000..eecc199 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_svg_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_svg_element +=============================== + +.. py:module:: pydom.types.svg.svg_svg_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_svg_element.SVGSVGElement + + +Module Contents +--------------- + +.. py:class:: SVGSVGElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_switch_element/index.rst b/docs/api-reference/pydom/types/svg/svg_switch_element/index.rst new file mode 100644 index 0000000..11bf102 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_switch_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_switch_element +================================== + +.. py:module:: pydom.types.svg.svg_switch_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_switch_element.SVGSwitchElement + + +Module Contents +--------------- + +.. py:class:: SVGSwitchElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_symbol_element/index.rst b/docs/api-reference/pydom/types/svg/svg_symbol_element/index.rst new file mode 100644 index 0000000..72d17c9 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_symbol_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_symbol_element +================================== + +.. py:module:: pydom.types.svg.svg_symbol_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_symbol_element.SVGSymbolElement + + +Module Contents +--------------- + +.. py:class:: SVGSymbolElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_t_span_element/index.rst b/docs/api-reference/pydom/types/svg/svg_t_span_element/index.rst new file mode 100644 index 0000000..602d1b4 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_t_span_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_t_span_element +================================== + +.. py:module:: pydom.types.svg.svg_t_span_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_t_span_element.SVGTSpanElement + + +Module Contents +--------------- + +.. py:class:: SVGTSpanElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_text_element/index.rst b/docs/api-reference/pydom/types/svg/svg_text_element/index.rst new file mode 100644 index 0000000..8850512 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_text_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_text_element +================================ + +.. py:module:: pydom.types.svg.svg_text_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_text_element.SVGTextElement + + +Module Contents +--------------- + +.. py:class:: SVGTextElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_text_path_element/index.rst b/docs/api-reference/pydom/types/svg/svg_text_path_element/index.rst new file mode 100644 index 0000000..e331246 --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_text_path_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_text_path_element +===================================== + +.. py:module:: pydom.types.svg.svg_text_path_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_text_path_element.SVGTextPathElement + + +Module Contents +--------------- + +.. py:class:: SVGTextPathElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_title_element/index.rst b/docs/api-reference/pydom/types/svg/svg_title_element/index.rst new file mode 100644 index 0000000..c98287e --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_title_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_title_element +================================= + +.. py:module:: pydom.types.svg.svg_title_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_title_element.SVGTitleElement + + +Module Contents +--------------- + +.. py:class:: SVGTitleElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_use_element/index.rst b/docs/api-reference/pydom/types/svg/svg_use_element/index.rst new file mode 100644 index 0000000..fbe64ae --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_use_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_use_element +=============================== + +.. py:module:: pydom.types.svg.svg_use_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_use_element.SVGUseElement + + +Module Contents +--------------- + +.. py:class:: SVGUseElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/types/svg/svg_view_element/index.rst b/docs/api-reference/pydom/types/svg/svg_view_element/index.rst new file mode 100644 index 0000000..8a9e34b --- /dev/null +++ b/docs/api-reference/pydom/types/svg/svg_view_element/index.rst @@ -0,0 +1,33 @@ +pydom.types.svg.svg_view_element +================================ + +.. py:module:: pydom.types.svg.svg_view_element + + +Classes +------- + +.. autoapisummary:: + + pydom.types.svg.svg_view_element.SVGViewElement + + +Module Contents +--------------- + +.. py:class:: SVGViewElement + + Bases: :py:obj:`pydom.types.svg.svg_element_props.SVGElementProps` + + + dict() -> new empty dictionary + dict(mapping) -> new dictionary initialized from a mapping object's + (key, value) pairs + dict(iterable) -> new dictionary initialized as if via: + d = {} + for k, v in iterable: + d[k] = v + dict(**kwargs) -> new dictionary initialized with the name=value pairs + in the keyword argument list. For example: dict(one=1, two=2) + + diff --git a/docs/api-reference/pydom/utils/functions/index.rst b/docs/api-reference/pydom/utils/functions/index.rst new file mode 100644 index 0000000..db359e5 --- /dev/null +++ b/docs/api-reference/pydom/utils/functions/index.rst @@ -0,0 +1,44 @@ +pydom.utils.functions +===================== + +.. py:module:: pydom.utils.functions + + +Attributes +---------- + +.. autoapisummary:: + + pydom.utils.functions.ascii_length + + +Functions +--------- + +.. autoapisummary:: + + pydom.utils.functions.random_string + pydom.utils.functions.to_iter + pydom.utils.functions.is_primitive + pydom.utils.functions.flatten + pydom.utils.functions.remove_prefix + + +Module Contents +--------------- + +.. py:data:: ascii_length + :value: 52 + + +.. py:function:: random_string(length=12) + +.. py:function:: to_iter(value: typing_extensions.Iterable[_T]) -> typing_extensions.Iterator[_T] + to_iter(value: _T) -> typing_extensions.Iterator[_T] + +.. py:function:: is_primitive(value) -> typing_extensions.TypeGuard[pydom.types.Primitive] + +.. py:function:: flatten(iterable) + +.. py:function:: remove_prefix(text: str, prefix: str) -> str + diff --git a/docs/api-reference/pydom/utils/get_frame/index.rst b/docs/api-reference/pydom/utils/get_frame/index.rst new file mode 100644 index 0000000..0054ff5 --- /dev/null +++ b/docs/api-reference/pydom/utils/get_frame/index.rst @@ -0,0 +1,32 @@ +pydom.utils.get_frame +===================== + +.. py:module:: pydom.utils.get_frame + + +Attributes +---------- + +.. autoapisummary:: + + pydom.utils.get_frame.get_frame + + +Functions +--------- + +.. autoapisummary:: + + pydom.utils.get_frame.get_frame_fallback + pydom.utils.get_frame.load_get_frame_function + + +Module Contents +--------------- + +.. py:function:: get_frame_fallback(n: int) + +.. py:function:: load_get_frame_function() + +.. py:data:: get_frame + diff --git a/docs/api-reference/pydom/utils/injector/index.rst b/docs/api-reference/pydom/utils/injector/index.rst new file mode 100644 index 0000000..84cd31d --- /dev/null +++ b/docs/api-reference/pydom/utils/injector/index.rst @@ -0,0 +1,62 @@ +pydom.utils.injector +==================== + +.. py:module:: pydom.utils.injector + + +Attributes +---------- + +.. autoapisummary:: + + pydom.utils.injector.T + pydom.utils.injector.InjectFactory + + +Classes +------- + +.. autoapisummary:: + + pydom.utils.injector.Injector + + +Functions +--------- + +.. autoapisummary:: + + pydom.utils.injector.future_dependency + + +Module Contents +--------------- + +.. py:data:: T + +.. py:data:: InjectFactory + :type: typing_extensions.TypeAlias + +.. py:class:: Injector(defaults: Optional[Dict[type, Any]] = None) + + A simple dependency injection container + + To get an instance of a class, you can use the `injector` property of the `Context` class. + + + .. py:attribute:: dependencies + :type: Dict[type, Callable] + + + .. py:method:: add(cls: Type[T], factory: InjectFactory, /) -> None + add(cls: Type[T], instance: T, /) -> None + + + .. py:method:: inject(callback: Callable) -> Callable + + + .. py:method:: scope(dependencies: Dict[type, InjectFactory]) + + +.. py:function:: future_dependency(message: str) + diff --git a/docs/api-reference/pydom/version/index.rst b/docs/api-reference/pydom/version/index.rst new file mode 100644 index 0000000..7cacde4 --- /dev/null +++ b/docs/api-reference/pydom/version/index.rst @@ -0,0 +1,21 @@ +pydom.version +============= + +.. py:module:: pydom.version + + +Attributes +---------- + +.. autoapisummary:: + + pydom.version.version + + +Module Contents +--------------- + +.. py:data:: version + :value: '0.3.1' + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..278ce46 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,100 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +import sys, datetime + +sys.path.insert(0, "../src") + +from pydom.version import version as __version__ + +project = "PyDOM" +author = "Xpo Development" +copyright = f"{datetime.date.today().year}, {author}" +version = __version__ + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "pydata_sphinx_theme", + "autoapi.extension", + "sphinx_substitution_extensions", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "_templates", "Thumbs.db", ".DS_Store"] + +# -- Options for Auto Api ---------------------------------------------------- +autoapi_dirs = ["../src/pydom"] +autoapi_ignore = [] +autoapi_options = [ + "members", + "undoc-members", + "show-inheritance", + "show-module-summary", + "special-members", + "imported-members", +] +autoapi_root = "api-reference" +autoapi_keep_files = True +autoapi_generate_api_docs = True +autoapi_add_toctree_entry = True +autoapi_python_use_implicit_namespaces = True + + +def skip_submodules(app, what, name, obj, skip, options): + if ( + name.startswith("pydom.html") + or name.startswith("pydom.svg") + or name.startswith("pydom.types.html") + ): + skip = True + return skip + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output +html_theme = "pydata_sphinx_theme" + +html_favicon = "_static/favicon.ico" +html_static_path = ["_static"] +html_title = "PyDOM Documentation" + +html_theme_options = { + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/xpodev/pydom", + "icon": "fa-brands fa-github", + }, + { + "name": "PyPI", + "url": "https://pypi.org/project/pytdom", + "icon": "fa-brands fa-python", + }, + ], + "logo": { + "image_light": "_static/images/logo-light.svg", + "image_dark": "_static/images/logo-dark.svg", + }, +} + +html_css_files = [ + "css/custom.css", +] + +rst_prolog = f""" +.. |version| replace:: {version} +.. |br| raw:: html + +
+""" + + +def setup(sphinx): + sphinx.connect("autoapi-skip-member", skip_submodules) diff --git a/docs/examples/fastapi/index.rst b/docs/examples/fastapi/index.rst new file mode 100644 index 0000000..060c9c4 --- /dev/null +++ b/docs/examples/fastapi/index.rst @@ -0,0 +1,54 @@ +.. _fastapi: + +############### +FastAPI + PyDOM +############### + +The following is a guide on how to use PyDOM with `FastAPI `_. + +Basic Application +################# + +Here is a basic FastAPI application that uses PyDOM to render a simple HTML page. + +.. code-block:: python + + from fastapi import FastAPI + from fastapi.responses import HTMLResponse + from pydom import Page, Div, render + + app = FastAPI() + + @app.get("/") + async def read_root(): + return HTMLResponse( + content=render(Page(Div("Hello, World!"))) + ) + +This application will render a simple HTML page with the text "Hello, World!". + +For convenience, you can use the `Default response class `_ +to automatically return HTML responses. + +Return Components Directly +########################## + +As your application grows, you may want to return PyDOM components directly from your FastAPI routes instead of calling +the ``render`` function, which can be tedious. + +Instead, you can register the ``render`` function as a custom encoder for the ``Component`` and ``Element`` classes. + +This is done by setting the ``render`` function as the encoder for the ``Component`` and ``Element`` classes in the +``encoders_by_class_tuples`` dictionary. + +.. code-block:: python + + from fastapi import encoders + from pydom import Component, render + from pydom.element import Element + + encoders.encoders_by_class_tuples[render] = (Element, Component) + +This will allow you to return PyDOM components directly from your FastAPI routes without having to call the ``render`` function. + +Like before, make sure the response class is set to ``HTMLResponse``. diff --git a/docs/examples/flask/index.rst b/docs/examples/flask/index.rst new file mode 100644 index 0000000..e71ddd0 --- /dev/null +++ b/docs/examples/flask/index.rst @@ -0,0 +1,54 @@ +.. _flask: + +############# +Flask + PyDOM +############# + +Here is a quick guide on how to use PyDOM with Flask. + +A Minimal Application +##################### + +The most basic way to use PyDOM with Flask is to render a PyDOM component in a Flask view function. + +.. code-block:: python + + from flask import Flask + from pydom import P, render + + app = Flask(__name__) + + @app.route("/") + def hello_world(): + return render(P("Hello, world!")) + +This corresponds to `A Minimal Application `_ in the Flask documentation. + +Making PyDOM Decorators +####################### + +It might be a little cumbersome to use the ``render`` function in every view function. +To make it easier, you can create a decorator that automatically renders the PyDOM component. + +.. code-block:: python + :caption: PyDOM Decorator + + from functools import wraps + + from flask import Flask + from pydom import P, render + + app = Flask(__name__) + + def pydom(view): + @wraps(view) + def wrapper(*args, **kwargs): + return render(view(*args, **kwargs)) + return wrapper + + @app.route("/") + @pydom + def hello_world(): + return P("Hello, world!") + +Now you can use the ``pydom`` decorator to render PyDOM components in your Flask view functions. \ No newline at end of file diff --git a/docs/examples/htmx/index.rst b/docs/examples/htmx/index.rst new file mode 100644 index 0000000..2415d0d --- /dev/null +++ b/docs/examples/htmx/index.rst @@ -0,0 +1,156 @@ +.. _htmx: + +############ +HTMX + PyDOM +############ + +A recipe to integrate `HTMX `_ with PyDOM. + +Minimal Requirements +#################### + +To use HTMX with PyDOM, there are few requirements: + +- Load HTMX library in your HTML page. +- Add transformers for HTMX attributes. +- (Optional) Add HTMX extensions: + + - Load the extension script in the head of the page. + - Add transformers for the extension attributes (if needed). + +Quick Start +########### + +Under `utils/htmx_runtime.py `_ you can find +utilities for simple integration with HTMX. + +The recommended way to use it is just to copy the file to your project +and modify it to fit your needs (e.g. add more extensions). + +Usage example: + +.. code:: python + + import pydom as d + from pydom.page import Page + from pydom.context.context import get_context + + from utils import htmx_runtime as htmx + + # Optional: HTMX Extensions to be registered + HTMX_EXTENSIONS: list[htmx.HTMXExtension] = [ + htmx.HTMXSSEExtension(), + htmx.HTMXClassToolsExtension(), + ] + + HTMX = htmx.HTMX() + + ctx = get_context() + htmx.setup_htmx_transformers(ctx, + # Optional: HTMX Extensions to be registered + extensions=HTMX_EXTENSIONS) + + + class BasePage(Page): + def __init__(self, *args, **kwargs): + super().__init__( + *args, + body_props=dict( + # Put the class-tools extension in the body + hx_ext=htmx.HTMXClassToolsExtension.name, + ), + **kwargs, + ) + + def head(self): + yield HTMX.script() + for ext in HTMX_EXTENSIONS: + yield ext.script() + + + # That's it! Now you can use HTMX attributes in your components + def MyComponent(): + return d.Div( + hx_get="/api/data", + hx_trigger="click", + hx_swap="outerHTML", + )("Click me!") + +Manual Integration +################## + +.. code:: python + + from pydom.context.context import PropertyTransformer, get_context + + class MyPage(pydom.page.Page): + def head(self): + yield pydom.Script( + src="https://unpkg.com/htmx.org@2.0.2", + integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ", + cross_origin="anonymous", + ) + + class HTMXTransformer(PropertyTransformer): + def match(self, key: str, value): + return key.startswith("hx_") + + def transform(self, key: str, value): + # The full implementation is too long for this example. + # You can find the full implementation in the utils/htmx_runtime.py file. + raise NotImplementedError() + + ctx = get_context() + ctx.add_prop_transformer( + HTMXTransformer(), + before=[HTMLEventsTransformer], + ) + +Add Typing Support +################## + +To add typing support and autocomplete for HTMX attributes, download +`this script `_, then you can run the following +command: + +.. code:: bash + + python utils/htmx_typing.py typings + +It will generate the necessary typing files for HTMX attributes, +enhancing your development experience with better autocompletion and +type checking. + +Modify the generated file to fit your project needs, e.g. add htmx extensions. + +Usage Notes +########### + +You can differentiate between HTMX requests and regular requests by +checking the ``HX-Request`` header: + +.. code:: python + + from pydom import d + from pydom.page import Page + + class MyPage(Page): + ... + + @router.get("/") + @inject + async def root(request: Request): + is_htmx = request.headers.get("HX-Request") == "true" + if not is_htmx: + # Regular request, return the full page + wrapper = MyPage() + else: + # HTMX request, return only the content + wrapper = d.Fragment() + + inner = d.Div("Hello, world!") + + return render(wrapper(inner)) + +*Thanks to* `@elazarcoh `_ *for the guide and +the utilities.* \ No newline at end of file diff --git a/docs/examples/index.rst b/docs/examples/index.rst new file mode 100644 index 0000000..39876a8 --- /dev/null +++ b/docs/examples/index.rst @@ -0,0 +1,20 @@ + +.. _examples: + +.. raw:: html + + + +######## +Examples +######## + +This directory contains a collection of examples that demonstrate how to use +PyDOM with different libraries and frameworks. + +- `Flask `_ +- `FastAPI `_ +- `HTMX `_ +- `Tailwind CSS `_ diff --git a/docs/examples/tailwind/index.rst b/docs/examples/tailwind/index.rst new file mode 100644 index 0000000..95141c7 --- /dev/null +++ b/docs/examples/tailwind/index.rst @@ -0,0 +1,101 @@ +.. _tailwindcss: + +#################### +Tailwind CSS + PyDOM +#################### + +The only requirement to make tailwindcss work with PyDOM is having +`Tailwind CLI `_ installed. + +Quick Start +########### + +First, install Tailwind CLI `See installation instructions `_. + +Tailwind CSS v3 +=============== + +1. Create a new Tailwind configuration file: + +.. code:: bash + + npx tailwindcss init + +2. Add the following to your Tailwind configuration file: + +.. code:: js + + module.exports = { + content: ["./src/**/*.{py}"], + }; + +Tailwind CSS v4 +=============== + +If you have Tailwind v4 installed, you can simply add the following to your CSS file: + +.. code:: css + + @import "tailwindcss"; + @source "./src/**/*.{py}"; + + +Generating CSS +============== + +To generate the CSS file, run the following command: + +.. code:: bash + + npx tailwindcss -i ./input/style.css -o ./output/style.css --watch + +Add the generated CSS file to your PyDOM pages: + +.. code:: python + + from pydom import Page, Link + + class MyPage(Page): + def head(self): + return ( + *super().head(), + Link( + rel="stylesheet", + href="/output/style.css" + ) + ) + +Now you can use Tailwind CSS classes in your PyDOM components: + +.. code:: python + + from pydom import Div + + def MyComponent(): + return Div( + "Hello, world!", + class="text-center text-2xl text-red-500" + ) + +That's it! Now you can run your app and see the Tailwind CSS styles applied. + +VSCode Tailwind CSS IntelliSense +################################ + +To enable Tailwind CSS IntelliSense in VSCode, you can install the `Tailwind CSS IntelliSense `_ extension. + +We need to configure the IntelliSense extension to work with PyDOM. Add the following to your VSCode settings: + +.. code:: json + + { + "tailwindCSS.includeLanguages": { + "python": "html" + }, + "tailwindCSS.classAttributes": [ + "classes", + ] + } + +You can add more attributes to the ``tailwindCSS.classAttributes`` list if you use different +attribute names for classes in your PyDOM components. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..35c06be --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,123 @@ +.. _index: + +.. raw:: html + + + +.. image:: /_static/images/logo.svg + :alt: pydom-logo + :align: center + :class: dark-light py-4 index-logo + +.. raw:: html + +

+ Simple to learn, easy to use, fully-featured UI library for Python +

+ +.. image:: https://img.shields.io/pypi/v/pydom.svg + :target: https://pypi.org/project/pydom/ + :alt: PyPI version + :align: center + +|br| + +##### +PyDOM +##### + +PyDOM is a Python library that allows you to create web pages using a declarative syntax. + +PyDOM provides a set of components that represent HTML elements and can be composed to create complex web pages. + +Quick Start +########### + +This is a quick start guide to get you up and running with PyDOM. +The guide will show you how to setup PyDOM and integrate it with `FastAPI `_. + +Installation +============ + +First, install the PyDOM package. + +.. code-block:: bash + + $ pip install pydom + + +Create Reusable Page +==================== + +PyDOM provides a default page component that is the minimal structure for a web page. + +The page can be customized by extending the default page component and overriding the ``head`` and the ``body`` methods. + +More information about the default page component can be found :ref:`here `. + +.. code-block:: python + :caption: Creating a custom page component + + # page.py + + from pydom import Link + from pydom.page import Page + + class AppPage(Page): + def head(self): + return ( + *super().head(), + Link( + rel="stylesheet", + href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" + ) + ) + + +Lastly, create the ``FastAPI`` app and add an endpoint that will render the page when the user is accessing the root route. + +.. code-block:: python + :caption: Creating the FastAPI app + + # main.py + + from fastapi import FastAPI + from fastapi.responses import HTMLResponse + from pydom import render, Div, P + from page import AppPage + + app = FastAPI() + + @app.get("/", response_class=HTMLResponse) + async def read_root(): + return render( + AppPage( + Div(classes="container mt-5")( + Div(classes="text-center p-4 rounded")( + Div(classes="display-4")("Hello, World!"), + P(classes="lead")("Welcome to PyDOM"), + ) + ) + ) + ) + + if __name__ == "__main__": + import uvicorn + uvicorn.run(app, host="localhost", port=8000) + +That's it! Now you can run the app and access it at `http://localhost:8000/ `_. + +It should display a page like this: + +.. image:: /_static/images/quick-start.jpeg + :alt: Quick Start + :align: center + +.. toctree:: + :hidden: + + user-guide/index + examples/index + api-reference/index \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..c874b6f --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +pydata-sphinx-theme==0.16.1 +sphinx-substitution-extensions==2024.8.6 +sphinx-autoapi==3.6.0 \ No newline at end of file diff --git a/docs/user-guide/advanced/context.rst b/docs/user-guide/advanced/context.rst new file mode 100644 index 0000000..4e1e87e --- /dev/null +++ b/docs/user-guide/advanced/context.rst @@ -0,0 +1,179 @@ +.. _context: + +####### +Context +####### + +Context is an object that holds all the configuration for the rendering pipeline. +It contains :ref:`property-transformers`, :ref:`post-render-transformers` and the :attr:`injector ` object. + +Each render process uses a context, which can be set by passing a context object to the ``render`` function as a keyword argument. +If a context is not provided, the :ref:`default context ` is used. + +.. code:: python + + from pydom import render, Context + + context = Context() + render(MyComponent(), context=context) + +.. note:: + The above example creates a new context object, which means it's empty and doesn't have any transformers registered with it. + +Transformers +############ + +Transformers are objects that can modify the rendering process. + +There are two types of transformers: + +- :ref:`Property Transformers ` +- :ref:`Post Render Transformers ` + +To add a transformer to the context, use the :meth:`add_prop_transformer ` and :meth:`add_post_render_transformer ` methods. + +Transformers are applied in the order they are added to the context. It is possible to control the position of +the transformer by using the ``before`` and ``after`` arguments of the ``add_prop_transformer`` and ``add_post_render_transformer`` methods. + +More information about transformers can be found in the :ref:`transformers section `. + +Dependencies +############ + +Dependencies are objects that can be injected into functions without explicitly passing them as arguments. +They are passed as keyword arguments to the function and are resolved by the context. + +By default, all transformer methods can have dependency injection. + +The default dependencies are: + +- :class:`Context ` +- :class:`RenderState ` - Only available in the rendering process. + +Injecting Dependencies +====================== + +To inject a dependency, add type annotations to the function arguments. + +An example of injecting the ``RenderState`` dependency can be found on the :ref:`property transformer example `. + +Creating a Custom Dependency +============================ + +To create a custom dependency, use the :meth:`add ` method of the ``injector``. +Each injectable dependency must have a type associated with it, which is used to resolve the dependency when it is injected. + +The injectable value can be anything, if it is callable, the return value of the call will be used as the value, this +allows for lazy initialization of the dependency. + +.. note:: + Callable dependencies are called without any arguments. + +Here is an example of a custom dependency: + +.. code-block:: python + :caption: Creating a custom dependency + + from pydom import get_context + + class User: + ... + + def get_user(): + return {"name": "John"} + + get_context().injector.add(User, get_user) + +Now the custom dependency can be injected into rendering functions using the ``User`` type. + +Injecting Dependencies to an Outside Function +============================================= + +The dependency injection system can also be used to inject dependencies into functions that are not part of the rendering process. + +To achieve this, decorate the function with the ``inject`` method of the ``Context`` object. + +.. code-block:: python + :caption: Injecting dependencies to a function + + from pydom import get_context + + context = get_context() + + @context.inject + def my_function(user: User): + print(user) + + +The ``my_function`` function can now be called without any arguments and the ``User`` dependency will be injected. + +Scoped Dependencies +=================== + +Scoped dependencies are dependencies that are only available during a specific scope, for example, during the rendering process. + +To create a scoped dependency, use the ``scope`` method of the ``injector`` +and pass a dictionary with the dependencies factory functions. + +.. important:: + Since the dependencies are inspected only once when using the ``inject`` decorator, scoped dependencies must be forward declared. + + PyDOM provides a helper function to create scoped dependencies, the :func:`future_dependency ` function. + This function takes a message to be raised when the dependency is accessed outside its scope. + +To illustrate this, this is how PyDOM creates the ``RenderState`` dependency: + +.. code-block:: python + :caption: Creating a scoped dependency + + # Register the RenderState dependency as a future dependency + context.injector.add(RenderState, future_dependency("RenderState is only available during the rendering process")) + + def render(...): + render_state = RenderState(root=element, render_target="html", **render_state_data) + with context.injector.scope({RenderState: lambda: render_state}): + # RenderState is only available during this scope + +.. _default-context: + +Default Context +############### + +By default, the context is created using the :meth:`Context.standard ` method. + +The default context has the following transformers registered (in this order): + +- :class:`FalsyTransformer ` - + Removes the following values from the element attributes: ``None``, ``False``. +- :class:`ClassTransformer ` - + Converts the ``classes`` property to a space-separated string and changes the ``classes`` key to ``class``. +- :class:`SimpleTransformer ` - + Converts each of the following properties key to its corresponding HTML attribute: + + - ``html_for`` -> ``for`` + - ``access_key`` -> ``accesskey`` + - ``content_editable`` -> ``contenteditable`` + - ``cross_origin`` -> ``crossorigin`` + - ``tab_index`` -> ``tabindex`` + - ``use_map`` -> ``usemap`` + - ``col_span`` -> ``colspan`` + - ``row_span`` -> ``rowspan`` + - ``char_set`` -> ``charset`` + +- :class:`StyleTransformer ` - + Converts any :class:`StyleSheet ` object to a css string. +- :class:`InnerHTMLTransformer ` - + Sets the innerHTML property of an element with the ``dangerously_set_inner_html`` key. +- :class:`HTMLEventsTransformer ` - + Converts the ``on_`` prefixed properties to their corresponding HTML event attributes. +- :class:`DashTransformer ` - + Converts each underscore in the property key to a dash. + + +Custom Context +############## + +To create a custom context, simply create a new instance of the :class:`Context ` class. + +You can pass the created context to the ``render`` method to use it. If you want to use the custom context as the default context, +pass the created context to the :func:`set_default_context ` function. \ No newline at end of file diff --git a/docs/user-guide/advanced/index.rst b/docs/user-guide/advanced/index.rst new file mode 100644 index 0000000..65ce992 --- /dev/null +++ b/docs/user-guide/advanced/index.rst @@ -0,0 +1,14 @@ +######## +Advanced +######## + +This section covers advanced topics that are useful for developers who want to +extend PyDOM's functionality and customize the way components are rendered. + +.. toctree:: + :maxdepth: 2 + :hidden: + + context + rendering + transformers/index \ No newline at end of file diff --git a/docs/user-guide/advanced/rendering.rst b/docs/user-guide/advanced/rendering.rst new file mode 100644 index 0000000..faff9d7 --- /dev/null +++ b/docs/user-guide/advanced/rendering.rst @@ -0,0 +1,79 @@ +.. _rendering: + +######### +Rendering +######### + +When PyDOM renders a component or an element, it does so in steps. + +1. **Initialization** + + In this step, the render process initializes the :class:`RenderState ` object. + +2. **Normalization** + + Then, the renderer will recursively walk through the component tree and normalize it to a tree of :class:`TreeNode `. + At this step, the renderer also applies the property transformers. + +3. **Post-Render Transformation** + + After the tree is generated, it is passed through all the post-renderers that are registered in the current context. + The post-renderers can modify the tree in any way they want, as long as the content can be rendered by the final renderer. + +4. **Rendering** + + Finally, the tree is rendered to the target format (HTML, JSON, etc.). + + +.. note:: + Currently, only HTML and JSON rendering are supported. + + +.. _render-state: + +Render State +############ + +The ``RenderState`` object is used to store the state of the rendering process. +It allows property transformers to pass information to the post-render transformers. + +The ``RenderState`` object has the following attributes: + +1. ``root``: The original renderable object that was passed to the renderer. +2. ``render_target``: A string representing the target format of the rendering process. +3. ``custom_data``: A dictionary that can be used to store custom data. + + +.. _accessing-render-state: + +Accessing Render State +####################### + + +The render state can be accessed in the property transformers and post-render transformers by using the ``RenderState`` as a type annotation. + +.. code-block:: python + :caption: Accessing the render state in property transformers and post-render transformers + + from pydom.rendering.render_state import RenderState + + def my_property_transformer(key: str, value: Any, element: ElementNode, render_state: RenderState) -> None: + # render_state contains the render state object + + def my_post_render_transformer(root: ElementNode, render_state: RenderState) -> None: + # render_state contains the render state object + + +To store custom data in the render state, you can use the ``custom_data`` attribute of the render state object. +Simply set the desired key to the value you want to store. + +.. important:: + To avoid conflicts with other transformers, it is recommended to use a unique key for the custom data. + You can prefix the key with the name of your transformer to make it unique. + + For example, if you have a transformer named ``my_transformer``, you can store custom data like this: + + .. code-block:: python + :caption: Storing custom data in the render state + + render_state.custom_data["my_transformer.custom_data"] = "My custom data" diff --git a/docs/user-guide/advanced/transformers/index.rst b/docs/user-guide/advanced/transformers/index.rst new file mode 100644 index 0000000..34ac486 --- /dev/null +++ b/docs/user-guide/advanced/transformers/index.rst @@ -0,0 +1,18 @@ +.. _transformers: + +############ +Transformers +############ + +Transformers are a powerful feature of PyDOM that allow you to customize the way elements are rendered. + +There are two types of transformers in PyDOM: + +- :ref:`property-transformers`: Used to transform the properties of elements. +- :ref:`post-render-transformers`: Used to transform the entire HTML content after it is rendered. + +.. toctree:: + :hidden: + + property-transformers + post-render-transformers diff --git a/docs/user-guide/advanced/transformers/post-render-transformers.rst b/docs/user-guide/advanced/transformers/post-render-transformers.rst new file mode 100644 index 0000000..f8cad73 --- /dev/null +++ b/docs/user-guide/advanced/transformers/post-render-transformers.rst @@ -0,0 +1,101 @@ +.. _post-render-transformers: + +######################## +Post-Render Transformers +######################## + +Post-render transformers are used to transform the entire HTML content after it is rendered. + +Like property transformers, post-render transformers can be function or class-based. + +Function Based Post-Render Transformers +####################################### + +The function-based transformers are simple functions that take the root element and render state as arguments. + +After the function is defined, you can use the :func:`post_render_transformer ` decorator to register the transformer. + +The following example demonstrates how to use a post-render transformer to add the CSS from the :ref:`property transformer ` to the HTML content: + +.. code-block:: python + :caption: Using a post-render transformer to add the CSS from the property transformer to the HTML content + + from pydom.rendering.transformers import post_render_transformer + + from pydom.rendering.render_state import RenderState + from pydom.rendering.tree.nodes import ElementNode + + + @post_render_transformer() + def add_css_to_html(root: ElementNode, render_state: RenderState): + if "my_transformer.css_string" not in render_state.custom_data: + return + + root.get_by_tag("head").append( + ElementNode( + tag_name="style", + children=[render_state.custom_data["my_transformer.css_string"]] + ) + ) + +Class Based Post-Render Transformers +#################################### + +The class-based transformers are classes that inherit from the :class:`PostRenderTransformer ` + +There are a few advantages to using class-based transformers: + +- You can store state in the transformer class. +- You can access the transformer instance from the context after the transformer is registered. + +The following example demonstrates how to use a post-render transformer to add the CSS from the :ref:`property transformer ` +to the HTML content: + +.. code-block:: python + :caption: Class-based post-render transformer to add the CSS from the property transformer to the HTML content + + from pydom.rendering.transformers import PostRenderTransformer + + from pydom.rendering.render_state import RenderState + from pydom.rendering.tree.nodes import ElementNode + + + class AddCssToHtml(PostRenderTransformer): + def transform(self, root: ElementNode, render_state: RenderState): + if "my_transformer.css_string" not in render_state.custom_data: + return + + root.get_by_tag("head").append( + ElementNode( + tag_name="style", + children=[render_state.custom_data["my_transformer.css_string"]] + ) + ) + + +Registering Post-Render Transformers +#################################### + +To register a post-render transformer, you need to add it to the context. + +This can be done in two ways: + +1. By using the :meth:`add_post_render_transformer ` method of the context. +2. By using the :func:`post_render_transformer ` decorator - this applied only to function-based transformers. + +The following code demonstrates how to register class-based and function-based post-render transformers: + +.. code-block:: python + :caption: Registering the post-render transformer + + from pydom import get_context + + get_context().add_post_render_transformer(add_css_to_html) + get_context().add_post_render_transformer(AddCssToHtml()) + +When adding a class-based transformer make sure to instantiate the class before adding it to the context. + +Both ``add_post_render_transformer`` and the decorator take optional ``before`` and ``after`` arguments that specifies +the order in which the transformers should be applied. +This can be useful when you need to ensure that a transformer is applied before or after another transformer. +Both arguments accept a list of post-render transformer types. Passing a function-based transformer inside the list will not take effect. diff --git a/docs/user-guide/advanced/transformers/property-transformers.rst b/docs/user-guide/advanced/transformers/property-transformers.rst new file mode 100644 index 0000000..437badd --- /dev/null +++ b/docs/user-guide/advanced/transformers/property-transformers.rst @@ -0,0 +1,111 @@ +.. _property-transformers: + +##################### +Property Transformers +##################### + +Property transformers are used to transform a specific attribute of an element. +For example, you can use a property transformer to give a class to each element that has inline styles. + +.. note:: + Property transformers are only available for elements and not for components. + This is because property transformers are applied after the whole component is rendered to a normalized tree. + +Property Transformers can be function or class-based. + +Function Based Property Transformers +#################################### + +The function-based transformers are simple functions that take the property name, value, element, and render state as arguments. + +After the function is defined, you can use the :func:`property_transformer ` decorator to register the transformer. +The decorator takes the property name as an argument or a :type:`matcher function ` that returns ``True`` if the transformer should be applied. + +The following example demonstrates how to use a property transformer to give a class to each element that has inline styles. + +.. code-block:: python + :caption: Property transformer to give a class to each element that has inline styles + :name: property-transformer-example + + from pydom import Component, Div, Span + from pydom.rendering.transformers import property_transformer + from pydom.rendering.render_state import RenderState + from pydom.rendering.tree.nodes import ContextNode + + @property_transformer("style") + def add_class_to_inline_styles(key, value, element: ContextNode, render_state: RenderState): + class_name = uuid4().hex + if value: + element.props["class"] = f"{class_name} {element.props.get('class', '')}" + + render_state.custom_data["my_transformer.css_string"] = render_state.custom_data.get("my_transformer.css_string", "") + f".{class_name} {{{value}}}" + del element.props[key] + + +Class Based Property Transformers +################################# + +The class-based transformers are classes that inherit from the :class:`PropertyTransformer ` +class and implement the ``match`` and ``transform`` methods. + +The ``match`` method should return ``True`` if the transformer should be applied. + +The ``transform`` method takes the property name, value, element, and render state as arguments. + +There are a few advantages to using class-based transformers: + +- You can store state in the transformer class. +- You can access the transformer instance from the context after the transformer is registered. + +Like the :ref:`previous example `, the following example demonstrates how to use a class-based property transformer to give a class to each element that has inline styles. + +.. code-block:: python + :caption: Class-based property transformer to give a class to each element that has inline styles + + from pydom import Component, Div, Span + from pydom.rendering.transformers import PropertyTransformer + from pydom.rendering.tree.nodes import ContextNode + from pydom.rendering.render_state import RenderState + + class AddClassToInlineStyles(PropertyTransformer): + def match(self, key, value, element: ContextNode) -> bool: + return key == "style" + + def transform(self, key, value, element: ContextNode, render_state: RenderState) -> None: + class_name = uuid4().hex + if value: + element.props["class"] = f"{class_name} {element.props.get('class', '')}" + + render_state.custom_data["my_transformer.css_string"] = render_state.custom_data.get("my_transformer.css_string", "") + f".{class_name} {{{value}}}" + del element.props[key] + +.. note:: + Property transformers can access injected properties from the context. + + +Registering Property Transformers +################################# + +To register a property transformer, you need to add it to the context. + +This can be done in two ways: + +1. By using the :meth:`add_prop_transformer ` method of the context. +2. By using the :func:`property_transformer ` decorator - this applied only to function-based transformers. + +The following code demonstrates how to register the property transformer from the :ref:`previous example `: + +.. code-block:: python + :caption: Registering the property transformer + + from pydom import get_context + + get_context().add_prop_transformer(add_class_to_inline_styles) + get_context().add_prop_transformer(AddClassToInlineStyles()) + +When adding a class-based transformer make sure to instantiate the class before adding it to the context. + +Both ``add_prop_transformer`` and the decorator take optional ``before`` and ``after`` arguments that specifies +the order in which the transformers should be applied. +This can be useful when you need to ensure that a transformer is applied before or after another transformer. +Both arguments accept a list of transformer types. Passing a function-based transformer inside the list will not take effect. diff --git a/docs/user-guide/basics/index.rst b/docs/user-guide/basics/index.rst new file mode 100644 index 0000000..9632185 --- /dev/null +++ b/docs/user-guide/basics/index.rst @@ -0,0 +1,17 @@ +###### +Basics +###### + +This section covers the basics of PyDOM, including the syntax and rendering components. + +PyDOM is very minimal but powerful, it only requires understanding 2 concepts to create complex applications: +Creating components and rendering them. + +After reading this section, you should be able to create almost any kind of application using PyDOM. + +.. toctree:: + :maxdepth: 1 + :hidden: + + syntax + rendering-components \ No newline at end of file diff --git a/docs/user-guide/basics/rendering-components.rst b/docs/user-guide/basics/rendering-components.rst new file mode 100644 index 0000000..7effd67 --- /dev/null +++ b/docs/user-guide/basics/rendering-components.rst @@ -0,0 +1,134 @@ +.. _rendering-components: + +#################### +Rendering Components +#################### + +HTML Rendering +############## + +To convert components to the HTML representation, use the :func:`render ` method. +This method returns a string containing the HTML representation of the component. +For example, to render a page with the :ref:`card-component` component, you can use the following code: + +.. code-block:: python + :caption: Rendering the page as HTML + + from pydom import render + from pydom.components import Page + from card import Card + + card = Card(title="Card Title")( + "This is the content of the card" + ) + + html = render(Page(card)) + + print(html) + +This will output the following HTML: + +.. code-block:: html + :caption: HTML render result + + + + + + + +
+
+ Card Title +
+
+ This is the content of the card +
+
+ + + +The ``render`` method can pretty-print the HTML by setting the ``pretty`` parameter to ``True``. + +JSON Rendering +############## + +To convert components to the JSON representation, use the ``to_dict`` method from ``pydom.renderer``. +This method returns a dict containing the JSON representation of the component. + +.. code-block:: python + :caption: Rendering the page as JSON + + from json import dumps + from pydom.renderer import to_dict + from card import Card + + card = Card(title="Card Title")( + "This is the content of the card" + ) + + json = to_dict(card) + + print(dumps(json)) + +This will output the following JSON: + +.. code-block:: json + :caption: JSON representation of the page + + { + "type": "div", + "children": [ + { + "type": "div", + "children": [ + "Card Title" + ], + "props": { + "class": "card-title" + } + }, + { + "type": "div", + "children": [ + "This is the content of the card" + ], + "props": { + "class": "card-content" + } + } + ], + "props": { + "class": "card" + } + } + +This dict can be used to render components on the client side after the initial server-side rendering. + +It also corresponds to React's virtual DOM representation of the component. + +.. _props-rendering: + +Props Rendering +############### + +When rendering components, some props names are converted to another name in the HTML representation. +For example, the ``classes`` prop is converted to the ``class`` attribute in the HTML representation. + +The full list of prop names and their corresponding HTML attributes is as follows: + +- ``classes`` -> ``class`` +- ``html_for`` -> ``for`` +- ``access_key`` -> ``accesskey`` +- ``content_editable`` -> ``contenteditable`` +- ``cross_origin`` -> ``crossorigin`` +- ``tab_index`` -> ``tabindex`` +- ``use_map`` -> ``usemap`` +- ``col_span`` -> ``colspan`` +- ``row_span`` -> ``rowspan`` +- ``char_set`` -> ``charset`` + +By default, all props with underscore in their name and a value of :py:type:`~pydom.types.Primitive` type, +are converted to HTML attributes with dash instead of underscore. + +To configure this behavior check out the :ref:`property-transformers` page. diff --git a/docs/user-guide/basics/syntax.rst b/docs/user-guide/basics/syntax.rst new file mode 100644 index 0000000..a952f98 --- /dev/null +++ b/docs/user-guide/basics/syntax.rst @@ -0,0 +1,120 @@ +.. _syntax: + +###### +Syntax +###### + +PyDOM provides multiple syntaxes for creating instances of components. + +It is recommended to pick one syntax and sticking to it, as mixing syntaxes on different components can lead to confusion. + +Using the card component as an example, we will show the different syntaxes. + +.. code-block:: python + :caption: Card component + + # card.py + + from pydom import Component, Div + + class Card(Component): + def __init__(self, title=None): + self.title = title + + def render(self): + return Div(classes="card")( + self.title and Div(classes="card-title")( + self.title + ), + Div(classes="card-content")( + *self.children + ) + ) + +Which will result in the following HTML when passing the title "Card Title" and the content "Hello, World!": + +.. code-block:: html + +
+
Card Title
+
Hello, World!
+
+ +Pythonic Syntax +############### + +Pass the children as positional arguments, and the props as keyword arguments. + +This is called "Pythonic" because it is similar to how we write Python code. + +.. code-block:: python + :caption: Pythonic Syntax + + from pydom import Div, render + from card import Card + + render( + Card( + Div( # This is the Card's child + "Hello, World!", # This is the content of the Div + id="card-content" + ), + title="Card Title" + ) + ) + +HTML Syntax +########### + +Start with the props as keyword arguments, then, pass the children as call arguments. + +This is similar to how we write HTML tags, with the props as attributes and the children as the tag's content. + +.. code-block:: python + :caption: HTML Syntax + + from pydom import Div, render + from card import Card + + render( + Card(title="Card Title")( + Div(id="card-content")( # This is the Card's child + "Hello, World!" # This is the content of the Div + ) + ) + ) + +Flutter Syntax +############## + +Pass the children as the keyword argument "children", along with the props. + +This is similar to how we write Flutter widgets. + +.. code-block:: python + :caption: Flutter Syntax + + from pydom import Div, render + from card import Card + + render( + Card( + title="Card Title", + children=[Div( # This is the Card's child + id="card-content". + children=["Hello, World!"] # This is the content of the Div + )] + ) + ) + +.. note:: + + When using the Flutter syntax, children must be passed as an iterable. + +.. important:: + Using multiple syntaxes on the same component will not add the children together, each syntax will + override the other, so stick to one syntax per component. + + The priority of the syntaxes is ``HTML`` > ``Flutter`` > ``Pythonic``, which means that if you pass + children as call arguments, the children passed as keyword arguments will be ignored, and if you + pass children as a keyword argument, the children passed as positional arguments will be ignored. \ No newline at end of file diff --git a/docs/user-guide/components/base-component.rst b/docs/user-guide/components/base-component.rst new file mode 100644 index 0000000..c1992cd --- /dev/null +++ b/docs/user-guide/components/base-component.rst @@ -0,0 +1,136 @@ +.. _base-component: + +############## +Base Component +############## + +The :class:`Component ` class is an abstract class that provides a base implementation for any PyDOM component. +It provides a ``children`` property that is a tuple of the components that are contained within the component. + +.. note:: + The ``children`` property is not a list, but a tuple. This means that it is immutable and cannot be modified directly. + + It is possible to modify the children property by creating a new tuple and assigning it to the children property. + +.. code-block:: python + :caption: Card example + :name: card-component + + # card.py + + from pydom import Component, Div + + class Card(Component): + def __init__(self, title=None): + self.title = title + + def render(self): + return Div(classes="card")( + self.title and Div(classes="card-title")( + self.title + ), + Div(classes="card-content")( + *self.children + ) + ) + +The ``Component`` class is responsible for creating and initializing the children property, +which means it is not passed as a parameter to the subclass's __init__ function, but it is accessible inside it. + +.. code-block:: python + :caption: Children property access in __init__ + + from pydom import Component, Div + + class Card(Component): + def __init__(self, title=None): + self.number_of_children = len(self.children) # self.children is accessible in __init__ + ... + + def render(self): + ... + +Props +##### + +Components can have props which are passed as kwargs to the ``__init__`` method of the component. +The props are handled inside the ``__init__`` method and can be used to customize the component. + +.. important:: + Props has to be passed as keyword arguments to the component. + Positional arguments are handled as children. + +The most common way of handling props is to store them as instance variables and use them in the ``render`` method. + +.. code-block:: python + :caption: Handling props + + from pydom import Component + + class AppButton(Component): + def __init__(self, type: str): + self.style = Style(background_color=f"var(--color-{type})") + + def render(self): + return Button(style=self.style)( + *self.children + ) + + button = AppButton(type="primary")( + "Click me" + ) + + +It is possible to mark the component as ``dataclass`` which will automatically handle the props, +create the ``__init__`` method with the correct signature and store the props as instance variables. + +.. code-block:: python + :caption: Using dataclass to handle props + + from dataclasses import dataclass + + from pydom import Component + + @dataclass + class AppButton(Component): + color: str + + def render(self): + return Button(style=Style(background_color=f"var(--color-{self.color}"))( + *self.children + ) + + button = AppButton(color="primary")( + "Click me" + ) + +Children +######## + +In PyDOM, children are the components or elements that are nested inside another component or element. + +To add children to a component, pass them as positional arguments, use the ``children`` prop or call the +component with the children as arguments. (See :ref:`syntax`) + +.. code-block:: python + :caption: Adding children to a component + + from pydom import Component, Div + + class Card(Component): + def __init__(self, title=None): + self.title = title + + def render(self): + return Div(classes="card")( + Div(classes="card-header")( + self.title + ), + Div(classes="card-body")( + *self.children + ) + ) + + card = Card(title="Card title")( + "Card content" + ) diff --git a/docs/user-guide/components/fragment.rst b/docs/user-guide/components/fragment.rst new file mode 100644 index 0000000..6a5b19f --- /dev/null +++ b/docs/user-guide/components/fragment.rst @@ -0,0 +1,25 @@ +.. _fragment: + +######## +Fragment +######## + +``Fragment`` is an empty element that can be used to wrap a list of elements. It is a common pattern +in PyDOM to return multiple elements from a component without adding an extra node to the DOM. + +.. code-block:: python + :caption: Using Fragment + + from pydom import Fragment, Component, Div + + class MyComponent(Component): + def render(self): + return Fragment( + Div("Hello"), + Div("World") + ) + +.. note:: + + Even though it's under the :ref:`components` section, ``Fragment`` is not a component itself but an element, + which means transformers can be applied to it. \ No newline at end of file diff --git a/docs/user-guide/components/index.rst b/docs/user-guide/components/index.rst new file mode 100644 index 0000000..3055753 --- /dev/null +++ b/docs/user-guide/components/index.rst @@ -0,0 +1,38 @@ +.. _components: + +########## +Components +########## + +In HTML, there are tags like ``div``, ``span``, ``input``, ``button``, which describe the structure of the UI. + +Elements are represented by classes like :class:`Div `, :class:`Span `, +:class:`Input `, :class:`Button `, which are subclasses of the +:class:`Element ` class. + +Components are subclasses of the base :class:`Component ` class and are used to create reusable +and more complex UI structures. + +For example, an ``AppButton`` component can be created which can be used throughout the application. + +To create a component, create a class which inherits from ``Component`` class and define the +``render`` method which returns the ``Element`` or ``Component`` which will be rendered. + +The :meth:`render ` method can return a single ``Element``, ``Component`` +or one of the :type:`primitive ` types: + +- str +- int +- float +- bool +- None + +Except for the actual return value which can be only single ``Element``, ``Component`` or one of the primitive types, components and elements can have any number of children. +To return multiple components from the ``render`` method, use the :ref:`fragment` component. + +.. toctree:: + :hidden: + + base-component + page + fragment \ No newline at end of file diff --git a/docs/user-guide/components/page.rst b/docs/user-guide/components/page.rst new file mode 100644 index 0000000..c6842f8 --- /dev/null +++ b/docs/user-guide/components/page.rst @@ -0,0 +1,122 @@ +.. _page: + +#### +Page +#### + +The page component is a the top-level component that represents a web page. +It is a container that holds all the other components that will be rendered on the page. + +The default page component includes the elements for the following HTML structure: + +.. code-block:: html + :caption: Default page structure + + + + + + + + <!-- The page title property --> + + + + + + + +Usage +##### + +The page component can be used to create a new page by passing the following properties: + +- ``title``: The page's title +- ``html_props``: The props to insert inside the ``html`` tag +- ``head_props``: The props to insert inside the ``head`` tag +- ``body_props``: The props to insert inside the ``body`` tag + +.. code-block:: python + :caption: Creating a new page + + from pydom import Div, P + from pydom.page import Page + + + def my_awesome_page(): + return Page(title="My awesome page")( + Div(classes="container mt-5")( + Div(classes="text-center p-4 rounded")( + Div(classes="h-1")( + "Awesome page" + ), + P(classes="lead")( + "Welcome to PyDOM" + ) + ) + ) + ) + + +Custom Pages +############ + +You can create custom pages by extending the page component and overriding the default ``head`` and ``body`` methods. + +.. code-block:: python + :caption: Creating a custom page component + + from pydom import Div, Link + from pydom.page import Page + + + class MyPage(Page): + def head(self): + return ( + *super().head(), # Include the default head components + Link( + rel="stylesheet", + href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" + ) + ) + + def body(self): + return ( + Div(id="root")( # Wrap all the page children in a div with id root + *self.children + ) + ) + + + def my_awesome_page(): + return MyPage(title="My awesome page")( + Div(classes="container mt-5")( + Div(classes="text-center p-4 rounded")( + Div(classes="h-1")( + "Awesome page" + ), + P(classes="lead")( + "Welcome to PyDOM" + ) + ) + ) + ) + +.. note:: + Both ``head`` and ``body`` methods should return an iterable of components, elements or primitives that will + be rendered inside the ```` and ```` tags respectively. + +API Reference +############# + ++------------+--------+---------------------------------------------+----------------------+ +| Name | Type | Description | Default value | ++============+========+=============================================+======================+ +| title | string | The page's title | ``None`` | ++------------+--------+---------------------------------------------+----------------------+ +| html_props | dict | The props to insert inside the ``html`` tag | ``{ "lang": "en" }`` | ++------------+--------+---------------------------------------------+----------------------+ +| head_props | dict | The props to insert inside the ``head`` tag | ``{}`` | ++------------+--------+---------------------------------------------+----------------------+ +| body_props | dict | The props to insert inside the ``body`` tag | ``{ "dir": "ltr" }`` | ++------------+--------+---------------------------------------------+----------------------+ diff --git a/docs/user-guide/index.rst b/docs/user-guide/index.rst new file mode 100644 index 0000000..315c685 --- /dev/null +++ b/docs/user-guide/index.rst @@ -0,0 +1,20 @@ +########## +User Guide +########## + +This section of the documentation is intended to provide a comprehensive guide to using the `PyDOM` library. +The guide will go through all of PyDOM's features and provide examples on how to use them. + +Each section builds upon the previous ones while keeping topics distinct, +allowing you to navigate directly to any specific section to address your API needs. + + +.. toctree:: + :maxdepth: 2 + :hidden: + + installation + basics/index + components/index + styling/index + advanced/index diff --git a/docs/user-guide/installation.rst b/docs/user-guide/installation.rst new file mode 100644 index 0000000..6faca3f --- /dev/null +++ b/docs/user-guide/installation.rst @@ -0,0 +1,17 @@ +############ +Installation +############ + +To install PyDOM, you can use pip to install the package from the Python Package Index (PyPI). + +.. code-block:: bash + + $ pip install pydom + +This will install the PyDOM package and all its dependencies. + +Once you have installed PyDOM, you can start using it in your projects. + +.. note:: + PyDOM requires Python 3.8 or higher. + diff --git a/docs/user-guide/styling/css-modules.rst b/docs/user-guide/styling/css-modules.rst new file mode 100644 index 0000000..47d103c --- /dev/null +++ b/docs/user-guide/styling/css-modules.rst @@ -0,0 +1,63 @@ +.. _css-modules: + +########### +CSS Modules +########### + +CSS Modules are a way to write CSS that's scoped to a single css file, rather than globally. +It's a way to write modular CSS that won't conflict with other styles in your app, but still has meaningful class names. + +More on CSS Modules can be found in their `GitHub `_ documentation. + +Usage +##### + +To use CSS Modules in a component, import the ``CSS`` class from the ``pydom.styling`` module. +Then, use the ``CSS`` to import your css files. + +.. code-block:: css + + /* card.css */ + + .card { + background-color: white; + border: 1px solid black; + border-radius: 5px; + padding: 10px; + } + + +.. code-block:: python + :caption: Using CSS Modules in a component + + from pydom.styling import CSS + + styles = CSS.module("./card.css") + + class MyComponent(Component): + def render(self, css): + return Div(classes=styles.card)( + "Hello, world!" + ) + +This will generate a class name that is unique to this css file, and apply the styles to that class name. +This way, you can be sure that your styles won't conflict with other styles in your app. + +When importing the same css file in multiple components, the class name will be the same across all components. + +CSS File Lookup +############### + +When importing a css file, unless the path starts with a ``./``, PyDOM will look for the css file in +the root folder for CSS Modules. +By default, the root folder for CSS Modules is the current working directory. +You can change the root folder by calling the ``CSS.set_root_folder`` method. + +.. code-block:: python + :caption: Changing the root folder for CSS Modules + + from pydom.styling import CSS + + CSS.set_root_folder("./styles") + + styles = CSS.module("card.css") diff --git a/docs/user-guide/styling/index.rst b/docs/user-guide/styling/index.rst new file mode 100644 index 0000000..8428c63 --- /dev/null +++ b/docs/user-guide/styling/index.rst @@ -0,0 +1,19 @@ +.. _styling: + +####### +Styling +####### + +.. toctree:: + :glob: + :hidden: + + style-sheet + css-modules + +Styling in PyDOM can be done in multiple ways. + +One way is to use the :ref:`StyleSheet ` class. + +Another way is to use :ref:`CSS Modules `. +More on CSS Modules can be found in the CSS Modules `GitHub `_ documentation. diff --git a/docs/user-guide/styling/style-sheet.rst b/docs/user-guide/styling/style-sheet.rst new file mode 100644 index 0000000..3381dc0 --- /dev/null +++ b/docs/user-guide/styling/style-sheet.rst @@ -0,0 +1,51 @@ +.. _style-sheet: + +########## +StyleSheet +########## + +The :class:`StyleSheet ` class is used to create reusable styles for components. +It is a dictionary-like object that can be used to store CSS properties and values. + +Usage +##### + +To create a new style sheet, create a new instance of the ``StyleSheet`` class from ``pydom.styling``. + +.. code-block:: python + :caption: Creating a style object + + from pydom.styling import StyleSheet + + style = StyleSheet( + background_color="red", + color="white" + ) + +This will create a style object with the properties ``background_color`` and ``color``. + +To use the style object, pass it as the ``style`` prop to the component. + +.. code-block:: python + :caption: Using a style object + + from pydom import Component, Div + + class App(Component): + def render(self): + return Div(style=style)( + "Hello, world!" + ) + +This will create an inline style with the properties from the style object. + +.. code-block:: html + :caption: Style object output + +
Hello, world!
+ +Properties +########## + +The ``StyleSheet`` class has all the properties from the CSS specification. +The only difference is that the properties are written in snake_case instead of kebab-case. \ No newline at end of file diff --git a/examples/htmx/README.md b/examples/htmx/README.md new file mode 100644 index 0000000..bca109c --- /dev/null +++ b/examples/htmx/README.md @@ -0,0 +1,139 @@ +# Pydom + HTMX + +A recipe to integrate [HTMX](https://htmx.org) with Pydom. + +## Minimal requirements + +To use HTMX with pydom, there are few requirements: +- Load HTMX library in your HTML page. +- Add transformers for HTMX attributes. +- (Optional) Add HTMX extensions: + - Load the extension script in the head of the page. + - Add transformers for the extension attributes (if needed). + +### Quick start + +Under [utils/htmx_runtime.py](utils/htmx_runtime.py) you can find utilities for simple integration with HTMX. + +The recommended way to use it is just to copy the file to your project and modify it to fit your needs (e.g. add more extensions). + +Usage example: + +```python +import pydom as d +from pydom.page import Page +from pydom.context.context import get_context + +from utils import htmx_runtime as htmx + +# Optional: HTMX Extensions to be registered +HTMX_EXTENSIONS: list[htmx.HTMXExtension] = [ + htmx.HTMXSSEExtension(), + htmx.HTMXClassToolsExtension(), +] + +HTMX = htmx.HTMX() + +ctx = get_context() +htmx.setup_htmx_transformers(ctx, + # Optional: HTMX Extensions to be registered + extensions=HTMX_EXTENSIONS) + + +class BasePage(Page): + def __init__(self, *args, **kwargs): + super().__init__( + *args, + body_props=dict( + # Put the class-tools extension in the body + hx_ext=htmx.HTMXClassToolsExtension.name, + ), + **kwargs, + ) + + def head(self): + yield HTMX.script() + for ext in HTMX_EXTENSIONS: + yield ext.script() + + +# That's it! Now you can use HTMX attributes in your components +def MyComponent(): + return d.Div( + hx_get="/api/data", + hx_trigger="click", + hx_swap="outerHTML", + )("Click me!") + +``` + +### Manual integration + +```python +from pydom.context.context import PropertyTransformer, get_context + +class MyPage(pydom.page.Page): + def head(self): + yield pydom.Script( + src="https://unpkg.com/htmx.org@2.0.2", + integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ", + cross_origin="anonymous", + ) + +class HTMXTransformer(PropertyTransformer): + def match(self, key: str, value): + return key.startswith("hx_") + + def transform(self, key: str, value): + # The full implementation is too long for this example. + # You can find the full implementation in the utils/htmx_runtime.py file. + raise NotImplementedError() + +ctx = get_context() +ctx.add_prop_transformer( + HTMXTransformer(), + before=[HTMLEventsTransformer], +) + +``` + +## Add typing support + +To add typing support and autocomplete for HTMX attributes, download [this script](utils/htmx_runtime.py) you can run the following command: + +```bash +python utils/htmx_typing.py typings +``` + +It will generate the necessary typing files for HTMX attributes, enhancing your development experience with better autocompletion and type checking. + +Modify the generated file to fit your project needs, e.g. add htmx extensions. + + +## Usage notes + +You can differentiate between HTMX requests and regular requests by checking the `HX-Request` header: + +```python +from pydom import d +from pydom.page import Page + +class MyPage(Page): + ... + +@router.get("/") +@inject +async def root(request: Request): + is_htmx = request.headers.get("HX-Request") == "true" + if not is_htmx: + # Regular request, return the full page + wrapper = MyPage() + else: + # HTMX request, return only the content + wrapper = d.Fragment() + + inner = d.Div("Hello, world!") + + return render(wrapper(inner)) + +``` \ No newline at end of file diff --git a/examples/htmx/utils/htmx_runtime.py b/examples/htmx/utils/htmx_runtime.py new file mode 100644 index 0000000..c7aecdd --- /dev/null +++ b/examples/htmx/utils/htmx_runtime.py @@ -0,0 +1,227 @@ +import typing_extensions as t + +from pydom.context.context import Context, PropertyTransformer +from pydom.html import Script, Style +from pydom.types.html import HTMLScriptElement +from pydom.utils.functions import remove_prefix + +T = t.TypeVar("T") + + +class HTMXTransformer(PropertyTransformer): + NORMAL_KEYS = { + "hx_get": "hx-get", + "hx_post": "hx-post", + "hx_push_url": "hx-push-url", + "hx_select": "hx-select", + "hx_select_oob": "hx-select-oob", + "hx_swap": "hx-swap", + "hx_swap_oob": "hx-swap-oob", + "hx_target": "hx-target", + "hx_trigger": "hx-trigger", + "hx_vals": "hx-vals", + "hx_boost": "hx-boost", + "hx_confirm": "hx-confirm", + "hx_delete": "hx-delete", + "hx_disable": "hx-disable", + "hx_disabled_elt": "hx-disabled-elt", + "hx_disinherit": "hx-disinherit", + "hx_encoding": "hx-encoding", + "hx_ext": "hx-ext", + "hx_headers": "hx-headers", + "hx_history": "hx-history", + "hx_history_elt": "hx-history-elt", + "hx_include": "hx-include", + "hx_indicator": "hx-indicator", + "hx_inherit": "hx-inherit", + "hx_params": "hx-params", + "hx_patch": "hx-patch", + "hx_preserve": "hx-preserve", + "hx_prompt": "hx-prompt", + "hx_put": "hx-put", + "hx_replace_url": "hx-replace-url", + "hx_request": "hx-request", + "hx_sync": "hx-sync", + "hx_validate": "hx-validate", + "hx_vars": "hx-vars", + } + + def match(self, key: str, value): + return key.startswith("hx_") + + def transform(self, key: str, value, element): + if key in self.NORMAL_KEYS: + element.props[self.NORMAL_KEYS[key]] = value + del element.props[key] + + # hx-on:* + elif key.startswith("hx_on_"): + if key.startswith("hx_on_htmx_"): + # Special case for htmx events: hx-on:htmx:* + prefix = "hx-on:htmx:" + event = remove_prefix(key, "hx_on_htmx_") + + elif key.startswith("hx_on__"): + # Special case for htmx events: hx-on::* + prefix = "hx-on::" + event = remove_prefix(key, "hx_on__") + + else: # key.startswith("hx_on_") + # regular events: hx-on:* + prefix = "hx-on:" + event = remove_prefix(key, "hx_on_") + + if "__" in event: + # some events uses : as a separator, in python we use __ to indicate that + event = event.replace("__", ":") + + event = event.replace("_", "-") + + new_key = f"{prefix}{event}" + + element.props[new_key] = value + del element.props[key] + + +def setup_htmx_transformers( + ctx: Context, + extensions: t.Sequence["HTMXExtension"] = (), +) -> Context: + from pydom.context.standard.transformers.html_events_transformer import ( + HTMLEventsTransformer, + ) + + ctx.add_prop_transformer( + HTMXTransformer(), + before=[HTMLEventsTransformer], + ) + + for extension in extensions: + transformer = extension.transformer() + ctx.add_prop_transformer(transformer, before=[HTMXTransformer]) + + return ctx + + +class PartialScript(Script): + def __init__(self, *children: str, **kwargs: t.Unpack["HTMLScriptElement"]): + super().__init__(*children, **kwargs) + + def __call__(self, **more: t.Unpack[HTMLScriptElement]) -> Script: + props_not_in_self: dict = {k: v for k, v in more.items() if k not in self.props} + final_props = {**self.props, **props_not_in_self} + return Script(**final_props) + + +class HTMX: + def __init__(self, version="2.0.2"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx.org@{version}", + integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ", + cross_origin="anonymous", + ) + self.unminified_script = PartialScript( + src=f"https://unpkg.com/htmx.org@{version}/dist/htmx.js", + integrity="sha384-yZq+5izaUBKcRgFbxgkRYwpHhHHCpp5nseXp0MEQ1A4MTWVMnqkmcuFez8x5qfxr", + cross_origin="anonymous", + ) + + +class HTMXExtension(t.Protocol): + name: str + script: PartialScript + mapping: t.Dict[str, str] + link: t.Optional[str] = None + + def transformer(self) -> PropertyTransformer: + class Transformer(PropertyTransformer): + def __init__(self, mapping): + self.mapping = mapping + + def match(self, key, _): + return key in self.mapping + + def transform(self, key, value, element): + element.props[self.mapping[key]] = value + del element.props[key] + + return Transformer(self.mapping) + + def render(self): + yield self.script() + + +############################################### +# HTMX Extensions +############################################### + + +class HTMXSSEExtension(HTMXExtension): + name = "sse" + link = "https://github.com/bigskysoftware/htmx-extensions/tree/main/src/sse" + mapping = { + "sse_connect": "hx-sse-connect", + "sse_swap": "hx-sse-swap", + "sse_close": "hx-sse-close", + } + + def __init__(self, version="2.2.2"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx-ext-sse@{version}/sse.js" + ) + + +class HTMXJsonEncExtension(HTMXExtension): + name = "json-enc" + link = "https://github.com/bigskysoftware/htmx-extensions/tree/main/src/json-enc" + mapping = {} + + def __init__(self, version="2.0.1"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx-ext-json-enc@{version}/json-enc.js" + ) + + +class HTMXMultiSwapExtension(HTMXExtension): + name = "multi-swap" + link = "https://github.com/bigskysoftware/htmx-extensions/blob/main/src/multi-swap/README.md" + mapping = {} + + def __init__(self, version="2.0.0"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx-ext-multi-swap@{version}/multi-swap.js" + ) + + +class HTMXLoadingStatesExtension(HTMXExtension): + name = "loading-states" + link = ( + "https://github.com/bigskysoftware/htmx-extensions/tree/main/src/loading-states" + ) + mapping = {} + + def __init__(self, version="2.0.0"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx-ext-loading-states@{version}/loading-states.js" + ) + self.style = Style("[data-loading] { display: none; }") + + def render(self): + yield from super().render() + yield self.style() + + +class HTMXClassToolsExtension(HTMXExtension): + name = "class-tools" + link = "https://github.com/bigskysoftware/htmx-extensions/tree/main/src/class-tools" + mapping = { + 'hx_classes': 'classes', + 'data_classes': 'data-classes', + 'apply_parent_classes': 'apply-parent-classes', + 'data_apply_parent_classes': 'data-apply-parent-classes', + } + + def __init__(self, version="2.0.1"): + self.script = PartialScript( + src=f"https://unpkg.com/htmx-ext-class-tools@{version}/class-tools.js" + ) diff --git a/examples/htmx/utils/htmx_typing.py b/examples/htmx/utils/htmx_typing.py new file mode 100644 index 0000000..9c11629 --- /dev/null +++ b/examples/htmx/utils/htmx_typing.py @@ -0,0 +1,284 @@ +def generate_typing_overrides(root_folder): + from pathlib import Path + + html_element_props_relative_path = Path("pydom/types/html/html_element_props.pyi") + html_element_props_content = f"""\ +# This file is generated by {Path(__file__).name} + +from typing_extensions import TypedDict, Literal +from pydom.types.html.aria_props import AriaProps +from pydom.types.html.html_element import HTMLElement +from pydom.types.html.html_event_props import HTMLEventProps + +SwapValues = Literal[ + "innerHTML", + "outerHTML", + "textContent", + "beforebegin", + "afterbegin", + "beforeend", + "afterend", + "delete", + "none", +] +TargetValues = Literal[ + "this", + "closest ", + "find ", + "next", + "next ", + "previous", + "previous ", +] +EventValues = Literal[ + "click", + "submit", + "change", + # non-standard + "load", + "revealed", + "intersect", +] +ParamsValues = Literal[ + "*", + "none", + "not ", +] + +class HTMXProps(TypedDict, total=False): + hx_get: str + hx_post: str + hx_get: str + hx_post: str + hx_push_url: str | Literal["true", "false"] + hx_select: str + hx_select_oob: str + hx_swap: SwapValues | str + hx_swap_oob: Literal[True] | SwapValues | str + hx_target: TargetValues | str + hx_trigger: EventValues | str + hx_vals: str + hx_boost: Literal[True, "true", "false"] + hx_confirm: str + hx_delete: str + hx_disable: Literal[True] + hx_disabled_elt: TargetValues | str + hx_disinherit: str + hx_encoding: str + hx_ext: str + hx_headers: str + hx_history: Literal["false"] + hx_history_elt: Literal[True] + hx_include: TargetValues | str + hx_indicator: TargetValues | str + hx_inherit: str + hx_params: ParamsValues | str + hx_patch: str + hx_preserve: Literal[True] + hx_prompt: str + hx_put: str + hx_replace_url: Literal["true", "false"] | str + hx_request: str + hx_sync: str + hx_validate: Literal["true", True] + hx_vars: str + + hx_on_htmx_abort: str + hx_on_htmx_after_on_load: str + hx_on_htmx_after_process_node: str + hx_on_htmx_after_request: str + hx_on_htmx_after_settle: str + hx_on_htmx_after_swap: str + hx_on_htmx_before_cleanup_element: str + hx_on_htmx_before_on_load: str + hx_on_htmx_before_process_node: str + hx_on_htmx_before_request: str + hx_on_htmx_before_swap: str + hx_on_htmx_before_send: str + hx_on_htmx_config_request: str + hx_on_htmx_confirm: str + hx_on_htmx_history_cache_error: str + hx_on_htmx_history_cache_miss: str + hx_on_htmx_history_cache_miss_error: str + hx_on_htmx_history_cache_miss_load: str + hx_on_htmx_history_restore: str + hx_on_htmx_before_history_save: str + hx_on_htmx_load: str + hx_on_htmx_no_sse_source_error: str + hx_on_htmx_on_load_error: str + hx_on_htmx_oob_after_swap: str + hx_on_htmx_oob_before_swap: str + hx_on_htmx_oob_error_no_target: str + hx_on_htmx_prompt: str + hx_on_htmx_pushed_into_history: str + hx_on_htmx_response_error: str + hx_on_htmx_send_error: str + hx_on_htmx_sse_error: str + hx_on_htmx_sse_open: str + hx_on_htmx_swap_error: str + hx_on_htmx_target_error: str + hx_on_htmx_timeout: str + hx_on_htmx_validation__validate: str + hx_on_htmx_validation__failed: str + hx_on_htmx_validation__halted: str + hx_on_htmx_xhr__abort: str + hx_on_htmx_xhr__loadend: str + hx_on_htmx_xhr__loadstart: str + hx_on_htmx_xhr__progress: str + + hx_on__abort: str + hx_on__after_on_load: str + hx_on__after_process_node: str + hx_on__after_request: str + hx_on__after_settle: str + hx_on__after_swap: str + hx_on__before_cleanup_element: str + hx_on__before_on_load: str + hx_on__before_process_node: str + hx_on__before_request: str + hx_on__before_swap: str + hx_on__before_send: str + hx_on__config_request: str + hx_on__confirm: str + hx_on__history_cache_error: str + hx_on__history_cache_miss: str + hx_on__history_cache_miss_error: str + hx_on__history_cache_miss_load: str + hx_on__history_restore: str + hx_on__before_history_save: str + hx_on__load: str + hx_on__no_sse_source_error: str + hx_on__on_load_error: str + hx_on__oob_after_swap: str + hx_on__oob_before_swap: str + hx_on__oob_error_no_target: str + hx_on__prompt: str + hx_on__pushed_into_history: str + hx_on__response_error: str + hx_on__send_error: str + hx_on__sse_error: str + hx_on__sse_open: str + hx_on__swap_error: str + hx_on__target_error: str + hx_on__timeout: str + hx_on__validation__validate: str + hx_on__validation__failed: str + hx_on__validation__halted: str + hx_on__xhr__abort: str + hx_on__xhr__loadend: str + hx_on__xhr__loadstart: str + hx_on__xhr__progress: str + + hx_on_abort: str + hx_on_auto_complete: str + hx_on_auto_complete_error: str + hx_on_blur: str + hx_on_cancel: str + hx_on_can_play: str + hx_on_can_play_through: str + hx_on_change: str + hx_on_click: str + hx_on_close: str + hx_on_context_menu: str + hx_on_cue_change: str + hx_on_dbl_click: str + hx_on_drag: str + hx_on_drag_end: str + hx_on_drag_enter: str + hx_on_drag_leave: str + hx_on_drag_over: str + hx_on_drag_start: str + hx_on_drop: str + hx_on_duration_change: str + hx_on_emptied: str + hx_on_ended: str + hx_on_error: str + hx_on_focus: str + hx_on_input: str + hx_on_invalid: str + hx_on_key_down: str + hx_on_key_press: str + hx_on_key_up: str + hx_on_load: str + hx_on_loaded_data: str + hx_on_loaded_metadata: str + hx_on_load_start: str + hx_on_mouse_down: str + hx_on_mouse_enter: str + hx_on_mouse_leave: str + hx_on_mouse_move: str + hx_on_mouse_out: str + hx_on_mouse_over: str + hx_on_mouse_up: str + hx_on_mouse_wheel: str + hx_on_pause: str + hx_on_play: str + hx_on_playing: str + hx_on_progress: str + hx_on_rate_change: str + hx_on_reset: str + hx_on_resize: str + hx_on_scroll: str + hx_on_seeked: str + hx_on_seeking: str + hx_on_select: str + hx_on_show: str + hx_on_sort: str + hx_on_stalled: str + hx_on_submit: str + hx_on_suspend: str + hx_on_time_update: str + hx_on_toggle: str + hx_on_volume_change: str + hx_on_waiting: str + + +class HTMXSSE(TypedDict, total=False): + sse_connect: str + sse_swap: str + sse_close: str + +HTMXClassToolsExtensionAction = Literal["add", "remove", "toggle"] + +class HTMXClassToolsExtension(TypedDict, total=False): + hx_classes: HTMXClassToolsExtensionAction | str + data_classes: HTMXClassToolsExtensionAction | str + apply_parent_classes: HTMXClassToolsExtensionAction | str + data_apply_parent_classes: HTMXClassToolsExtensionAction | str + +# Add more extensions here + +class HTMXExtensions( + HTMXSSE, + HTMXClassToolsExtension, + # Add more extensions here +): + pass + + +# fmt:off +class HTMLElementProps( + HTMLElement, AriaProps, HTMLEventProps, + HTMXProps, HTMXExtensions, +): + pass +# fmt:on + + """ + + html_element_props_file = Path(root_folder) / html_element_props_relative_path + html_element_props_file.parent.mkdir(parents=True, exist_ok=True) + html_element_props_file.write_text(html_element_props_content) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument( + "typings_root_folder", + help="The root folder of the typings", + ) + args = parser.parse_args() + + generate_typing_overrides(args.typings_root_folder) diff --git a/src/pydom/context/context.py b/src/pydom/context/context.py index c9be61c..b4b6cb8 100644 --- a/src/pydom/context/context.py +++ b/src/pydom/context/context.py @@ -1,7 +1,5 @@ from typing import ( Callable, - Any, - Dict, Tuple, TypeVar, Union, @@ -11,7 +9,7 @@ overload, ) -from typing_extensions import ParamSpec, TypeAlias, Concatenate, Self +from typing_extensions import ParamSpec, Self from pydom.errors import Error @@ -23,17 +21,24 @@ PropertyTransformerFunction, ) -from ..utils.injector import Injector +from ..utils.injector import Injector, future_dependency T = TypeVar("T") P = ParamSpec("P") -Feature: TypeAlias = Callable[Concatenate["Context", P], Any] - class Context: def __init__(self) -> None: - self.injector = Injector({Context: self}) + from pydom.rendering.render_state import RenderState + + self.injector: Injector = Injector( + { + Context: self, + RenderState: future_dependency( + "RenderState is only available during rendering" + ), + } + ) self._prop_transformers: List[ Union[ Tuple[PropertyMatcherFunction, PropertyTransformerFunction], @@ -41,22 +46,6 @@ def __init__(self) -> None: ] ] = [] self._post_render_transformers: List[PostRenderTransformerFunction] = [] - self._features: Dict[type, Any] = {} - - def add_feature(self, feature: Feature[P], *args: P.args, **kwargs: P.kwargs): - result = feature(self, *args, **kwargs) - if isinstance(feature, type): - self._features[feature] = result - - def get_feature(self, feature: Type[T]) -> T: - try: - return self._features[feature] - except KeyError: - for cls in self._features: - if issubclass(cls, feature): - return self._features[cls] - - raise @overload def add_prop_transformer( diff --git a/src/pydom/context/standard/transformers/falsy_transformer.py b/src/pydom/context/standard/transformers/falsy_transformer.py index 6b7fb4c..f9f274a 100644 --- a/src/pydom/context/standard/transformers/falsy_transformer.py +++ b/src/pydom/context/standard/transformers/falsy_transformer.py @@ -3,7 +3,7 @@ class FalsyTransformer(PropertyTransformer): def match(self, _, prop_value) -> bool: - return not prop_value + return prop_value is False or prop_value is None def transform(self, prop_name, _, element): del element.props[prop_name] diff --git a/src/pydom/context/standard/transformers/simple_transformer.py b/src/pydom/context/standard/transformers/simple_transformer.py index 1fd9868..883e027 100644 --- a/src/pydom/context/standard/transformers/simple_transformer.py +++ b/src/pydom/context/standard/transformers/simple_transformer.py @@ -2,8 +2,6 @@ _SIMPLE_TRANSFORMERS = { "html_for": "for", - "accept_charset": "accept-charset", - "http_equiv": "http-equiv", "access_key": "accesskey", "content_editable": "contenteditable", "cross_origin": "crossorigin", diff --git a/src/pydom/errors.py b/src/pydom/errors.py index 2a6d62f..7ba4ab7 100644 --- a/src/pydom/errors.py +++ b/src/pydom/errors.py @@ -11,4 +11,12 @@ class RenderError(Error): Raised when an error occurs while rendering an element. """ + ... + + +class DependencyOutOfContextError(Error): + """ + Raised when a dependency is requested that is not in the context. + """ + ... \ No newline at end of file diff --git a/src/pydom/html/script.py b/src/pydom/html/script.py index 390a6ab..60385cf 100644 --- a/src/pydom/html/script.py +++ b/src/pydom/html/script.py @@ -2,8 +2,6 @@ from ..element import Element from ..types.html import HTMLScriptElement -from ..types import ChildType -from ..utils.functions import to_iter class Script(Element): diff --git a/src/pydom/rendering/html.py b/src/pydom/rendering/html.py index 7f9e21e..39aa226 100644 --- a/src/pydom/rendering/html.py +++ b/src/pydom/rendering/html.py @@ -29,9 +29,8 @@ def render_html( """ context = get_context(context) render_state = RenderState(root=element, render_target="html", **render_state_data) - context.injector.add(RenderState, render_state) - - tree = build_tree(element, context=context) + with context.injector.scope({RenderState: lambda: render_state}): + tree = build_tree(element, context=context) return _render_html(tree, pretty=pretty, tab_indent=tab_indent) diff --git a/src/pydom/rendering/json.py b/src/pydom/rendering/json.py index affdea9..9e9daf1 100644 --- a/src/pydom/rendering/json.py +++ b/src/pydom/rendering/json.py @@ -15,9 +15,8 @@ def render_json( ): context = get_context(context) render_state = RenderState(root=element, render_target="json", **render_state_data) - context.injector.add(RenderState, render_state) - - tree = build_tree(element, context=context) + with context.injector.scope({RenderState: lambda: render_state}): + tree = build_tree(element, context=context) return _render_json(tree) diff --git a/src/pydom/rendering/transformers/post_render_transformer.py b/src/pydom/rendering/transformers/post_render_transformer.py index b8c7c4b..c3f126b 100644 --- a/src/pydom/rendering/transformers/post_render_transformer.py +++ b/src/pydom/rendering/transformers/post_render_transformer.py @@ -1,9 +1,15 @@ -from typing import Union +from typing import List, Optional, Type, Union from ...context.context import PostRenderTransformerFunction, get_context, Context +from ...context.transformers import PostRenderTransformer -def post_render_transformer(context: Union[Context, None] = None): +def post_render_transformer( + *, + context: Union[Context, None] = None, + before: Optional[List[Type[PostRenderTransformer]]] = None, + after: Optional[List[Type[PostRenderTransformer]]] = None, +): """ A decorator to register a function as a post-render transformer. @@ -27,7 +33,7 @@ def post_render_transformer(context: Union[Context, None] = None): context = get_context(context) def decorator(func: PostRenderTransformerFunction): - context.add_post_render_transformer(func) + context.add_post_render_transformer(func, before=before, after=after) return func return decorator diff --git a/src/pydom/rendering/transformers/property_transformer.py b/src/pydom/rendering/transformers/property_transformer.py index 620879d..2508418 100644 --- a/src/pydom/rendering/transformers/property_transformer.py +++ b/src/pydom/rendering/transformers/property_transformer.py @@ -1,9 +1,15 @@ -from typing import Any, Callable, Union, Optional +from typing import Any, Callable, List, Optional, Type, Union + +from pydom.context.transformers import PropertyTransformer from ...context.context import PropertyTransformerFunction, Context, get_context def property_transformer( - matcher: Union[Callable[[str, Any], bool], str], context: Optional[Context] = None + matcher: Union[Callable[[str, Any], bool], str], + *, + context: Optional[Context] = None, + before: Optional[List[Type[PropertyTransformer]]] = None, + after: Optional[List[Type[PropertyTransformer]]] = None, ): """ A decorator to register a function as a property transformer. @@ -29,7 +35,7 @@ def property_transformer( context = get_context(context) def decorator(func: PropertyTransformerFunction): - context.add_prop_transformer(matcher, func) + context.add_prop_transformer(matcher, func, before=before, after=after) return func return decorator diff --git a/src/pydom/types/styling/__init__.py b/src/pydom/types/styling/__init__.py new file mode 100644 index 0000000..3926e7e --- /dev/null +++ b/src/pydom/types/styling/__init__.py @@ -0,0 +1 @@ +from .css_properties import * diff --git a/src/pydom/utils/functions.py b/src/pydom/utils/functions.py index e839a43..cb61a06 100644 --- a/src/pydom/utils/functions.py +++ b/src/pydom/utils/functions.py @@ -1,9 +1,12 @@ from string import ascii_letters from uuid import uuid4 -from typing_extensions import TypeGuard +from typing_extensions import TypeGuard, overload, TypeVar, Iterator, Iterable from ..types import Primitive + +_T = TypeVar("_T") + ascii_length = len(ascii_letters) @@ -14,11 +17,18 @@ def random_string(length=12): )[:length] +# fmt: off +@overload +def to_iter(value: Iterable[_T]) -> Iterator[_T]: ... +@overload +def to_iter(value: _T) -> Iterator[_T]: ... + def to_iter(value): try: return iter(value) except TypeError: return iter((value,)) +# fmt: on def is_primitive(value) -> TypeGuard[Primitive]: diff --git a/src/pydom/utils/injector.py b/src/pydom/utils/injector.py index aa84d78..506097c 100644 --- a/src/pydom/utils/injector.py +++ b/src/pydom/utils/injector.py @@ -1,10 +1,23 @@ from contextlib import contextmanager from inspect import signature, iscoroutinefunction from functools import wraps -from typing import Any, Dict, Optional, Type, TypeVar, Union, overload, Callable +from typing import ( + Any, + Dict, + List, + Optional, + Tuple, + Type, + TypeVar, + Union, + overload, + Callable, +) from typing_extensions import TypeAlias +from pydom.errors import DependencyOutOfContextError + T = TypeVar("T") InjectFactory: TypeAlias = Callable[[], T] @@ -34,27 +47,51 @@ def add(self, cls: Type[T], dependency: Union[InjectFactory, T], /) -> None: ) def inject(self, callback: Callable) -> Callable: + keyword_args = self._inject_params(callback) + if iscoroutinefunction(callback): @wraps(callback) async def wrapper(*args, **kwargs): # type: ignore - keyword_args = self.inject_params(callback) - return await callback(*args, **keyword_args, **kwargs) + return await callback( + *args, + **{ + name: self.dependencies[parameter]() + for name, parameter in keyword_args + }, + **kwargs, + ) else: @wraps(callback) def wrapper(*args, **kwargs): - keyword_args = self.inject_params(callback) - return callback(*args, **keyword_args, **kwargs) + return callback( + *args, + **{ + name: self.dependencies[parameter]() + for name, parameter in keyword_args + }, + **kwargs, + ) return wrapper - def inject_params(self, callback: Callable): + @contextmanager + def scope(self, dependencies: Dict[type, InjectFactory]): + original_dependencies = self.dependencies.copy() + self.dependencies.update(dependencies) + + try: + yield + finally: + self.dependencies = original_dependencies + + def _inject_params(self, callback: Callable): signature_ = signature(callback) parameters = signature_.parameters - keyword_args = {} + keyword_args: List[Tuple[str, type]] = [] for name, parameter in parameters.items(): if ( @@ -62,16 +99,13 @@ def inject_params(self, callback: Callable): in [parameter.POSITIONAL_OR_KEYWORD, parameter.KEYWORD_ONLY] and parameter.annotation in self.dependencies ): - keyword_args[name] = self.dependencies[parameter.annotation]() + keyword_args.append((name, parameter.annotation)) return keyword_args - @contextmanager - def scope(self, dependencies: Dict[type, InjectFactory]): - original_dependencies = self.dependencies.copy() - self.dependencies.update(dependencies) - try: - yield - finally: - self.dependencies = original_dependencies +def future_dependency(message: str): + def factory() -> str: + raise DependencyOutOfContextError(message) + + return factory \ No newline at end of file diff --git a/src/pydom/version.py b/src/pydom/version.py index 779733f..63fe829 100644 --- a/src/pydom/version.py +++ b/src/pydom/version.py @@ -1 +1 @@ -version = "0.3.0" +version = "0.3.1" diff --git a/tests/htmx/__init__.py b/tests/htmx/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/htmx/test_htmx.py b/tests/htmx/test_htmx.py new file mode 100644 index 0000000..d267be9 --- /dev/null +++ b/tests/htmx/test_htmx.py @@ -0,0 +1,93 @@ +from typing import List +import pydom as d +from pydom.context.context import get_context +from pydom.page import Page +from examples.htmx.utils.htmx_runtime import ( + HTMX, + HTMXClassToolsExtension, + HTMXExtension, + HTMXSSEExtension, + setup_htmx_transformers, +) + +from ..base import TestCase + +# HTMX Extensions to be registered +HTMX_EXTENSIONS: List[HTMXExtension] = [ + HTMXSSEExtension(), + HTMXClassToolsExtension(), +] + + +class BasePage(Page): + def head(self): + yield HTMX().script() + for ext in HTMX_EXTENSIONS: + yield ext.script() + + +class TestRender(TestCase): + def __init__(self, *args, **kwargs): + context = get_context() + setup_htmx_transformers(context, HTMX_EXTENSIONS) + super().__init__(*args, **kwargs) + + def test_simple(self): + self.assertRender( + d.Div(hx_get="/some/route"), '
' + ) + + def test_hx_boost(self): + self.assertRender(d.Div(hx_boost=True), "
") + self.assertRender(d.Div(hx_boost="true"), '
') + self.assertRender(d.Div(hx_boost="false"), '
') + + def test_hx_on(self): + self.assertRender( + d.Div(hx_on_click="alert('hello')"), + '
', + ) + + def test_hx_on_htmx(self): + self.assertRender( + d.Div(hx_on_htmx_before_request="alert('hello')"), + '
', + ) + + def test_hx_on_htmx_short(self): + self.assertRender( + d.Div(hx_on__before_request="alert('hello')"), + '
', + ) + + def test_sse_extension(self): + self.assertRender( + d.Div(hx_ext=HTMXSSEExtension.name)(d.Div(sse_connect="/sse")), + '
', + ) + + def test_class_tools_extension(self): + self.assertRender( + d.Div(hx_ext=HTMXClassToolsExtension.name)( + d.Div(hx_classes="add foo, remove foo:10s") + ), + '
', + ) + self.assertRender( + d.Div(hx_ext=HTMXClassToolsExtension.name)( + d.Div(data_classes="add foo, remove foo:10s") + ), + '
', + ) + self.assertRender( + d.Div(hx_ext=HTMXClassToolsExtension.name)( + d.Div(apply_parent_classes="add foo, remove foo:10s") + ), + '
', + ) + self.assertRender( + d.Div(hx_ext=HTMXClassToolsExtension.name)( + d.Div(data_apply_parent_classes="add foo, remove foo:10s") + ), + '
', + )