@unified-latex/unified-latex-util-render-info v1.8.2
unified-latex-util-render-info
What is this?
Functions to help modify the _renderInfo of a unified-latex Abstract Syntax Tree (AST).
When should I use this?
If you want to compare the structure of an AST without position information or extra information
that is kept for pretty-printing, these functions can be used to remove/modify the _renderInfo
of an Ast.Node.
Install
npm install @unified-latex/unified-latex-util-render-infoThis package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js file. To explicitly access the commonjs export, import the .cjs file.
Functions
trimRenderInfo(ast)
Removes any _renderInfo and position tags present in the AST. This
operation is destructive.
function trimRenderInfo<T extends Ast.Ast>(ast: Ast.Ast): T;Parameters
| Param | Type |
|---|---|
| ast | Ast.Ast |
updateRenderInfo(node, renderInfo)
Updates the ._renderInfo property on a node to include
whatever has been supplied to renderInfo. If renderInfo
is null, no update is performed.
This operation mutates node
function updateRenderInfo(
node: Ast.Node | Ast.Argument,
renderInfo: {}
): Ast.Node | Ast.Argument;Parameters
| Param | Type |
|---|---|
| node | Ast.Node \| Ast.Argument |
| renderInfo | {} |
10 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago