изменил иерархию файлов
This commit is contained in:
parent
9ef7ac0df9
commit
dd1eed15cf
52 changed files with 1602 additions and 938 deletions
|
@ -13,6 +13,9 @@ var pct = require('./static/scripts/parse_complex_type');
|
|||
|
||||
var htmlsafe = helper.htmlsafe;
|
||||
var linkto = pct.linkto;
|
||||
var replace_enters_to_br = pct.replace_enters_to_br;
|
||||
|
||||
|
||||
var resolveAuthorLinks = helper.resolveAuthorLinks;
|
||||
var hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
|
||||
|
@ -238,6 +241,7 @@ function generate(title, docs, filename, resolveLinks) {
|
|||
};
|
||||
|
||||
outpath = path.join(outdir, filename);
|
||||
// console.log(docData)
|
||||
html = view.render('container.tmpl', docData);
|
||||
|
||||
if (resolveLinks) {
|
||||
|
@ -557,7 +561,8 @@ function buildNav(members) {
|
|||
|
||||
var render_explorer = function (_nss, _clss) {
|
||||
var nav = "";
|
||||
nav += render_menu_item("Managers", "manager", _nss, _clss, true);
|
||||
nav += render_menu_item("Providers Interface", "providers_interface", _nss, _clss, true);
|
||||
nav += render_menu_item("Providers Managers", "manager", _nss, _clss, true);
|
||||
nav += render_menu_item("Libraries", "library", _nss, _clss, true);
|
||||
return nav;
|
||||
};
|
||||
|
@ -609,7 +614,8 @@ var render_menu_item = function (_title, _type, _nss, _clss, _check_tags) {
|
|||
var check_tags = function (_tags, _key) {
|
||||
for (var a = 0; a < _tags.length; a++) {
|
||||
var info = _tags[a];
|
||||
if (info.title == _key) return true;
|
||||
// console.log("TAGS",_key, _tags);
|
||||
if (info.title == "group" && info.text == _key) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
@ -651,6 +657,7 @@ var find_first_members = function (_parent, _clss) {
|
|||
return members;
|
||||
};
|
||||
|
||||
global.typedefs = {};
|
||||
|
||||
/**
|
||||
@param {TAFFY} taffyData See <http://taffydb.com/>.
|
||||
|
@ -710,7 +717,16 @@ exports.publish = function(taffyData, opts, tutorials) {
|
|||
data.sort('longname, version, since');
|
||||
helper.addEventListeners(data);
|
||||
|
||||
data().each(function(doclet){
|
||||
// console.log(doclet);
|
||||
if(doclet.kind == "typedef") {
|
||||
typedefs[doclet.longname] = doclet;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
data().each(function(doclet) {
|
||||
|
||||
var sourcePath;
|
||||
|
||||
doclet.attribs = '';
|
||||
|
@ -855,6 +871,7 @@ exports.publish = function(taffyData, opts, tutorials) {
|
|||
// add template helpers
|
||||
view.find = find;
|
||||
view.linkto = linkto;
|
||||
view.replace_enters_to_br = replace_enters_to_br;
|
||||
view.resolveAuthorLinks = resolveAuthorLinks;
|
||||
view.tutoriallink = tutoriallink;
|
||||
view.htmlsafe = htmlsafe;
|
||||
|
|
|
@ -45,7 +45,9 @@ var recursive = function (_str, _class, _alias) {
|
|||
var rx = /(.*?)\((.*)\)/im;
|
||||
var res = _id.match(rx);
|
||||
|
||||
if(res == null) return helper.linkto(_id, (_alias ? _alias : _id), _class);
|
||||
var _full_id = replace_type_def(_id);
|
||||
|
||||
if(res == null) return helper.linkto(_full_id, (_alias ? _alias : _id), _class);
|
||||
//if (res == null) return _id;
|
||||
|
||||
var first = res[1];
|
||||
|
@ -72,19 +74,30 @@ var recursive = function (_str, _class, _alias) {
|
|||
};
|
||||
|
||||
var linkto = function (_id, _alias, _class) {
|
||||
//console.log(_id, _alias)
|
||||
// ns.longname, ns.name, "menu-title"
|
||||
|
||||
// remove all whitespaces
|
||||
|
||||
var res = recursive(_id, _class, _alias);
|
||||
//console.log("result")
|
||||
//console.log(res)
|
||||
// /_id.match(rx);
|
||||
|
||||
return res;
|
||||
return recursive(_id, _class, _alias);
|
||||
};
|
||||
|
||||
|
||||
var replace_type_def = function(_ln){
|
||||
var td = typedefs[_ln];
|
||||
|
||||
if(!td) return _ln;
|
||||
|
||||
var link = td.type.names[0];
|
||||
return link;
|
||||
}
|
||||
|
||||
var replace_enters_to_br = function(_str){
|
||||
// console.log(_str)
|
||||
var out = _str;
|
||||
while(out.match("\n")) out = out.replace("\n", "<br>");
|
||||
|
||||
// console.log(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
linkto: linkto
|
||||
linkto: linkto,
|
||||
replace_enters_to_br: replace_enters_to_br,
|
||||
replace_type_def: replace_type_def
|
||||
};
|
|
@ -3,6 +3,13 @@
|
|||
var isGlobalPage;
|
||||
|
||||
docs.forEach(function(doc, i) {
|
||||
|
||||
var replaces_description = doc.description ? self.replace_enters_to_br(doc.description): "";
|
||||
|
||||
//if(doc.longname == "Models.Model"){
|
||||
console.log(replaces_description);
|
||||
//}
|
||||
|
||||
?>
|
||||
|
||||
<?js
|
||||
|
@ -45,7 +52,7 @@
|
|||
<div class="container-overview">
|
||||
<?js if (doc.kind === 'module' && doc.modules) { ?>
|
||||
<?js if (doc.description) { ?>
|
||||
<div class="description"><?js= doc.description ?></div>
|
||||
<div class="description"><?js= replaces_description ?></div>
|
||||
<?js } ?>
|
||||
|
||||
<?js doc.modules.forEach(function(module) { ?>
|
||||
|
@ -55,7 +62,7 @@
|
|||
<?js= self.partial('method.tmpl', doc) ?>
|
||||
<?js } else { ?>
|
||||
<?js if (doc.description) { ?>
|
||||
<div class="description"><?js= doc.description ?></div>
|
||||
<div class="description"><?js= replaces_description ?></div>
|
||||
<?js } ?>
|
||||
|
||||
<?js= self.partial('details.tmpl', doc) ?>
|
||||
|
|
|
@ -11,7 +11,7 @@ var ryba = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eius
|
|||
<div class="title"><span><?js= method.name ?></span></div>
|
||||
|
||||
<?js if(method.description) { ?>
|
||||
<div class="description part bdotted"><?js= method.description ?></div>
|
||||
<div class="description part bdotted"><?js= self.replace_enters_to_br(method.description) ?></div>
|
||||
<?js } ?>
|
||||
|
||||
<div class="short bdotted part">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue