当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript jade.renderFile函数代码示例

本文整理汇总了TypeScript中jade.renderFile函数的典型用法代码示例。如果您正苦于以下问题:TypeScript renderFile函数的具体用法?TypeScript renderFile怎么用?TypeScript renderFile使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了renderFile函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: generateDefinitionFile

  public generateDefinitionFile(changelog: Changelog, version: string): GeneratedFile {

    return new GeneratedFile(`/${version}/index.html`,
      html.prettyPrint(jade.renderFile(__dirname + "/../../resources/view/index.jade", {
        version: version,
        changelog: changelog,
        api: this
      })));
  }
开发者ID:guedjm,项目名称:api-doc-generator,代码行数:9,代码来源:apiDefinition.ts

示例2: generateRootFile

  public generateRootFile(changelog: Changelog): GeneratedFile {

    return new GeneratedFile("/index.html",
      html.prettyPrint(jade.renderFile(__dirname + "/../../resources/view/root.jade", {
        name: this.name,
        description: this.description,
        versions: changelog.changes
      })));
  }
开发者ID:guedjm,项目名称:api-doc-generator,代码行数:9,代码来源:apiDefinition.ts

示例3: sendMail

    private static sendMail(letter: Letter, billPath: string, callback: (error: Error) => void) {
        var nodemailer = require("nodemailer");
        var jade = require('jade');
        var dateFormat = require('dateformat');

        var prettyPassedToPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");
        var prettyDispatchedByPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");

        var options = { pretty: true,
            invoiceNumber: letter.invoiceNumber,
            serverPath: Config.getBaseUri()
        };

        jade.renderFile(Config.getBasePath()  + '/views/email.jade', options, function (err, html) {
            if (err) {
                callback(err);
                return;
            }
            // create reusable transport method (opens pool of SMTP connections)
            var smtpTransport = Config.getNodemailerTransport();

            var message = "Please see the HTML Version of this email for more information.";
            // setup e-mail data with unicode symbols
            var mailOptions = {
                from: "hello@milsapp.com", // sender address
                to: letter.issuer.email, // list of receivers
                subject: "Mils Billing", // Subject line
                text: message, // plaintext body
                html: html, // html body,
                attachments : [{fileName: 'Invoice.pdf', filePath: billPath}] // TODO: Check whether this is correct
            };

            // send mail with defined transport object
            smtpTransport.sendMail(mailOptions, function(error, response){
                // if you don't want to use this transport object anymore, uncomment following line
                smtpTransport.close(); // shut down the connection pool, no more messages
                callback(error);
            });
        });
    }
开发者ID:arein,项目名称:Mils-Server,代码行数:40,代码来源:BillHelper.ts

示例4: notifyCustomerViaEmail

    public static notifyCustomerViaEmail(letter: Letter, callback: (error: Error) => void) {
        var nodemailer = require("nodemailer");
        var jade = require('jade');
        var dateFormat = require('dateformat');

        var prettyPassedToPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");
        var prettyDispatchedByPrintingProviderAt = dateFormat(letter.printInformation.passedToPrintingProviderAt, "shortDate");

        var options = { pretty: true,
            destination: letter.recipient.countryIso,
            passedToPrintingProviderAt: prettyPassedToPrintingProviderAt,
            dispatchedByPrintingProviderAt: prettyDispatchedByPrintingProviderAt,
            serverPath: Config.getBaseUri()
        };

        jade.renderFile(Config.getBasePath()  + '/views/dispatched_email.jade', options, function (err, html) {
            if (err) throw err;
            // create reusable transport method (opens pool of SMTP connections)
            var smtpTransport = Config.getNodemailerTransport();

            var message = "Your letter to " + letter.recipient.countryIso + " from " + prettyPassedToPrintingProviderAt + " was dispatched at " + prettyDispatchedByPrintingProviderAt;
            // setup e-mail data with unicode symbols
            var mailOptions = {
                from: "hello@milsapp.com", // sender address
                to: letter.issuer.email, // list of receivers
                subject: "Your Letter was Dispatched", // Subject line
                text: message, // plaintext body
                html: html // html body
            };

            // send mail with defined transport object
            smtpTransport.sendMail(mailOptions, function(error, response){
                // if you don't want to use this transport object anymore, uncomment following line
                smtpTransport.close(); // shut down the connection pool, no more messages
                callback(error);
            });
        });
    }
开发者ID:arein,项目名称:Mils-Server,代码行数:38,代码来源:NotificationManager.ts

示例5: render

export function render(req, res, next) {
    if (res.form) {
        res.html = {content : jade.renderFile(path.join(__dirname, './form.jade'), { form: res.form })};
    }
    next();
}
开发者ID:srikanthdarmapuri,项目名称:cms-forms,代码行数:6,代码来源:index.ts

示例6: sendResetPassword

 sendResetPassword(data, callback){
     data.logo_url = config.dns + '/public/images/logo.png'; 
     let html = jade.renderFile('./lib/email-templates/reset-password.jade', data);
     this.send('Reset your account password for yummlet.com', html, From.ADMIN_YUMMLET, data.email, callback);
 }
开发者ID:zaksie,项目名称:gotouch,代码行数:5,代码来源:mailer.ts

示例7: sendActivation

 sendActivation(data, callback) {
     data.logo_url = config.dns + '/public/images/logo.png'; 
     let html = jade.renderFile('./lib/email-templates/activation.jade', data);
     this.send('Activate your account at yummlet.com', html, From.ADMIN_YUMMLET, data.email, callback);
 }
开发者ID:zaksie,项目名称:gotouch,代码行数:5,代码来源:mailer.ts

示例8: render

export function render(req : Request, res : Response, next) {
    if(res.grid) {
        res.html = Object.assign({content : jade.renderFile(join(__dirname,'grid.jade'), {grid: res.grid})}, res.html);
    }
    return next();
}
开发者ID:rajivnarayana,项目名称:cms-grids,代码行数:6,代码来源:index.ts

示例9:

import * as jade from 'jade';

jade.compile("b")();
jade.compileFile("foo.jade", {})();
jade.compileClient("a")({ a: 1 });
jade.compileClientWithDependenciesTracked("test").body();
jade.render("h1", {});
jade.renderFile("foo.jade");
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:8,代码来源:jade-tests.ts


注:本文中的jade.renderFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。