[ADF-2643] Added compatibility info to version index (#3218)

* [ADF-1643] Updated version index and script to support compatibility info

* [ADF-2643] Added links and compatibility info
This commit is contained in:
Andy Stark
2018-04-19 16:20:00 +01:00
committed by Eugenio Romano
parent fbe675aedb
commit e0cc0fc7c5
3 changed files with 81 additions and 34 deletions

View File

@@ -1,10 +1,8 @@
# Version Index # Version Index
This file contains a list of components grouped according to the Below are the details of all released versions of ADF since general
ADF version in which they were introduced. See the availability (v2.0.0). See the [main index page](README.md) for a list
[main index page](README.md) for a list organized by ADF libraries. of components organized by ADF libraries.
<!--history start-->
## Versions ## Versions
@@ -15,6 +13,14 @@ ADF version in which they were introduced. See the
## v2.3.0 ## v2.3.0
**Released:** 2018-04-17 ([Release notes](https://community.alfresco.com/docs/DOC-7347-adf-230-release-note))<br/>
**APS compatible version:** v1.6.4+<br/>
**ACS compatible version:** v5.2.3<br/>
### Components added
<!--v230 start-->
- [Comment content service](core/comment-content.service.md) - [Comment content service](core/comment-content.service.md)
- [Custom resources service](content-services/custom-resources.service.md) - [Custom resources service](content-services/custom-resources.service.md)
- [Inherited button directive](content-services/inherited-button.directive.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) - [Sidenav layout component](core/sidenav-layout.component.md)
- [Upload version button component](content-services/upload-version-button.component.md) - [Upload version button component](content-services/upload-version-button.component.md)
<!--v230 end-->
([Back to top](#versions))
## v2.2.0 ## v2.2.0
**Released:** 2018-03-05 ([Release notes](https://community.alfresco.com/docs/DOC-7318-adf-220-release-note))<br/>
**APS compatible version:** v1.6.4+<br/>
**ACS compatible version:** v5.2.2<br/>
### Components added
<!--v220 start-->
- [Node download directive](content-services/node-download.directive.md) - [Node download directive](content-services/node-download.directive.md)
- [Node lock directive](content-services/node-lock.directive.md) - [Node lock directive](content-services/node-lock.directive.md)
<!--v220 end-->
([Back to top](#versions))
## v2.1.0 ## v2.1.0
**Released:** 2018-01-29 ([Release notes](https://community.alfresco.com/docs/DOC-7292-adf-210-release-note))<br/>
**APS compatible version:** v1.6.4+<br/>
**ACS compatible version:** v5.2.2<br/>
### Components added
<!--v210 start-->
- [Content metadata component](content-services/content-metadata.component.md) - [Content metadata component](content-services/content-metadata.component.md)
- [Content node dialog service](content-services/content-node-dialog.service.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) - [Content node selector panel component](content-services/content-node-selector-panel.component.md)
- [Search configuration service](core/search-configuration.service.md) - [Search configuration service](core/search-configuration.service.md)
- [Sidebar action menu component](core/sidebar-action-menu.component.md) - [Sidebar action menu component](core/sidebar-action-menu.component.md)
<!--v210 end-->
([Back to top](#versions))
## v2.0.0 ## v2.0.0
**Released:** 2017-12-04 ([Release notes](https://community.alfresco.com/docs/DOC-7244-adf-200-release-note))<br/>
**APS compatible version:** v1.6.4+<br/>
**ACS compatible version:** v5.2.2<br/>
### Components added
<!--v200 start-->
- [Accordion group component](core/accordion-group.component.md) - [Accordion group component](core/accordion-group.component.md)
- [Accordion component](core/accordion.component.md) - [Accordion component](core/accordion.component.md)
- [Activiti alfresco service](core/activiti-alfresco.service.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) - [Webscript component](content-services/webscript.component.md)
- [Widget component](insights/widget.component.md) - [Widget component](insights/widget.component.md)
<!--history end--> <!--v200 end-->
([Back to top](#versions))

View File

@@ -0,0 +1,3 @@
{% each items as item %}
- [{{item.title}}]({{item.link}})
{% endeach %}

View File

@@ -5,6 +5,9 @@ var yaml = require("js-yaml");
var remark = require("remark"); var remark = require("remark");
var stringify = require("remark-stringify"); var stringify = require("remark-stringify");
var zone = require("mdast-zone"); var zone = require("mdast-zone");
var frontMatter = require("remark-frontmatter");
var combyne = require("combyne");
var unist = require("../unistHelpers"); var unist = require("../unistHelpers");
var ngHelpers = require("../ngHelpers"); var ngHelpers = require("../ngHelpers");
@@ -25,13 +28,15 @@ var histFilePath = path.resolve(docsFolderPath, "versionIndex.md");
var histSectionName = "history"; var histSectionName = "history";
var initialVersion = "v2.0.0"; var initialVersion = "v2.0.0";
var templateFolder = path.resolve(".", "config", "DocProcessor", "templates");
function initPhase(aggData) { function initPhase(aggData) {
aggData.versions = { "v2.0.0":[] }; aggData.versions = { "v2.0.0":[] };
} }
function readPhase(tree, pathname, aggData) { 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))/; var angNameRegex = /([a-zA-Z0-9\-]+)\.((component)|(directive)|(model)|(pipe)|(service)|(widget))/;
if (!compName.match(angNameRegex)) if (!compName.match(angNameRegex))
@@ -60,7 +65,7 @@ function readPhase(tree, pathname, aggData) {
function aggPhase(aggData) { function aggPhase(aggData) {
var histFileText = fs.readFileSync(histFilePath, "utf8"); 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); var keys = Object.keys(aggData.versions);
keys.sort((a, b) => { keys.sort((a, b) => {
@@ -72,16 +77,9 @@ function aggPhase(aggData) {
return 0; return 0;
}); });
var sections = [unist.makeHeading(unist.makeText("Versions"), 2)]; var templateName = path.resolve(templateFolder, "versIndex.combyne");
var templateSource = fs.readFileSync(templateName, "utf8");
var vListItems = []; var template = combyne(templateSource);
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));
for (var i = 0; i < keys.length; i++) { for (var i = 0; i < keys.length; i++) {
var version = keys[i]; var version = keys[i];
@@ -93,7 +91,7 @@ function aggPhase(aggData) {
return aa.localeCompare(bb); return aa.localeCompare(bb);
}); });
var versListItems = []; var versionTemplateData = {items: []};
for (var v = 0; v < versionItems.length; v++) { for (var v = 0; v < versionItems.length; v++) {
var displayName = ngHelpers.ngNameToDisplayName(path.basename(versionItems[v], ".md")); var displayName = ngHelpers.ngNameToDisplayName(path.basename(versionItems[v], ".md"));
@@ -101,25 +99,27 @@ function aggPhase(aggData) {
pageLink = pageLink.replace(/\\/g, '/'); pageLink = pageLink.replace(/\\/g, '/');
pageLink = pageLink.substr(pageLink.indexOf("docs") + 5); pageLink = pageLink.substr(pageLink.indexOf("docs") + 5);
versListItems.push( versionTemplateData.items.push({
unist.makeListItem( title: displayName,
unist.makeLink(unist.makeText(displayName), pageLink) link: pageLink
)
);
}
sections.push(unist.makeHeading(unist.makeText(version), 2));
sections.push(unist.makeListUnordered(versListItems));
}
zone(histFileTree, histSectionName, (startComment, oldSection, endComment) => {
sections.unshift(startComment);
sections.push(endComment);
return sections;
}); });
}
//console.log(JSON.stringify(histFileTree)); var mdText = template.render(versionTemplateData);
fs.writeFileSync(histFilePath, remark().stringify(histFileTree)); 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;
});
}
fs.writeFileSync(histFilePath, remark().use(frontMatter, {type: 'yaml', fence: '---'}).data("settings", {paddedTable: false, gfm: false}).stringify(histFileTree));
} }