add main page

This commit is contained in:
Aleksey Chichenkov 2018-09-26 18:13:03 +03:00
parent 59d791e97f
commit 12c4995428
16 changed files with 372 additions and 43 deletions

View file

@ -658,6 +658,15 @@ var find_first_members = function (_parent, _clss) {
};
global.typedefs = {};
global.mainpage_content = [];
var find_tag_by_id = function (_tags, _tag_id) {
for (var a = 0; a < _tags.length; a++) {
var info = _tags[a];
if (info.title == _tag_id) return true;
}
return false;
};
/**
@param {TAFFY} taffyData See <http://taffydb.com/>.
@ -722,6 +731,13 @@ exports.publish = function(taffyData, opts, tutorials) {
if(doclet.kind == "typedef") {
typedefs[doclet.longname] = doclet;
}
if(doclet.tags && find_tag_by_id(doclet.tags, "mainpage")){
console.log(doclet);
mainpage_content.push(doclet);
}
});
@ -869,6 +885,7 @@ exports.publish = function(taffyData, opts, tutorials) {
outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false;
// add template helpers
view.content = mainpage_content;
view.find = find;
view.linkto = linkto;
view.replace_enters_to_br = replace_enters_to_br;
@ -892,7 +909,7 @@ exports.publish = function(taffyData, opts, tutorials) {
files = find({kind: 'file'});
packages = find({kind: 'package'});
generate('Home',
generate('Documentation: GUI 2.9.1-develop',
packages.concat(
[{
kind: 'mainpage',

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: <?js= title ?></title>
<title>Initi documentation for GUI(2.9.1-develop) <?js= title ?></title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>

View file

@ -1,8 +1,13 @@
<?js
var data = obj;
var self = this;
console.log(self.content)
?>
<?js= self.partial('mainpage/each.tmpl', self.content) ?>
<?js if (data.kind === 'package') { ?>
<h3><?js= data.name ?> <?js= data.version ?></h3>
<?js } ?>

View file

@ -0,0 +1,8 @@
<?js
var content = obj;
var self = this;
?>
<?js for(var a = 0; a < content.length; a++) { ?>
<?js= self.partial('mainpage/part.tmpl', content[a]) ?>
<?js } ?>

View file

@ -0,0 +1,17 @@
<?js
var part = obj;
var self = this;
//console.log(part);
?>
<?js if(part.description) { ?>
<div class="description part bdotted"><?js= self.replace_enters_to_br(part.description) ?></div>
<?js } ?>
<?js if (part.examples && part.examples.length) { ?>
<div class="params-desc params-example bdotted part">
<div class="title">Examples: </div>
<?js= self.partial('examples.tmpl', part.examples) ?>
</div>
<?js } ?>