update DocPage ('examples' property renamed to 'tests')
This commit is contained in:
parent
b4bb926c0c
commit
27b55e2b6e
1 changed files with 10 additions and 8 deletions
|
@ -93,7 +93,7 @@ Ox.DocPage = function(options, self) {
|
|||
];
|
||||
[
|
||||
'description', 'usage', 'arguments', 'properties',
|
||||
'events', 'examples', 'source'
|
||||
'events', 'tests', 'source'
|
||||
].forEach(function(section) {
|
||||
var className = 'OxLine' + Ox.uid();
|
||||
if (item[section]) {
|
||||
|
@ -151,26 +151,28 @@ Ox.DocPage = function(options, self) {
|
|||
});
|
||||
})
|
||||
)
|
||||
.append('<span class="OxSection">' + Ox.toTitleCase(section) + '</span>')
|
||||
.append('<span class="OxSection">' + Ox.toTitleCase(
|
||||
section == 'tests' ? 'examples' : section
|
||||
) + '</span>')
|
||||
);
|
||||
if (section == 'examples') {
|
||||
item.examples.forEach(function(example) {
|
||||
if (section == 'tests') {
|
||||
item.tests.forEach(function(test) {
|
||||
$elements.push($('<div>')
|
||||
.addClass(className)
|
||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
'<code><b>> '
|
||||
+ Ox.encodeHTMLEntities(example.statement)
|
||||
+ Ox.encodeHTMLEntities(test.statement)
|
||||
.replace(/ /g, ' ')
|
||||
.replace(/\n/g, '<br/>\n ')
|
||||
+ '</b></code>'
|
||||
)
|
||||
);
|
||||
example.result && $elements.push($('<div>')
|
||||
test.result && $elements.push($('<div>')
|
||||
.addClass(className)
|
||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||
.html(
|
||||
'<code>' + Ox.encodeHTMLEntities(example.result) + '</code>'
|
||||
'<code>' + Ox.encodeHTMLEntities(test.result) + '</code>'
|
||||
)
|
||||
)
|
||||
});
|
||||
|
@ -184,7 +186,7 @@ Ox.DocPage = function(options, self) {
|
|||
+ '</b>:' + self.options.item.line + '</code>'
|
||||
)
|
||||
);
|
||||
Ox.print('IS::', item.source);
|
||||
//Ox.print('IS::', item.source);
|
||||
$elements.push(
|
||||
Ox.SyntaxHighlighter({
|
||||
replace: self.options.replace,
|
||||
|
|
Loading…
Reference in a new issue