chore(doc-gen): add TypeScript parsing

This commit is contained in:
Peter Bacon Darwin
2015-05-15 13:57:38 +01:00
parent 25a952755e
commit 9a72f19b97
16 changed files with 546 additions and 19 deletions

View File

@ -3,8 +3,8 @@
{% block body %}
p.location-badge.
exported from <a href="/{$ doc.moduleDoc.path $}">{$ doc.moduleDoc.id $}</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/{$ doc.location.start.source.name $}.js#L{$ doc.location.start.line $}">{$ doc.location.start.source.name $}.js (line {$ doc.location.start.line $})</a>
exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }
defined in <a href="https://github.com/angular/angular/tree/master/modules/{$ doc.fileInfo.relativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $}">{$ doc.fileInfo.relativePath $} (line {$ doc.location.start.line+1 $})</a>
:markdown
{$ doc.description | indent(2, true) $}
@ -17,10 +17,10 @@ p.location-badge.
.l-sub-section
h3 {$ doc.constructorDoc.name $}
{% if doc.constructorDoc.params %}
{% if doc.constructorDoc.parameters %}
pre.prettyprint
code.
{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.params) | indent(4, true) | trim $}
{$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.parameters) | indent(4, true) | trim $}
{% endif %}
:markdown
{$ doc.constructorDoc.description | indent(6, true) | replace('## Example', '') | replace('# Example', '') $}
@ -32,10 +32,10 @@ p.location-badge.
.l-sub-section
h3 {$ member.name $}
{% if member.params %}
{% if member.parameters %}
pre.prettyprint
code.
{$ member.name $}{$ paramList(member.params) | indent(4, true) | trim $}
{$ member.name $}{$ paramList(member.parameters) | indent(4, true) | trim $}{$ returnType(doc.returnType) $}
{% endif %}
:markdown

View File

@ -5,10 +5,15 @@
.l-main-section
h2(class="function export") {$ doc.name $}
p <code>{$ paramList(doc.parameters) $}</code>
{% if doc.parameters %}
pre.prettyprint
code.
{$ doc.name $}{$ paramList(doc.parameters) | indent(4, true) | trim $}{$ returnType(doc.returnType) $}
{% endif %}
p.location-badge.
exported from <a href="/{$ doc.moduleDoc.path $}">{$ doc.moduleDoc.id $}</a>
exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} }
defined in <a href="https://github.com/angular/angular/tree/master/modules/{$ doc.fileInfo.relativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $}">{$ doc.fileInfo.relativePath $} (line {$ doc.location.start.line+1 $})</a>
:markdown
{$ doc.description | indent(4, true) $}

View File

@ -4,4 +4,9 @@
{$ param | escape $}{% if not loop.last %}, {% endif %}
{%- endfor %})
{%- endif %}
{%- endmacro -%}
{%- endmacro -%}
{% macro returnType(returnType) -%}
{%- if returnType %} : {$ returnType | escape $}{% endif -%}
{%- endmacro -%}

View File

@ -1,5 +1,8 @@
{% extends 'layout/base.template.html' -%}
{% block body -%}
p.location-badge.
defined in <a href="https://github.com/angular/angular/tree/master/modules/{$ doc.fileInfo.relativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $}">{$ doc.fileInfo.relativePath $} (line {$ doc.location.start.line+1 $})</a>
ul
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
if slug != 'index'