Exemple #1
0
 treeForPublic: function(tree) {
   var existingPaths = this.svgPaths().filter(function(path) {
     return fs.existsSync(path);
   });
 
   var svgTrees = existingPaths.map(function(path) {
     return new Funnel(path, {
       include: [new RegExp(/\.svg$/)]
     });
   });
 
   var svgs = mergeTrees(svgTrees, {
     overwrite: true
   });
 
   var optimized = this.optimizeSVGs(svgs);
 
   var manifest = flatiron(optimized, {
     outputFile: 'assets/svgs.js',
     trimExtensions: true,
     prefix: 'APP_SVGs = '
   });
 
   return manifest;
 }
  treeForAddon: function (tree) {
    var mdPaths = [];

    if (this.project.name() !== 'ember-frost-guide-fr-markdown-file-strip-number-prefix') {
      var appMdRoot = path.join(this.project.root, 'markdown');
      if (fs.existsSync(appMdRoot)) {
        mdPaths.push(appMdRoot);
      }
    }

    var dummyMdRoot = path.join(this.project.root, 'tests', 'dummy', 'markdown');
    if (fs.existsSync(dummyMdRoot)) {
      mdPaths.push(dummyMdRoot);
    }

    if (mdPaths.length > 0) {
      var mdFunnel = new Funnel(mergeTrees(mdPaths), {
        include: [new RegExp(/\.md/)]
      });


      var mdFlattened = Flatiron(mdFunnel, {
        outputFile: 'markdownFiles.js',
        trimExtensions: true
      });
      tree = mergeTrees([tree, mdFlattened]);
    }

    return this._super.treeForAddon.call(this, tree);
  }
Exemple #3
0
    let snippets = mergeTrees(this.snippetPaths().filter(function(path){
      return fs.existsSync(path);
    }));

    let snippetOptions = {
      snippetRegexes: this.snippetRegexes(),
      includeExtensions: this.includeExtensions(),
      snippetExtensions: this.snippetExtensions()
    };

    snippets = mergeTrees(this.snippetSearchPaths().map(function(path){
      return snippetFinder(path, snippetOptions);
    }).concat(snippets));

    snippets = flatiron(snippets, {
      outputFile: 'snippets.js'
    });

    return mergeTrees([tree, snippets]);
  },

  included(app) {
    if (this.includeHighlightJS()) {
      app.import('vendor/highlight.pack.js', { using: [
          { transformation: 'amd', as: 'highlight.js' }
        ] } );
    }
    if (this.includeHighlightStyle()) {
      app.import('vendor/highlight-style.css');
    }
  }