Skip to content

How to use on a new project? #7

Description

@albertpeiro

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: 'git@github.com: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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions