writers package

Submodules

writers.latex_writer module

class pyndoc.writers.latex_writer.LatexWriter[source]

Bases: object

A class for converting an Abstract Syntax Tree (AST) representation of a document into LaTeX format.

print_tree(ast_tree: list[ASTBlock]) None[source]

Prints the LaTeX representation of an AST tree.

Parameters:

ast_tree – List of AST blocks representing the document structure.

write_tree_to_file(filename: str, ast_tree: list[ASTBlock]) None[source]

Writes the LaTeX representation of an AST tree to a file.

Parameters:
  • filename – The name of the file to write to.

  • ast_tree – List of AST blocks representing the document structure.

writers.native_writer module

class pyndoc.writers.native_writer.NativeWriter[source]

Bases: object

print_tree(ast_tree: list[ASTBlock]) None[source]
write_tree_to_file(filename: str, ast_tree: list[ASTBlock]) None[source]

writers.typst_writer module

class pyndoc.writers.typst_writer.TypstWriter[source]

Bases: object

A class for converting an Abstract Syntax Tree (AST) representation of a document into Typst format.

print_tree(ast_tree: list[ASTBlock]) None[source]

Prints the Typst representation of an AST tree.

Parameters:

ast_tree – List of AST blocks representing the document structure.

write_tree_to_file(filename: str, ast_tree: list[ASTBlock]) None[source]

Writes the Typst representation of an AST tree to a file.

Parameters:
  • filename – The name of the file to write to.

  • ast_tree – List of AST blocks representing the document structure.

Module contents