TypeDoc all the thngs

This commit is contained in:
2021-03-25 08:50:13 -05:00
parent 7cb0546b01
commit fad1184afe
52 changed files with 976 additions and 3 deletions

View File

@@ -2,8 +2,12 @@ import {ViewEngine} from "./ViewEngine"
import {Injectable} from "@extollo/di"
import * as pug from "pug"
/**
* Implementation of the ViewEngine class that renders Pug/Jade templates.
*/
@Injectable()
export class PugViewEngine extends ViewEngine {
/** A cache of compiled templates. */
protected compileCache: {[key: string]: ((locals?: pug.LocalsObject) => string)} = {}
public renderString(templateString: string, locals: { [p: string]: any }): string | Promise<string> {
@@ -22,6 +26,10 @@ export class PugViewEngine extends ViewEngine {
return compiled(locals)
}
/**
* Get the object of options passed to Pug's compile methods.
* @protected
*/
protected getOptions() {
return {
basedir: this.path.toLocal,