innoconv.extensions.abstract

Base class for all other extensions.

The AbstractExtension is not meant to be instantiated directly.

class innoconv.extensions.abstract.AbstractExtension(manifest)[source]

Abstract class for extensions.

The class all extensions inherit from. The to-be-implemented methods document the available events that are triggered during the conversion process.

Extension classes should have a _helptext attribute. It is shown in the CLI as a brief summary what the extension accomplishes.

classmethod helptext()[source]

Return a brief summary of what the extension is doing.

start(output_dir, source_dir)[source]

Conversion is about to start.

Parameters:
  • output_dir (str) – Base output directory
  • source_dir (str) – Content source directory
pre_conversion(language)[source]

Conversion of a single language folder is about to start.

Parameters:language (str) – Language that is currently being converted.
pre_process_file(path)[source]

Conversion of a single file is about to start.

Parameters:path (str) – Output path
post_process_file(ast, title)[source]

Conversion of a single file finished. The AST can be modified.

Parameters:
  • ast (List of content nodes) – File content as parsed by pandoc.
  • title (str) – Section title (localized)
post_conversion(language)[source]

Conversion of a single language folder finished.

Parameters:language (str) – Language that is currently being converted.
finish()[source]

Conversion finished.