diff --git a/docs/docassets/images/accordion-menu.png b/docs/docassets/images/accordion-menu.png deleted file mode 100644 index 1b1fc29075..0000000000 Binary files a/docs/docassets/images/accordion-menu.png and /dev/null differ diff --git a/docs/docassets/images/folder-actions.png b/docs/docassets/images/folder-actions.png deleted file mode 100644 index 01e14aa208..0000000000 Binary files a/docs/docassets/images/folder-actions.png and /dev/null differ diff --git a/docs/docassets/images/how-to-create-accordion-menu.png b/docs/docassets/images/how-to-create-accordion-menu.png deleted file mode 100644 index 039a6bd4c5..0000000000 Binary files a/docs/docassets/images/how-to-create-accordion-menu.png and /dev/null differ diff --git a/docs/docassets/images/upload-disable-button.png b/docs/docassets/images/upload-disable-button.png deleted file mode 100644 index 1907435b36..0000000000 Binary files a/docs/docassets/images/upload-disable-button.png and /dev/null differ diff --git a/docs/insights/analytics.component.md b/docs/insights/analytics.component.md index 07ec4614c0..c2049bef1d 100644 --- a/docs/insights/analytics.component.md +++ b/docs/insights/analytics.component.md @@ -8,7 +8,7 @@ Status: Active Shows the charts related to the reportId passed as input -![Analytics-without-parameters](docassets/images/analytics-without-parameters.png) +![Analytics-without-parameters](../docassets/images/analytics-without-parameters.png) ## Basic Usage diff --git a/docs/tutorials/creating-your-first-adf-application.md b/docs/tutorials/creating-your-first-adf-application.md index ea8c4ca1e0..19317f9724 100644 --- a/docs/tutorials/creating-your-first-adf-application.md +++ b/docs/tutorials/creating-your-first-adf-application.md @@ -108,5 +108,5 @@ Congratulations! You're now ready to start developing your first ADF application In the next tutorial you will explore how you can extend, use and configure ADF Components by customizing the login screen. -* [Extend, use and configure ADF Components](customising-login.md) +* [Extend, use and configure ADF Components](using-components.md) \ No newline at end of file diff --git a/docs/tutorials/working-with-nodes-api-service.md b/docs/tutorials/working-with-nodes-api-service.md index 7fbe1c45e9..a3b5b769e2 100644 --- a/docs/tutorials/working-with-nodes-api-service.md +++ b/docs/tutorials/working-with-nodes-api-service.md @@ -161,7 +161,7 @@ myOnFolderNodeDoubleClick(nodeId) { Now, the user experience changes if you click on a folder node (but not a content node) in the browser's console you will see something like the following screenshot: -![nodesapiservices_nodeList](../docassets/images/nodesapiservices_nodeList.png) +![nodesapiservices_nodeList](../docassets/images/nodesapiservices_nodelist.png) ## Creating and deleting a subfolder diff --git a/tools/doc/doctool.config.json b/tools/doc/doctool.config.json index 2cc0c13050..d5f6c4a6d5 100644 --- a/tools/doc/doctool.config.json +++ b/tools/doc/doctool.config.json @@ -21,7 +21,7 @@ "toc" ], "dev": [ - "sourceLinker" + "fileChecker" ] }, "statusIcons": { @@ -141,5 +141,12 @@ "external-alfresco", "content-node-share", "tree-view" + ], + "fileCheckerFilter": [ + "README", + "release-notes", + "tutorials", + "user-guide", + "versionIndex" ] } \ No newline at end of file diff --git a/tools/doc/tools/fileChecker.js b/tools/doc/tools/fileChecker.js new file mode 100644 index 0000000000..16289940cc --- /dev/null +++ b/tools/doc/tools/fileChecker.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var fs = require("fs"); +var unist_util_select_1 = require("unist-util-select"); +var ngHelpers = require("../ngHelpers"); +//const angFilenameRegex = /([a-zA-Z0-9\-]+)\.((component)|(directive)|(interface)|(model)|(pipe)|(service)|(widget))/; +var imageFolderPath = path.resolve('docs', 'docassets', 'images'); +function processDocs(mdCache, aggData, errorMessages) { + var pathnames = Object.keys(mdCache); + var classlessDocs = []; + var linkRefs = {}; + var imageRefs = {}; + var filters = makeFilepathFilters(aggData.config["fileCheckerFilter"]); + pathnames.forEach(function (pathname) { + var fileBaseName = path.basename(pathname, '.md'); + var tree = mdCache[pathname].mdOutTree; + var className = ngHelpers.ngNameToClassName(fileBaseName, aggData.config.typeNameExceptions); + var classInfo = aggData.classInfo[className]; + if (!classInfo) { + if (!filterFilepath(filters, pathname)) { + classlessDocs.push(pathname); + } + } + else { + var linkElems = unist_util_select_1.selectAll('link', tree); + linkElems.forEach(function (linkElem) { + var normUrl = normaliseLinkPath(pathname, linkElem.url); + if (linkRefs[normUrl]) { + linkRefs[normUrl].push(pathname); + } + else { + linkRefs[normUrl] = [pathname]; + } + }); + } + var imageElems = unist_util_select_1.selectAll('image', tree); + imageElems.forEach(function (imageElem) { + var normUrl = normaliseLinkPath(pathname, imageElem.url); + if (imageRefs[normUrl]) { + imageRefs[normUrl].push(pathname); + } + else { + imageRefs[normUrl] = [pathname]; + } + }); + }); + classlessDocs.forEach(function (docPath) { + var relDocPath = docPath.substring(docPath.indexOf('docs')); + console.group("Warning: no source class found for \"" + relDocPath + "\""); + if (linkRefs[docPath]) { + linkRefs[docPath].forEach(function (linkRef) { + var relLinkPath = linkRef.substring(linkRef.indexOf('docs')); + console.log("Linked from: \"" + relLinkPath + "\""); + }); + } + console.groupEnd(); + }); + var imagePaths = getImagePaths(imageFolderPath); + imagePaths.forEach(function (imagePath) { + if (!imageRefs[imagePath]) { + var relImagePath = imagePath.substring(imagePath.indexOf('docs')); + console.log("Warning: no links to image file \"" + relImagePath + "\""); + } + }); +} +exports.processDocs = processDocs; +function normaliseLinkPath(homeFilePath, linkUrl) { + var homeFolder = path.dirname(homeFilePath); + return path.resolve(homeFolder, linkUrl); +} +function getImagePaths(imageFolder) { + var files = fs.readdirSync(imageFolder); + return files.map(function (f) { return path.resolve(imageFolder, f); }); +} +function makeFilepathFilters(regexes) { + return regexes.map(function (r) { return new RegExp(r); }); +} +function filterFilepath(filters, filepath) { + for (var i = 0; i < filters.length; i++) { + if (filters[i].test(filepath)) { + return true; + } + } + return false; +} diff --git a/tools/doc/tools/fileChecker.ts b/tools/doc/tools/fileChecker.ts new file mode 100644 index 0000000000..b52b2f2cd0 --- /dev/null +++ b/tools/doc/tools/fileChecker.ts @@ -0,0 +1,109 @@ +import * as path from "path"; +import * as fs from "fs"; + +import { select, selectAll } from "unist-util-select"; + +import * as ngHelpers from "../ngHelpers"; + + +//const angFilenameRegex = /([a-zA-Z0-9\-]+)\.((component)|(directive)|(interface)|(model)|(pipe)|(service)|(widget))/; +const imageFolderPath = path.resolve('docs', 'docassets', 'images'); + + +export function processDocs(mdCache, aggData, errorMessages) { + var pathnames = Object.keys(mdCache); + + let classlessDocs = []; + let linkRefs = {}; + let imageRefs = {}; + + let filters = makeFilepathFilters(aggData.config["fileCheckerFilter"]); + + pathnames.forEach(pathname => { + + let fileBaseName = path.basename(pathname, '.md'); + let tree = mdCache[pathname].mdOutTree; + let className = ngHelpers.ngNameToClassName(fileBaseName, aggData.config.typeNameExceptions); + let classInfo = aggData.classInfo[className]; + + if (!classInfo) { + if (!filterFilepath(filters, pathname)) { + classlessDocs.push(pathname); + } + } else { + let linkElems = selectAll('link', tree); + + linkElems.forEach(linkElem => { + let normUrl = normaliseLinkPath(pathname, linkElem.url); + + if (linkRefs[normUrl]) { + linkRefs[normUrl].push(pathname); + } else { + linkRefs[normUrl] = [ pathname ]; + } + }); + } + + let imageElems = selectAll('image', tree); + + imageElems.forEach(imageElem => { + let normUrl = normaliseLinkPath(pathname, imageElem.url); + + if (imageRefs[normUrl]) { + imageRefs[normUrl].push(pathname); + } else { + imageRefs[normUrl] = [ pathname ]; + } + }); + }); + + classlessDocs.forEach(docPath => { + let relDocPath = docPath.substring(docPath.indexOf('docs')); + console.group(`Warning: no source class found for "${relDocPath}"`); + + if (linkRefs[docPath]) { + linkRefs[docPath].forEach(linkRef => { + let relLinkPath = linkRef.substring(linkRef.indexOf('docs')); + console.log(`Linked from: "${relLinkPath}"`); + }); + } + + console.groupEnd(); + }); + + let imagePaths = getImagePaths(imageFolderPath); + + imagePaths.forEach(imagePath => { + if (!imageRefs[imagePath]) { + let relImagePath = imagePath.substring(imagePath.indexOf('docs')); + console.log(`Warning: no links to image file "${relImagePath}"`); + } + }); +} + + +function normaliseLinkPath(homeFilePath, linkUrl) { + let homeFolder = path.dirname(homeFilePath); + return path.resolve(homeFolder, linkUrl); +} + + +function getImagePaths(imageFolder) { + let files = fs.readdirSync(imageFolder); + return files.map(f => path.resolve(imageFolder, f)); +} + + +function makeFilepathFilters(regexes: string[]) { + return regexes.map(r => new RegExp(r)); +} + + +function filterFilepath(filters: RegExp[], filepath: string): boolean { + for (let i = 0; i < filters.length; i++) { + if (filters[i].test(filepath)) { + return true + } + } + return false; +} \ No newline at end of file