Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Add support @Property. Fixes #3
Browse files Browse the repository at this point in the history
For properties not exposed as attributes, this differentiates
  • Loading branch information
ebidel committed May 8, 2014
1 parent a9520cf commit aac6c24
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
8 changes: 5 additions & 3 deletions elements/context-free-parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@
break;

case 'attribute':
case 'property':
case 'method':
case 'event':
subCurrent = {
name: content,
description: code
};
makePragma(current, pragma + 's', subCurrent);
var label = pragma == 'property' ? 'properties' : pragma + 's';
makePragma(current, label, subCurrent);
break;

case 'default':
Expand All @@ -101,8 +103,8 @@

});

if (classes.length === 0) {
classes.push({name: this.url.split('/').pop(), description: '**Undocumented**'});
if (classes.length === 0) {
classes.push({name: this.url.split('/').pop(), description: '**Undocumented**'});
}
this.data = { classes : classes };
},
Expand Down
19 changes: 19 additions & 0 deletions elements/core-doc-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,25 @@ pre code {
font-size: 1.2em;
}

.property-box .ntitle {
padding: 24px 16px;
}

.property-box code {
color: #4285F4;
border: none;
background-color: transparent;
border-radius: none;
padding: 0;
font-size: 1.2em;
}

.property-box .details {
background-color: lightblue;
padding: 8px 16px;
border-bottom: 1px solid #D1CCA1;
}

.method-box {
}

Expand Down
17 changes: 17 additions & 0 deletions elements/core-doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ <h1 style="font-size: 52px; color: #E91E63;">
</section>
</template>

<template if="{{data.properties.length}}">
<section class="box property-box">
<div class="ntitle" style="background-color: #4285F4; color: white;">Properties</div>
<template repeat="{{data.properties}}">
<div class="details">
<div class="details-name">
<p><code>{{name}}</code></p>
</div>
<div class="details-info">
<p><code>{{type}}</code></p>
<marked-element text="{{description}}"></marked-element>
</div>
</div>
</template>
</section>
</template>

<template if="{{data.events.length}}">
<section class="box event-box">
<div class="ntitle" style="color: white;">Events</div>
Expand Down

0 comments on commit aac6c24

Please sign in to comment.