render bitmatrix into code section
This commit is contained in:
Родитель
08e0ce3c12
Коммит
757e71e8ae
20
ast/ast.ts
20
ast/ast.ts
|
@ -942,7 +942,23 @@ module TDev.AST {
|
||||||
public docText():string
|
public docText():string
|
||||||
{
|
{
|
||||||
var prop = this.expr.parsed ? this.expr.parsed.getCalledProperty() : null
|
var prop = this.expr.parsed ? this.expr.parsed.getCalledProperty() : null
|
||||||
if (!prop || prop.getName() != "docs render") return null
|
if (!prop) return null;
|
||||||
|
|
||||||
|
if (prop.getName() == "docs render") return this.docsRender();
|
||||||
|
else if (prop.parentKind == api.getKind("Docs") && prop.getName() == "bitmatrix") return this.bitmatrixRender();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bitmatrixRender(): string {
|
||||||
|
var c = <Call>this.expr.parsed
|
||||||
|
if (c.args.length != 2) return null;
|
||||||
|
|
||||||
|
var bits = c.args[1].getStringLiteral() || ""
|
||||||
|
return "```` bitmatrix\n" + bits + "\n````"
|
||||||
|
}
|
||||||
|
|
||||||
|
private docsRender(): string {
|
||||||
var c = <Call>this.expr.parsed
|
var c = <Call>this.expr.parsed
|
||||||
var arg0 = <GlobalDef>c.args[0].getCalledProperty()
|
var arg0 = <GlobalDef>c.args[0].getCalledProperty()
|
||||||
if (arg0 instanceof GlobalDef) {
|
if (arg0 instanceof GlobalDef) {
|
||||||
|
@ -960,7 +976,7 @@ module TDev.AST {
|
||||||
return "[" + cap + "] (" + url + ")"
|
return "[" + cap + "] (" + url + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ module TDev.RT {
|
||||||
{
|
{
|
||||||
//? Renders a bitmatrix
|
//? Renders a bitmatrix
|
||||||
//@ docsOnly [bits].lang("bitmatrix")
|
//@ docsOnly [bits].lang("bitmatrix")
|
||||||
export function bitmatrix(bits: string, caption:string) {
|
export function bitmatrix(bits: string) {
|
||||||
// used when rendering docs
|
// used when rendering docs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче