Docs page enhancement
This commit is contained in:
parent
f8cc64dc4c
commit
e43afcc0a9
3 changed files with 23 additions and 10 deletions
app
|
@ -26,3 +26,6 @@
|
||||||
|
|
||||||
.doc-description
|
.doc-description
|
||||||
list-style-type: none
|
list-style-type: none
|
||||||
|
|
||||||
|
.codeBlock
|
||||||
|
list-style-type: none
|
|
@ -7,26 +7,36 @@ block content
|
||||||
ul.nav.nav-list.list-group.nano-content
|
ul.nav.nav-list.list-group.nano-content
|
||||||
for component in components
|
for component in components
|
||||||
a.doc-name(href="##{component.get('name')}")
|
a.doc-name(href="##{component.get('name')}")
|
||||||
li= component.get('name')
|
li.list-group-item= component.get('name')
|
||||||
ul
|
ul
|
||||||
|
// .list-group for different layout
|
||||||
each doc in component.attributes.propertyDocumentation
|
each doc in component.attributes.propertyDocumentation
|
||||||
a(href="##{component.get('name')}#{doc.name}")
|
a(href="##{component.get('name')}#{doc.name}")
|
||||||
li
|
li.list-group-item
|
||||||
| #{doc.name}
|
| #{doc.name}
|
||||||
.col-xs-9.documentation-column.nano
|
.col-xs-9.documentation-column.nano
|
||||||
ul.nano-content
|
ul.nano-content
|
||||||
for component in components
|
for component in components
|
||||||
li(id="#{component.get('name')}")
|
div(id="#{component.get('name')}" class="panel panel-defalt")
|
||||||
| #{component.get('name')}
|
div(class="panel-heading")
|
||||||
|
| #{component.get('name')}
|
||||||
|
div(class="panel-body")
|
||||||
|
| #{component.get('description')}
|
||||||
ul
|
ul
|
||||||
li.doc-description
|
|
||||||
| #{component.get('description')}
|
|
||||||
ul
|
|
||||||
each doc in component.attributes.propertyDocumentation
|
each doc in component.attributes.propertyDocumentation
|
||||||
li(id="#{component.get('name')}#{doc.name}")
|
li.list-group-item(id="#{component.get('name')}#{doc.name}")
|
||||||
| #{doc.name}
|
| #{doc.name}
|
||||||
ul.specialList
|
ul.specialList
|
||||||
if doc.description[language]
|
if doc.description[language]
|
||||||
li!=marked(doc.description[language])
|
li!=marked(doc.description[language])
|
||||||
else
|
else
|
||||||
li!=marked(doc.description)
|
li!=marked(doc.description)
|
||||||
|
li.panel-heading
|
||||||
|
a.codeBlock(data-toggle="collapse" data-parent="##{component.get('name')}" href="##{component.get('name')}Code")
|
||||||
|
| Code
|
||||||
|
div(id="#{component.get('name')}Code" class="panel-collapse collapse")
|
||||||
|
div.panel-body
|
||||||
|
pre
|
||||||
|
| #{component.attributes.code}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ CocoCollection = require 'collections/CocoCollection'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
|
|
||||||
class ComponentDocsCollection extends CocoCollection
|
class ComponentDocsCollection extends CocoCollection
|
||||||
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation'
|
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
|
||||||
model: LevelComponent
|
model: LevelComponent
|
||||||
|
|
||||||
module.exports = class UnnamedView extends RootView
|
module.exports = class UnnamedView extends RootView
|
||||||
|
|
Reference in a new issue