mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3514] Added transclusions sections to doc files (#3756)
* [ADF-3514] Added transclusion sections and guide page * [ADF-3514] Updated tables of contents where needed * [ADF-3514] Updated index files
This commit is contained in:
committed by
Eugenio Romano
parent
35e1563fde
commit
2c49de6070
@@ -19,8 +19,7 @@
|
||||
"toc"
|
||||
],
|
||||
"dev": [
|
||||
"tsInfo",
|
||||
"typeLinker"
|
||||
"toc"
|
||||
]
|
||||
},
|
||||
"statusIcons": {
|
||||
|
@@ -4,6 +4,7 @@ var fs = require("fs");
|
||||
var remark = require("remark");
|
||||
//var tocGenerator = require("mdast-util-toc");
|
||||
var replaceSection = require("mdast-util-heading-range");
|
||||
var tostring = require("mdast-util-to-string");
|
||||
|
||||
var ejs = require("ejs");
|
||||
|
||||
@@ -117,18 +118,26 @@ function makeToc(tree) {
|
||||
|
||||
var headings = nav.headings(h =>
|
||||
(h.depth > 1) &&
|
||||
(h.depth <= maxTocHeadingDepth) &&
|
||||
!((h.children[0].type === "text") && (h.children[0].value === "Contents"))
|
||||
(h.depth <= maxTocHeadingDepth) //&&
|
||||
//!((h.children[0].type === "text") && (h.children[0].value === "Contents"))
|
||||
);
|
||||
|
||||
var context = {headings: []};
|
||||
|
||||
headings.forEach(heading => {
|
||||
context.headings.push({
|
||||
"level": heading.item.depth - 2,
|
||||
"title": heading.textValue,
|
||||
"anchor": "#" + heading.textValue.toLowerCase().replace(/ /g, "-").replace(/[\.,'"`$]/g ,"")
|
||||
})
|
||||
var linkTitle = "";
|
||||
|
||||
if (!((heading.item.children[0].type === "text") && (heading.item.children[0].value === "Contents"))) {
|
||||
linkTitle = tostring(heading.item).trim();
|
||||
}
|
||||
|
||||
if (linkTitle !== "") {
|
||||
context.headings.push({
|
||||
"level": heading.item.depth - 2,
|
||||
"title": linkTitle,
|
||||
"anchor": "#" + linkTitle.toLowerCase().replace(/ /g, "-").replace(/[\.,'"`$]/g ,"")
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
var templateName = path.resolve(templateFolder, "toc.ejs");
|
||||
|
@@ -13,10 +13,12 @@
|
||||
<% child.decorators.forEach(dec => { -%>
|
||||
- name: <%= dec.name %>
|
||||
arguments:
|
||||
<%_if (typeof dec.arguments !== "undefined") { -%>
|
||||
<% Object.keys(dec.arguments).forEach(argName => { -%>
|
||||
- id: <%= argName %>
|
||||
value: <%- dec.arguments[argName] %>
|
||||
<% }) %>
|
||||
<% } -%>
|
||||
<%_ }) -%>
|
||||
<% } -%>
|
||||
syntax:
|
||||
|
Reference in New Issue
Block a user