doc-templater icon indicating copy to clipboard operation
doc-templater copied to clipboard

How to use on a new project?

Open albertpeiro opened this issue 7 years ago • 1 comments

I have a Sails app, and want to use this module to compile the documentation living in a different repo.

How can I achieve this?

The example provided doesn't seem to work for me :(

/**
 * DocumentationController
 *
 * @description :: Server-side logic for managing authentication
 * @help        :: See http://links.sailsjs.org/docs/controllers
 */

module.exports = {

  'refresh': function (req, res) {
    require('doc-templater')().build({
      remote: '[email protected]:balderdashy/sails-docs.git',
      remoteSubPath: '',
      branch: 'master',
      cachePath: '/.tmp/doc/cache',
      htmlDirPath: '/.tmp/doc/html',
      jsMenuPath: '/.tmp/doc.jsmenu'
    }, function (err,result) {
      // If something went wrong...
      if (err) {
        console.log('ERROR:\n',require('util').inspect(err, false, null));
        return;
      }

      // Otherwise, it worked!
      console.log('RESULT:\n',require('util').inspect(result, false, null));
    });
  },

};

Output

RESULT:
 []

I've also looked at the sails-website repo and the ones used to build documentation and can't figure how to use it, since it's all obfuscated by what seems like treeline machines.

Update: just tried this example as is, and it doesn't work either: https://github.com/uncletammy/doc-templater/blob/master/example/compile.js Output:

Metadata concerning the compiled template hierarchy: []

Thank you!

albertpeiro avatar Jul 27 '17 17:07 albertpeiro

Example: (work in progress) https://github.com/fleetdm/fleet/pull/827

mikermcneil avatar May 21 '21 09:05 mikermcneil