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
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"enabledTools": [
|
||||
"index",
|
||||
"versionIndex"
|
||||
"versionIndex",
|
||||
"tutorialIndex"
|
||||
]
|
||||
}
|
@@ -1,3 +1,5 @@
|
||||
| Name | Level | Abstract |
|
||||
| -- | -- | -- |
|
||||
{% each tuts as tut %}
|
||||
1. [**{{tut.title}}**]({{tut.link}}) ({{tut.level}}): {{tut.briefDesc}}
|
||||
| [**{{tut.title}}**]({{tut.link}}) | {{tut.level}} | {{tut.briefDesc}} |
|
||||
{% endeach %}
|
@@ -391,8 +391,10 @@ function buildGuideSection(guideJsonFilename, forSubFolder) {
|
||||
filePath = guideFolderName + "/" + filePath;
|
||||
}
|
||||
|
||||
var link = unist.makeLink(unist.makeText(summary[i].title), filePath);
|
||||
listItems.push(unist.makeListItem(link));
|
||||
if (summary[i].title !== "Tutorials") {
|
||||
var link = unist.makeLink(unist.makeText(summary[i].title), filePath);
|
||||
listItems.push(unist.makeListItem(link));
|
||||
}
|
||||
}
|
||||
|
||||
return unist.makeListUnordered(listItems);
|
||||
|
@@ -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);
|
||||
|
@@ -12,6 +12,7 @@ import * as unist from "../unistHelpers";
|
||||
|
||||
const tutFolder = path.resolve("..", "docs", "tutorials");
|
||||
const templateFolder = path.resolve(".", "config", "DocProcessor", "templates");
|
||||
const userGuideFolder = path.resolve("..", "docs", "user-guide");
|
||||
|
||||
|
||||
export function initPhase(aggData) {}
|
||||
@@ -51,17 +52,24 @@ export function updatePhase(tree, pathname, aggData) {
|
||||
|
||||
|
||||
function getIndexDocData() {
|
||||
let indexFile = path.resolve(tutFolder, "index.json");
|
||||
let indexArray = JSON.parse(fs.readFileSync(indexFile, "utf8"));
|
||||
|
||||
let indexFile = path.resolve(userGuideFolder, "summary.json");
|
||||
let summaryArray = JSON.parse(fs.readFileSync(indexFile, "utf8"));
|
||||
let indexArray = [];
|
||||
|
||||
summaryArray.forEach(element => {
|
||||
if (element["title"] === "Tutorials") {
|
||||
indexArray = element["children"];
|
||||
}
|
||||
});
|
||||
|
||||
let result = {
|
||||
tuts: []
|
||||
};
|
||||
|
||||
indexArray.forEach(element => {
|
||||
let tutData = { link: element };
|
||||
let tutData = { link: element["file"] };
|
||||
|
||||
let tutFile = path.resolve(tutFolder, element);
|
||||
let tutFile = path.resolve(tutFolder, element["file"]);
|
||||
let tutFileText = fs.readFileSync(tutFile, "utf8");
|
||||
let tutMD = remark().use(frontMatter, ["yaml"]).parse(tutFileText);
|
||||
|
||||
|
Reference in New Issue
Block a user