Browse Source

Deprecate transform.py.

katex-socket
Jan Černohorský 1 year ago
parent
commit
b6634ddede
  1. 5
      src/formatitko/transform.py

5
src/formatitko/transform.py

@ -10,10 +10,15 @@ from .command import Command, BlockCommand, InlineCommand
from .command_util import handle_command_define, parse_command from .command_util import handle_command_define, parse_command
from .elements import FQuoted from .elements import FQuoted
import warnings
warnings.warn("The transform function has been deprecated, is left only for reference and will be removed in future commits. TransformProcessor should be used in its place.", DeprecationWarning)
# This is where tha magic happens. This function transforms a single element, # This is where tha magic happens. This function transforms a single element,
# to transform the entire tree, panflute's walk should be used. # to transform the entire tree, panflute's walk should be used.
def transform(e: Element, c: Context) -> Element: def transform(e: Element, c: Context) -> Element:
warnings.warn("The transform function has been deprecated, is left only for reference and will be removed in future commits. TransformProcessor should be used in its place.", DeprecationWarning)
# Determine if this space should be non-breakable. See whitespace.py. # Determine if this space should be non-breakable. See whitespace.py.
if isinstance(e, Whitespace) and bavlna(e, c): if isinstance(e, Whitespace) and bavlna(e, c):
e = NBSP() e = NBSP()

Loading…
Cancel
Save