From 63937743554e6110ec88288b248edc571c7cde27 Mon Sep 17 00:00:00 2001 From: Jay Traband Date: Sat, 17 Oct 2015 18:52:30 -0700 Subject: [PATCH] Track and warn about "Not yet documented" pages and also add "Not Yet Documented" to the top of these pages. --- .../templates/class.template.html | 4 ++++ .../angular.io-package/templates/var.template.html | 4 ++++ .../processors/readTypeScriptModules.js | 13 ++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/public/api-builder/angular.io-package/templates/class.template.html b/public/api-builder/angular.io-package/templates/class.template.html index 9db96ff52c..9c548a145d 100644 --- a/public/api-builder/angular.io-package/templates/class.template.html +++ b/public/api-builder/angular.io-package/templates/class.template.html @@ -9,7 +9,11 @@ p.location-badge. defined in {$ githubViewLink(doc) $} :markdown +{%- if doc.notYetDocumented %} + ### *Not Yet Documented* +{% else %} {$ doc.description | indentForMarkdown(2) | trimBlankLines $} +{% endif -%} {%- if doc.decorators %} .l-main-section diff --git a/public/api-builder/angular.io-package/templates/var.template.html b/public/api-builder/angular.io-package/templates/var.template.html index ec08f47261..0d9850823a 100644 --- a/public/api-builder/angular.io-package/templates/var.template.html +++ b/public/api-builder/angular.io-package/templates/var.template.html @@ -9,5 +9,9 @@ include ../../_util-fns defined in {$ githubViewLink(doc) $} :markdown +{%- if doc.notYetDocumented %} + ### *Not Yet Documented* +{% else %} {$ doc.description | indentForMarkdown(4) | trimBlankLines $} +{% endif -%} {% endblock %} diff --git a/public/api-builder/typescript-package/processors/readTypeScriptModules.js b/public/api-builder/typescript-package/processors/readTypeScriptModules.js index 56e3bf6498..979edd14b0 100644 --- a/public/api-builder/typescript-package/processors/readTypeScriptModules.js +++ b/public/api-builder/typescript-package/processors/readTypeScriptModules.js @@ -4,7 +4,7 @@ var _ = require('lodash'); var ts = require('typescript'); module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, - getExportDocType, getContent, log) { + getExportDocType, getContent, createDocMessage, log) { return { $runAfter: ['files-read'], @@ -126,6 +126,17 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, } } + // NotYetDocumented means that no top level comments and no member level comments + var notYetDocumented = exportDoc.content.trim().length == 0; + exportDoc.notYetDocumented = notYetDocumented && exportDoc.members.every(function(member) { + var content = member.content.trim(); + return content.length == 0; + }); + + if (exportDoc.notYetDocumented) { + log.warn(createDocMessage("Not yet documented", exportDoc)); + } + if (sortClassMembers) { exportDoc.members.sort(function(a, b) { if (a.name > b.name) return 1;