How to use the ejs.delimiter function in ejs

To help you get started, we’ve selected a few ejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PlayFab / SDKGenerator / generate.ts View on Github external
/// 
/// 
/// 

var ejs = require("ejs");
var fs = require("fs");
var https = require("https");
var path = require("path");

ejs.delimiter = "\n";

// This is the interface for an internal object withing SdkGenerator, specifically
// all the information needed to build an SDK from a template to a desination, with all flags and inputs
interface IBuildTarget {
    buildFlags: string[], // The flags applied to this build
    destPath: string, // The path to the destination (usually a git repo)
    templateFolder: string, // The SdkGenerator/(targets|privateTemplates)/
    targetMaker: any, // Once loaded, this is the make.js file which executes the SDK Generation
    versionKey: string, // The key in the API_Specs/SdkManualNotes.json file that has the version for this SDK
    versionString: string, // The actual version string, from SdkManualNotes, or from another appropriate input
}

interface IGenConfigFile { [key: string]: IGenConfig; }

// This is the interface of the genConfig.json file at the root of the destination repo
interface IGenConfig {
github hyurl / cool-node / Core / Controllers / Controller.js View on Github external
const path = require("path");
const util = require("util");
const ejs = require("ejs");
const Logger = require("../Tools/Logger");
const MarkdownParser = require("../Tools/MarkdownParser");
const LocalesMap = require("../Bootstrap/LocaleMap");

// Configure EJS delimiter.
if (typeof config.view == "object") {
    ejs.delimiter = config.view.delimiter || "%";
}

/**
 * The Controller give you a common API to return data to the underlying 
 * response context, all controllers will be automatically handled by the 
 * framework, which will save your work from setting HTTP routes and socket 
 * events.
 */
class Controller {
    /**
     * Creates a controller inistance.
     * 
     * @param  {Object}  options  Options for initiation.
     */
    constructor(options) {
        // The subdomain of the current app.
github joshdickson40 / checkyourfollowers-web / app.js View on Github external
var fs 				= require('fs');
var dbConnection 	= require('./database/databasemanager');
var passport 		= require('passport');
var ejs 			= require('ejs');
var morgan       	= require('morgan');
var cookieParser 	= require('cookie-parser');
var session      	= require('express-session');
var MongoStore  	= require('connect-mongo')(session);
var path 			= require('path');
var async 			= require('async');

var User 			= require('./database/user');


// set custom delimiter for ejs to allow underscore templates
ejs.delimiter = '$';

// pass passport for configuration
require('./config/passport')(passport);

// set no www redirect
if(nodeEnvironment == 'production')
	app.use( require('express-force-domain')('https://checkyourfollowers.com') );

// set static files location
app.use(express.static(__dirname + '/public'));

// trust CloudFlare
app.enable('trust proxy');

// add morgan for logging
app.use(morgan('dev'));
github watson-developer-cloud / personality-insights-nodejs / config / express.js View on Github external
module.exports = (app) => {
  app.set('view engine', 'ejs');
  require('ejs').delimiter = '$';
  app.enable('trust proxy');
  app.use(morgan('dev'));

  app.use(cookieParser());
  app.use(expressSession({
    secret: 'demo-' + Math.floor(Math.random() * 2000),
    resave: true,
    saveUninitialized: true
  }));

  // Configure Express
  app.use(bodyParser.urlencoded({extended: true, limit: '15mb'}));
  app.use(bodyParser.json({limit: '15mb'}));
  app.use(express.static(__dirname + '/../public'));
  // make things in node_modules available (basically a replacement for unpkg.com)
  app.use('/vendor', express.static(__dirname + '/../node_modules'));
github PlayFab / SDKGenerator / generate.js View on Github external
/// 
/// 
/// 
var ejs = require("ejs");
var fs = require("fs");
var https = require("https");
var path = require("path");
ejs.delimiter = "\n";
var defaultApiSpecFilePath = "../API_Specs"; // Relative path to Generate.js
var defaultApiSpecGitHubUrl = "https://raw.githubusercontent.com/PlayFab/API_Specs/master";
var defaultApiSpecPlayFabUrl = "https://www.playfabapi.com/apispec";
var tocFilename = "TOC.json";
var tocCacheKey = "TOC";
var specializationTocCacheKey = "specializationTOC";
var defaultSpecialization = "sdk";
var sdkGeneratorGlobals = {
    // Frequently, these are passed by reference to avoid over-use of global variables. Unfortunately, the async nature of loading api files required some global references
    argsByName: {},
    errorMessages: [],
    buildTarget: {
        buildFlags: [],
        destPath: null,
        templateFolder: null,
        targetMaker: null,
github alexyoung / nodejsinaction / ch08-templates / ejs-snippets / delimiter.js View on Github external
const ejs = require('ejs');
ejs.delimiter = '$'
const template = '<$= message $>';
const context = { message: 'Hello template!' };
console.log(ejs.render(template, context));