mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2679] Added first tutorials (#3186)
* [ADF-2679] Updated tutorial index script and added the first few tutorials * [ADF-2679] Minor fixes to README and index script
This commit is contained in:
committed by
Eugenio Romano
parent
978c4487a7
commit
d0f5bad894
@@ -10,6 +10,7 @@ var combyne = require("combyne");
|
||||
var unist = require("../unistHelpers");
|
||||
var tutFolder = path.resolve("..", "docs", "tutorials");
|
||||
var templateFolder = path.resolve(".", "config", "DocProcessor", "templates");
|
||||
var userGuideFolder = path.resolve("..", "docs", "user-guide");
|
||||
function initPhase(aggData) { }
|
||||
exports.initPhase = initPhase;
|
||||
function readPhase(tree, pathname, aggData) { }
|
||||
@@ -38,14 +39,20 @@ function updatePhase(tree, pathname, aggData) {
|
||||
}
|
||||
exports.updatePhase = updatePhase;
|
||||
function getIndexDocData() {
|
||||
var indexFile = path.resolve(tutFolder, "index.json");
|
||||
var indexArray = JSON.parse(fs.readFileSync(indexFile, "utf8"));
|
||||
var indexFile = path.resolve(userGuideFolder, "summary.json");
|
||||
var summaryArray = JSON.parse(fs.readFileSync(indexFile, "utf8"));
|
||||
var indexArray = [];
|
||||
summaryArray.forEach(function (element) {
|
||||
if (element["title"] === "Tutorials") {
|
||||
indexArray = element["children"];
|
||||
}
|
||||
});
|
||||
var result = {
|
||||
tuts: []
|
||||
};
|
||||
indexArray.forEach(function (element) {
|
||||
var tutData = { link: element };
|
||||
var tutFile = path.resolve(tutFolder, element);
|
||||
var tutData = { link: element["file"] };
|
||||
var tutFile = path.resolve(tutFolder, element["file"]);
|
||||
var tutFileText = fs.readFileSync(tutFile, "utf8");
|
||||
var tutMD = remark().use(frontMatter, ["yaml"]).parse(tutFileText);
|
||||
var metadata = getDocMetadata(tutMD);
|
||||
|
Reference in New Issue
Block a user