diff --git a/docs/versionIndex.md b/docs/versionIndex.md
index 64ca65aab2..e4deca59ca 100644
--- a/docs/versionIndex.md
+++ b/docs/versionIndex.md
@@ -1,10 +1,8 @@
# Version Index
-This file contains a list of components grouped according to the
-ADF version in which they were introduced. See the
-[main index page](README.md) for a list organized by ADF libraries.
-
-
+Below are the details of all released versions of ADF since general
+availability (v2.0.0). See the [main index page](README.md) for a list
+of components organized by ADF libraries.
## Versions
@@ -15,6 +13,14 @@ ADF version in which they were introduced. See the
## v2.3.0
+**Released:** 2018-04-17 ([Release notes](https://community.alfresco.com/docs/DOC-7347-adf-230-release-note))
+**APS compatible version:** v1.6.4+
+**ACS compatible version:** v5.2.3
+
+### Components added
+
+
+
- [Comment content service](core/comment-content.service.md)
- [Custom resources service](content-services/custom-resources.service.md)
- [Inherited button directive](content-services/inherited-button.directive.md)
@@ -26,21 +32,57 @@ ADF version in which they were introduced. See the
- [Sidenav layout component](core/sidenav-layout.component.md)
- [Upload version button component](content-services/upload-version-button.component.md)
+
+
+([Back to top](#versions))
+
## v2.2.0
+**Released:** 2018-03-05 ([Release notes](https://community.alfresco.com/docs/DOC-7318-adf-220-release-note))
+**APS compatible version:** v1.6.4+
+**ACS compatible version:** v5.2.2
+
+### Components added
+
+
+
- [Node download directive](content-services/node-download.directive.md)
- [Node lock directive](content-services/node-lock.directive.md)
+
+
+([Back to top](#versions))
+
## v2.1.0
+**Released:** 2018-01-29 ([Release notes](https://community.alfresco.com/docs/DOC-7292-adf-210-release-note))
+**APS compatible version:** v1.6.4+
+**ACS compatible version:** v5.2.2
+
+### Components added
+
+
+
- [Content metadata component](content-services/content-metadata.component.md)
- [Content node dialog service](content-services/content-node-dialog.service.md)
- [Content node selector panel component](content-services/content-node-selector-panel.component.md)
- [Search configuration service](core/search-configuration.service.md)
- [Sidebar action menu component](core/sidebar-action-menu.component.md)
+
+
+([Back to top](#versions))
+
## v2.0.0
+**Released:** 2017-12-04 ([Release notes](https://community.alfresco.com/docs/DOC-7244-adf-200-release-note))
+**APS compatible version:** v1.6.4+
+**ACS compatible version:** v5.2.2
+
+### Components added
+
+
+
- [Accordion group component](core/accordion-group.component.md)
- [Accordion component](core/accordion.component.md)
- [Activiti alfresco service](core/activiti-alfresco.service.md)
@@ -192,4 +234,6 @@ ADF version in which they were introduced. See the
- [Webscript component](content-services/webscript.component.md)
- [Widget component](insights/widget.component.md)
-
+
+
+([Back to top](#versions))
diff --git a/lib/config/DocProcessor/templates/versIndex.combyne b/lib/config/DocProcessor/templates/versIndex.combyne
new file mode 100644
index 0000000000..8980671a77
--- /dev/null
+++ b/lib/config/DocProcessor/templates/versIndex.combyne
@@ -0,0 +1,3 @@
+{% each items as item %}
+- [{{item.title}}]({{item.link}})
+{% endeach %}
\ No newline at end of file
diff --git a/lib/config/DocProcessor/tools/versionIndex.js b/lib/config/DocProcessor/tools/versionIndex.js
index 50ed416a3d..02766d78f9 100644
--- a/lib/config/DocProcessor/tools/versionIndex.js
+++ b/lib/config/DocProcessor/tools/versionIndex.js
@@ -5,6 +5,9 @@ var yaml = require("js-yaml");
var remark = require("remark");
var stringify = require("remark-stringify");
var zone = require("mdast-zone");
+var frontMatter = require("remark-frontmatter");
+
+var combyne = require("combyne");
var unist = require("../unistHelpers");
var ngHelpers = require("../ngHelpers");
@@ -25,13 +28,15 @@ var histFilePath = path.resolve(docsFolderPath, "versionIndex.md");
var histSectionName = "history";
var initialVersion = "v2.0.0";
+var templateFolder = path.resolve(".", "config", "DocProcessor", "templates");
+
function initPhase(aggData) {
aggData.versions = { "v2.0.0":[] };
}
function readPhase(tree, pathname, aggData) {
- var compName = pathname; //path.basename(pathname, ".md");
+ var compName = pathname;
var angNameRegex = /([a-zA-Z0-9\-]+)\.((component)|(directive)|(model)|(pipe)|(service)|(widget))/;
if (!compName.match(angNameRegex))
@@ -60,7 +65,7 @@ function readPhase(tree, pathname, aggData) {
function aggPhase(aggData) {
var histFileText = fs.readFileSync(histFilePath, "utf8");
- var histFileTree = remark().parse(histFileText);
+ var histFileTree = remark().data("settings", {paddedTable: false, gfm: false}).parse(histFileText);
var keys = Object.keys(aggData.versions);
keys.sort((a, b) => {
@@ -72,16 +77,9 @@ function aggPhase(aggData) {
return 0;
});
- var sections = [unist.makeHeading(unist.makeText("Versions"), 2)];
-
- var vListItems = [];
-
- for (var i = 0; i < keys.length; i++) {
- var keyAnchor = keys[i].replace(/\./g, "");
- vListItems.push(unist.makeListItem(unist.makeLink(unist.makeText(keys[i]), `#${keyAnchor}`)));
- }
-
- sections.push(unist.makeListUnordered(vListItems));
+ var templateName = path.resolve(templateFolder, "versIndex.combyne");
+ var templateSource = fs.readFileSync(templateName, "utf8");
+ var template = combyne(templateSource);
for (var i = 0; i < keys.length; i++) {
var version = keys[i];
@@ -93,7 +91,7 @@ function aggPhase(aggData) {
return aa.localeCompare(bb);
});
- var versListItems = [];
+ var versionTemplateData = {items: []};
for (var v = 0; v < versionItems.length; v++) {
var displayName = ngHelpers.ngNameToDisplayName(path.basename(versionItems[v], ".md"));
@@ -101,25 +99,27 @@ function aggPhase(aggData) {
pageLink = pageLink.replace(/\\/g, '/');
pageLink = pageLink.substr(pageLink.indexOf("docs") + 5);
- versListItems.push(
- unist.makeListItem(
- unist.makeLink(unist.makeText(displayName), pageLink)
- )
- );
+ versionTemplateData.items.push({
+ title: displayName,
+ link: pageLink
+ });
}
- sections.push(unist.makeHeading(unist.makeText(version), 2));
- sections.push(unist.makeListUnordered(versListItems));
+ var mdText = template.render(versionTemplateData);
+ mdText = mdText.replace(/^ +-/mg, "-");
+
+ var newSection = remark().data("settings", {paddedTable: false, gfm: false}).parse(mdText.trim()).children;
+
+ var versSectionName = version.replace(/\./g, "");;
+
+ zone(histFileTree, versSectionName, (startComment, oldSection, endComment) => {
+ newSection.unshift(startComment);
+ newSection.push(endComment);
+ return newSection;
+ });
}
- zone(histFileTree, histSectionName, (startComment, oldSection, endComment) => {
- sections.unshift(startComment);
- sections.push(endComment);
- return sections;
- });
-
- //console.log(JSON.stringify(histFileTree));
- fs.writeFileSync(histFilePath, remark().stringify(histFileTree));
+ fs.writeFileSync(histFilePath, remark().use(frontMatter, {type: 'yaml', fence: '---'}).data("settings", {paddedTable: false, gfm: false}).stringify(histFileTree));
}