Home Manual Reference Source Test Repository
import File from 'reptar/lib/file.js'
public class | source

File

Constructor Summary

Public Constructor
public

constructor(filePath: string, objectPattern1: {"config": *, "renderer": *})

Member Summary

Public Members
public

An asset processor that will handle rendering this file.

public

Checksum hash of rawContent, for use in seeing if file is different.

public

Template accessible data.

public
public

Absolute destination path of where file should be written.

public

If this File is filtered out of rendering.

public

Frontmatter for this file.

public

Unique ID for this file.

public

Absolute path to file location.

public

Should we skip processing this file, ignoring templates and markdown conversion.

Method Summary

Public Methods
public

render(globalData: Object): string

Render the markdown into HTML.

public

async update()

Update's File's data from the file system.

public

async write(globalData: Object)

Writes a given File object to the file system.

Public Constructors

public constructor(filePath: string, objectPattern1: {"config": *, "renderer": *}) source

Params:

NameTypeAttributeDescription
filePath string
  • optional
  • default:
objectPattern1 {"config": *, "renderer": *}
  • optional
  • default: {}

Public Members

public assetProcessor: function source

An asset processor that will handle rendering this file.

public checksum: string source

Checksum hash of rawContent, for use in seeing if file is different. @example: '50de70409f11f87b430f248daaa94d67'

public data: Object<string, Object> source

Template accessible data.

public defaults: * source

public destination: string source

Absolute destination path of where file should be written.

public filtered: boolean source

If this File is filtered out of rendering. Filter settings are defined in the Config.ConfigFilename file.

public frontmatter: object source

Frontmatter for this file. Can be undefined if a file has no frontmatter.

public id: string source

Unique ID for this file. Right now an alias for the file's path.

public path: string source

Absolute path to file location.

public skipProcessing: boolean source

Should we skip processing this file, ignoring templates and markdown conversion. This is generally only true for images and similar files.

Public Methods

public render(globalData: Object): string source

Render the markdown into HTML. If there is an assetProcessor then we delegate render responsibility to that assetProcessor.

Params:

NameTypeAttributeDescription
globalData Object

Global site metadata.

Return:

string

Rendered content.

public async update() source

Update's File's data from the file system.

public async write(globalData: Object) source

Writes a given File object to the file system.

Params:

NameTypeAttributeDescription
globalData Object

Site wide data.