build(aio): do not fail on bad examples when running `docs-watch`

This commit is contained in:
Peter Bacon Darwin 2017-10-30 21:26:37 +00:00 committed by Victor Berchet
parent 3a03ff6b2d
commit 1beab0da6a
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,7 @@ const { CONTENTS_PATH, GUIDE_EXAMPLES_PATH } = require('../config');
module.exports = new Package('angular-content', [basePackage, contentPackage]) module.exports = new Package('angular-content', [basePackage, contentPackage])
// Where do we get the source files? // 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 gitignoreFilePath = path.resolve(GUIDE_EXAMPLES_PATH, '.gitignore');
const gitignoreFile = fs.readFileSync(gitignoreFilePath, 'utf8'); const gitignoreFile = fs.readFileSync(gitignoreFilePath, 'utf8');
@ -81,6 +81,8 @@ module.exports = new Package('angular-content', [basePackage, contentPackage])
collectExamples.exampleFolders.push('examples'); collectExamples.exampleFolders.push('examples');
collectExamples.registerIgnoredExamples(ignoredExamplePaths, gitignoreFilePath); collectExamples.registerIgnoredExamples(ignoredExamplePaths, gitignoreFilePath);
renderExamples.ignoreBrokenExamples = true;
}) })

View File

@ -25,7 +25,7 @@ module.exports = new Package('angular.io', [gitPackage, apiPackage, contentPacka
renderDocsProcessor.extraData.versionInfo = versionInfo; renderDocsProcessor.extraData.versionInfo = versionInfo;
}) })
.config(function(checkAnchorLinksProcessor, linkInlineTagDef) { .config(function(checkAnchorLinksProcessor, linkInlineTagDef, renderExamples) {
// Fail the processing if there is an invalid link // Fail the processing if there is an invalid link
linkInlineTagDef.failOnBadLink = true; 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.pathVariants = ['', '/', '.html', '/index.html', '#top-of-page'];
checkAnchorLinksProcessor.errorOnUnmatchedLinks = true; checkAnchorLinksProcessor.errorOnUnmatchedLinks = true;
// Make sure we fail if the examples are not right
renderExamples.ignoreBrokenExamples = false;
}) })
.config(function(renderLinkInfo, postProcessHtml) { .config(function(renderLinkInfo, postProcessHtml) {