Types
TimCallback = proc () {.nimcall, ...gcsafe.}
TimEngine = ref object errors*: seq[string] ## A table containing available placeholders when defined timStandalone: else:
TimError = object of CatchableError
TimPolicy = ref object
TimTemplate = ref object case of ttPartial: nil of ttLayout: else: nil sources*: TemplateSourcePaths
TimTemplateType = enum ttInvalid, ttLayout = "layouts", ttView = "views", ttPartial = "partials"
Procs
proc addDep(t: TimTemplate; path: string) {....raises: [], tags: [], forbids: [].}
- Add a new dependent
proc addPlaceholder(engine: TimEngine; k: string; snippetTree: Ast) {. ...raises: [KeyError], tags: [], forbids: [].}
proc clearTemplateByPath(engine: TimEngine; path: string) {. ...raises: [ValueError], tags: [], forbids: [].}
- Clear a template from TemplateTable by path
proc deleteSnippet(engine: TimEngine; k: string; i: int) {....raises: [KeyError], tags: [], forbids: [].}
proc getAstPath(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Returns the absolute html path of t TimTemplate
proc getAstStoragePath(engine: TimEngine): string {....raises: [], tags: [], forbids: [].}
- Returns the ast directory path used for storing binary AST files.
proc getDeps(t: TimTemplate): seq[string] {....raises: [], tags: [], forbids: [].}
proc getGlobalData(engine: TimEngine): JsonNode {....raises: [], tags: [], forbids: [].}
proc getHash(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Returns the hashed path of t
proc getHtml(t: TimTemplate): string {....raises: [], tags: [ReadIOEffect], forbids: [].}
- Returns precompiled static HTML of t TimTemplate
proc getHtmlPath(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Returns the absolute ast path of t TimTemplate
proc getHtmlStoragePath(engine: TimEngine): string {....raises: [], tags: [], forbids: [].}
- Returns the html directory path used for storing static HTML files
proc getIndentSize(engine: TimEngine): int {....raises: [], tags: [], forbids: [].}
proc getLayout(engine: TimEngine; key: string): TimTemplate {. ...raises: [KeyError, ValueError], tags: [], forbids: [].}
- Get a TimTemplate from layouts by key
proc getName(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Get template name of t
proc getPath(engine: TimEngine; key: string; templateType: TimTemplateType): string {. ...raises: [ValueError], tags: [], forbids: [].}
- Get absolute path of key view, partial or layout
proc getSourcePath(engine: TimEngine): string {....raises: [], tags: [], forbids: [].}
proc getSourcePath(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Returns the absolute source path of t TimTemplate
proc getTail(t: TimTemplate): string {....raises: [TimError], tags: [ReadIOEffect], forbids: [].}
- Returns the tail of a split layout
proc getTemplateByPath(engine: TimEngine; path: string): TimTemplate {. ...raises: [KeyError], tags: [], forbids: [].}
- Search for path in layouts or views table
proc getTemplateId(t: TimTemplate): string {....raises: [], tags: [], forbids: [].}
- Get template id of t
proc getTemplatePath(engine: TimEngine; path: string): string {....raises: [], tags: [], forbids: [].}
proc getTemplateType(engine: TimEngine; path: string): TimTemplateType {. ...raises: [ValueError], tags: [], forbids: [].}
- Returns TimTemplateType by path
proc getType(t: TimTemplate): TimTemplateType {....raises: [], tags: [], forbids: [].}
- Get template type of t
proc getView(engine: TimEngine; key: string): TimTemplate {. ...raises: [KeyError, ValueError], tags: [], forbids: [].}
- Get a TimTemplate from views by key
proc getViewIndent(t: TimTemplate): uint {....raises: [], tags: [], forbids: [].}
proc hasDep(t: TimTemplate; path: string): bool {....raises: [], tags: [], forbids: [].}
proc hasPlaceholder(engine: TimEngine; k: string): bool {....raises: [], tags: [], forbids: [].}
proc isMinified(engine: TimEngine): bool {....raises: [], tags: [], forbids: [].}
proc isUsed(t: TimTemplate): bool {....raises: [], tags: [], forbids: [].}
proc jitEnable(t: TimTemplate) {....raises: [], tags: [], forbids: [].}
proc jitEnabled(t: TimTemplate): bool {....raises: [], tags: [], forbids: [].}
proc readAst(engine: TimEngine; tpl: TimTemplate): Ast {....raises: [Exception], tags: [ReadIOEffect, RootEffect], forbids: [].}
- Get AST of tpl TimTemplate from storage
proc setGlobalData(engine: TimEngine; data: JsonNode) {....raises: [], tags: [], forbids: [].}
proc setViewIndent(t: TimTemplate; i: uint) {....raises: [], tags: [], forbids: [].}
proc showHtmlErrors(engine: TimEngine): bool {....raises: [], tags: [], forbids: [].}
proc writeAst(engine: TimEngine; tpl: TimTemplate; astCode: Ast) {. ...raises: [IOError, Exception], tags: [WriteIOEffect, RootEffect], forbids: [].}
- Writes astCode on disk using tpl info
proc writeHtml(engine: TimEngine; tpl: TimTemplate; htmlCode: string) {. ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
- Writes htmlCode on disk using tpl info
proc writeHtmlTail(engine: TimEngine; tpl: TimTemplate; htmlCode: string) {. ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
- Writes htmlCode tails on disk using tpl info
Iterators
iterator getLayouts(engine: TimEngine): TimTemplate {....raises: [], tags: [], forbids: [].}
iterator getViews(engine: TimEngine): TimTemplate {....raises: [], tags: [], forbids: [].}
iterator listPlaceholders(engine: TimEngine): (string, seq[Ast]) {....raises: [], tags: [], forbids: [].}