From 1beab0da6a3cd0b90660538489e4c65cb8674815 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Mon, 30 Oct 2017 21:26:37 +0000 Subject: [PATCH] build(aio): do not fail on bad examples when running `docs-watch` --- aio/tools/transforms/angular-content-package/index.js | 4 +++- aio/tools/transforms/angular.io-package/index.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/aio/tools/transforms/angular-content-package/index.js b/aio/tools/transforms/angular-content-package/index.js index 1a4b57c8a0..fc9c21e045 100644 --- a/aio/tools/transforms/angular-content-package/index.js +++ b/aio/tools/transforms/angular-content-package/index.js @@ -18,7 +18,7 @@ const { CONTENTS_PATH, GUIDE_EXAMPLES_PATH } = require('../config'); module.exports = new Package('angular-content', [basePackage, contentPackage]) // Where do we get the source files? - .config(function(readFilesProcessor, collectExamples) { + .config(function(readFilesProcessor, collectExamples, renderExamples) { const gitignoreFilePath = path.resolve(GUIDE_EXAMPLES_PATH, '.gitignore'); const gitignoreFile = fs.readFileSync(gitignoreFilePath, 'utf8'); @@ -81,6 +81,8 @@ module.exports = new Package('angular-content', [basePackage, contentPackage]) collectExamples.exampleFolders.push('examples'); collectExamples.registerIgnoredExamples(ignoredExamplePaths, gitignoreFilePath); + + renderExamples.ignoreBrokenExamples = true; }) diff --git a/aio/tools/transforms/angular.io-package/index.js b/aio/tools/transforms/angular.io-package/index.js index 538a15fb85..f758a5184a 100644 --- a/aio/tools/transforms/angular.io-package/index.js +++ b/aio/tools/transforms/angular.io-package/index.js @@ -25,7 +25,7 @@ module.exports = new Package('angular.io', [gitPackage, apiPackage, contentPacka renderDocsProcessor.extraData.versionInfo = versionInfo; }) - .config(function(checkAnchorLinksProcessor, linkInlineTagDef) { + .config(function(checkAnchorLinksProcessor, linkInlineTagDef, renderExamples) { // Fail the processing if there is an invalid link linkInlineTagDef.failOnBadLink = true; @@ -48,6 +48,10 @@ module.exports = new Package('angular.io', [gitPackage, apiPackage, contentPacka }); checkAnchorLinksProcessor.pathVariants = ['', '/', '.html', '/index.html', '#top-of-page']; checkAnchorLinksProcessor.errorOnUnmatchedLinks = true; + + // Make sure we fail if the examples are not right + renderExamples.ignoreBrokenExamples = false; + }) .config(function(renderLinkInfo, postProcessHtml) {