Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FilesContentInjector

Entry point for executing all directives other than generate-from-files. If i18n is enabled it gets called for each language.

Hierarchy

  • FilesContentInjector

Index

Constructors

constructor

Properties

Private config

config: YassbConfig

Private htmlFiles

htmlFiles: Array<string> = []

List of all files for content injection

Private translator

translator: Translator

Instance of Translator to translate file contents

Methods

make

  • make(lang?: string): void
  • Retrieves the list of files to process with ListFiles and loops them with forEach. The source files are taken from the out folder where they have been copied to by copyPages or have been created there by generate-from-files Determines the destination folder in which the processed file should be copied to.

    Parameters

    • Optional lang: string

    Returns void

Private processFile

  • processFile(file: string, lang: string): void
  • Process each file found in the out dir. For each file delegates the processing of directives to DirectivesParser. From DirectivesParser receives the complete content of the file and the Front Matter data. The Front Matter data is added to the top of the file as a string for later use in post processing. If i18n is enabled the translation is carried out. Finally the existing file in out is overwritten with the new contents.

    Parameters

    • file: string

      the full path on disk to the file being processed.

    • lang: string

      the language being processed if i18n is enabled.

    Returns void

Private setTranslator

  • setTranslator(lang: string): void