• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript jade.renderFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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: "[email protected]", // 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: "[email protected]", // 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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript jasmine.addReporter函数代码示例发布时间:2022-05-25
下一篇:
TypeScript jade.compileFile函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap