From 120c32c52cd606214e5d497de40ff2454657b4f7 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Sun, 10 May 2015 10:17:21 -0700 Subject: [PATCH] [Docs] Don't show copyright/flow on APIs without docblock --- website/jsdocs/jsdocs.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/website/jsdocs/jsdocs.js b/website/jsdocs/jsdocs.js index 3f7cb953e..086ad2966 100644 --- a/website/jsdocs/jsdocs.js +++ b/website/jsdocs/jsdocs.js @@ -105,10 +105,20 @@ function getFileDocBlock(commentsForFile) { commentsForFile.some(function(comment, i) { if (comment.loc.start.line === 1) { var lines = comment.value.split('\n'); + var inCopyrightBlock = false; var filteredLines = lines.filter(function(line) { - var hasCopyright = !!line.match(/^\s*\*\s+Copyright/); + if (!!line.match(/^\s*\*\s+Copyright \(c\)/)) { + inCopyrightBlock = true; + } + var hasProvides = !!line.match(/^\s*\*\s+@provides/); - return !hasCopyright && !hasProvides; + var hasFlow = !!line.match(/^\s*\*\s+@flow/); + + if (hasFlow || hasProvides) { + inCopyrightBlock = false; + } + + return !inCopyrightBlock && !hasFlow && !hasProvides; }); docblock = filteredLines.join('\n'); return true;