Skip to content

Commit

Permalink
get info from class description
Browse files Browse the repository at this point in the history
  • Loading branch information
stanistan committed Aug 21, 2012
1 parent ecd20cd commit af541d6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
31 changes: 28 additions & 3 deletions includes/api-documentation/api-documentation.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#api-doc {
background: #f7f7f7;
padding: 10px;
margin-bottom: 10px;
background: #fff;
line-height: 18px;
margin-bottom: 15px;
}

.api-table {
Expand Down Expand Up @@ -134,5 +134,30 @@ h3 {
width: 135px;
}

pre.mdown {
background: #f8f8f8;
border: 1px solid #ccc;
border-radius: 3px;
padding: 6px 10px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
margin: 10px 0;
}

code {
border: 1px solid #ddd;
border-radius: 2px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
padding: 1px 3px;
color: red;
}

pre.mdown code {
border-radius: none;
border: none;
padding: none;
color: inherit;
}

.api-desc pre.mdown {
background: #fff;
}
13 changes: 7 additions & 6 deletions includes/api-documentation/api-documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,14 @@
), '/')
);

$to_text = function($val) {
return array('list' => array_map(function($a) {
return array('text' => $a);
}, $val ?: array()));
};
$doc = trim(\Sky\DocParser::docAsString($method['doc']));

$method['doc'] = array_map($to_text, $method['doc'] ?: array());
$method['doc'] = $doc ? array('content' => $doc) : null;
$method['params'] = $method['params']
? array(
'list' => array_map(function($ea) {
$ea['description'] = implode(PHP_EOL, $ea['description']);

return $ea;
}, $method['params'])
)
Expand All @@ -93,6 +90,8 @@
$method = null;
}



$parsed = $docs->walkResources();
ksort($parsed);

Expand All @@ -110,7 +109,9 @@
);

foreach ($types as $type) {

$t = array_values($value[$type]);

if ($t) {
$data[$type] = array('list' => $t);
}
Expand Down
5 changes: 2 additions & 3 deletions includes/api-documentation/mustache/docs_page.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<div class="description">
{{#doc}}
<div class="api-desc">
{{#list}}
{{{text}}}
{{/list}}
{{{content}}}
</div>
{{/doc}}
{{^doc}}
Expand Down Expand Up @@ -43,6 +41,7 @@


<div id="doc-sidebar">
<a href="{{page_path}}" id="back-to-grid">Back</a>
{{#all_docs}}
<ul>
{{#list}}
Expand Down
2 changes: 1 addition & 1 deletion includes/api-documentation/mustache/docs_table.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#api_doc}}
<div id="api-doc">
{{{.}}}
{{{api_doc}}}
</div>
{{/api_doc}}

Expand Down

0 comments on commit af541d6

Please sign in to comment.