Module typesetters.mixins.totext
Text extraction mixin for the typesetter.
Some code in this file comes from SILE's core typesetter.
License: MIT. Copyright (c) The SILE Organization / Simon Cozens et al.
This file is part of re·sil·ient, a set of extensions to SILE.
License: MIT. Copyright (c) 2025 Omikhkeia / Didier Willis
Local Functions
nodesToText (nodes) | Flatten a node list into just its string representation. |
Class typesetter
typesetter:contentToText (content) | Convert a SILE AST to a textual representation. |
Local Functions
- nodesToText (nodes)
-
Flatten a node list into just its string representation.
Parameters:
- nodes table Typeset nodes
Returns:
-
string
Text reconstruction of the nodes
Class typesetter
- typesetter:contentToText (content)
-
Convert a SILE AST to a textual representation.
This is similar to
SU.ast.contentToString()
, but it performs a full typesetting of the content, and then reconstructs the text from the typeset nodes.Parameters:
- content table SILE AST to process
Returns:
-
string
Textual representation of the content