Options
All
  • Public
  • Public/Protected
  • All
Menu

Generates a list of file found at a given path in the out folder and passes it to a Renderer

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected config

config: YassbConfig

Full config options

Private dirToScan

dirToScan: string

Public dir to scan to generate the file list

Protected directiveFullString

directiveFullString: string

Directive full string found in the file

Protected fileContents

fileContents: string

File contents there the yassb directive was found

Protected fileFullPath

fileFullPath: string

Full path to the file being processed

Private generatedContent

generatedContent: string

Generated content produced by the renderer

Protected lang

lang: string

Lang being processed

Private options

options: string | Array<unknown> | {}

Options set in the directive

Private renderer

renderer: string

Renderer to generate the HTML to inject

Private source

source: Array<FilePathsForPublicFileList> = []

Array wit the absolute URLs and paths of the files to be passed to the renderer

Static regex

regex: RegExp = /<!--\s*public-file-list\s*=\s*".+"\s* renderer\s*=\s*".+"\s*-->/g

Regex to match the comments to invoke the directive.

Methods

Private callRenderer

  • callRenderer(): void

Private errorNoRenderer

init

Private listFiles

  • listFiles(dir: string): void
  • Lists files at the given folder, searching recursively in sub dirs. Does not rely on ListFiles to avoid an extra forEach loop. Here, if it finds a file, it immediately adds it to the list.

    Parameters

    • dir: string

      path to scan. Because this method calls itself recursively, it can be a subdir of startingPath.

    Returns void

Private makeValuesForSource

  • makeValuesForSource(dir: string, file: string): void
  • Determines the absolutePath and the absolute URL of the file. Done here instead of delegating this to the renderer to make life easiier for renderers.

    Parameters

    • dir: string

      the directory where the file was found.

    • file: string

      the name of the file.

    Returns void

Private setPathAndRenderer

  • setPathAndRenderer(): void