From fed3fd076eb069f5805128415b91f3582f4ca830 Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Wed, 30 May 2012 21:15:29 +0100 Subject: [PATCH] Clarified docs around creating and invoking custom templates. Closes issue #120 --- templates/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 templates/README.md diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 00000000..fbdd7dbf --- /dev/null +++ b/templates/README.md @@ -0,0 +1,20 @@ +To create or use your own template, create a folder, and give it the name of your template, for example "mycooltemplate". Within this folder create a file named "publish.js". That file must define a global method named "publish". For example: + +````javascript +/** + * Turn the data about your docs into file output. + * @global + * @param {TAFFY} data - A TaffyDB collection representing + * all the symbols documented in your code. + * @param {object} opts - An object with options information. + */ +function publish(data, opts) { + // do stuff here to generate your output files +} +```` + +To invoke JSDoc 3 with your own template, use the `-t` command line option, giving it the path to your template folder. + +```` +./jsdoc mycode.js -t /path/to/mycooltemplate +```` \ No newline at end of file