Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use on a new project? #7

Open
albertpeiro opened this issue Jul 27, 2017 · 1 comment
Open

How to use on a new project? #7

albertpeiro opened this issue Jul 27, 2017 · 1 comment

Comments

@albertpeiro
Copy link

albertpeiro commented Jul 27, 2017

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!

@mikermcneil
Copy link
Collaborator

Example: (work in progress) fleetdm/fleet#827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants