From 67d369321430578e5908ab185de46bef7aa6488a Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Wed, 24 Feb 2016 14:28:53 -0800 Subject: [PATCH] Create silent template This commit creates a template named `silent` which outputs nothing at all. As discussed in the `README.md`, this can be useful when running JSDoc as a linter to check for syntax errors or unknown tags. It may also be useful for testing or benchmarking. The same effect can be achieved using the haruki template and redirecting the output to /dev/null, but this has a few downsides: * It is non-obvious. * It is difficult to do in scripts which must run in bash and cmd.exe (like npm scripts). * It is slower due to the unnecessary formatting work and output syscalls. This template could be distributed as a third-party template, but given the tiny code size, broad applicability, and potential usefulness for tests, it makes sense to include it officially. Signed-off-by: Kevin Locke --- templates/silent/README.md | 11 +++++++++++ templates/silent/publish.js | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 templates/silent/README.md create mode 100644 templates/silent/publish.js diff --git a/templates/silent/README.md b/templates/silent/README.md new file mode 100644 index 00000000..d33e0fdf --- /dev/null +++ b/templates/silent/README.md @@ -0,0 +1,11 @@ +OVERVIEW +======== + +The `silent` template outputs nothing at all. Why would that be useful? Primarily for running JSDoc as a linter to check for syntax errors and unrecognized tags in documentation comments, although it may also be useful for testing or benchmarking purposes. + +USAGE +===== + + ./jsdoc myscript.js -t templates/silent -a all --pedantic + +This command exits with a non-zero exit code if any errors are encountered. It writes nothing to disk and the only output it produces is any error messages written to `stderr`. This command can also be used to warn about tags which are unknown to JSDoc by setting `"allowUnknownTags": false` in a configuration file. diff --git a/templates/silent/publish.js b/templates/silent/publish.js new file mode 100644 index 00000000..572f6b84 --- /dev/null +++ b/templates/silent/publish.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + @param {TAFFY} taffyData See . + @param {object} opts + @param {Tutorial} tutorials + */ +exports.publish = function(taffyData, opts, tutorials) {};