Example #1
0
  getHtml: function(template, cv) {
        var obj = new EJS.compile(template.html);
        var body = obj({cv: cv});

        var html = '<!DOCTYPE html><html><head><link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" /><style type="text/css">' +  template.css + '</style></head><body>' + body + '<script src="/bootstrap/js/jquery-2.1.4.min.js" type="text/javascript"></script><script src="/bootstrap/js/bootstrap.min.js" type="text/javascript"></body></html>';
        console.log(html);

    return html;
  }
Example #2
0
'use strict';
/*!
 * Dependencies
 * --------------------------------------------------------------------------*/

var fs = require('fs'),
    path = require('path'),
    semver = require('semver'),
    ejs = require('ejs'),
    _ = require('lodash');

var parseJSON = JSON.parse.bind(JSON);
var compileEjs = ejs.compile.bind(ejs);

exports = module.exports = apidocMarkdown;

var DEFAULT_TEMPLATE_PATH = path.join(__dirname, '..', 'templates', 'default.md');

/**
 * Reads the apidoc data files and returns a string representation of it passed
 * through a markdown ejs template.
 *
 * @api public
 * @param {String} dataPath The path to `api_data.json`
 * @param {String} projectPath The path to `api_project.json`
 * @param {String} [templatePath=templates/default.md] The path to the `ejs`
 * template to use
 * @param {String} [prependPath] The path to the `prepend` file - supposedly
 * used by the template to add text before the generated documentation
 * @return {String} markdown The resulting markdown string
 */