l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

dust.js (975B)


      1 /*
      2 Language: Dust
      3 Requires: xml.js
      4 Author: Michael Allen <michael.allen@benefitfocus.com>
      5 Description: Matcher for dust.js templates.
      6 Website: https://www.dustjs.com
      7 Category: template
      8 */
      9 
     10 function dust(hljs) {
     11   var EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
     12   return {
     13     name: 'Dust',
     14     aliases: ['dst'],
     15     case_insensitive: true,
     16     subLanguage: 'xml',
     17     contains: [
     18       {
     19         className: 'template-tag',
     20         begin: /\{[#\/]/, end: /\}/, illegal: /;/,
     21         contains: [
     22           {
     23             className: 'name',
     24             begin: /[a-zA-Z\.-]+/,
     25             starts: {
     26               endsWithParent: true, relevance: 0,
     27               contains: [
     28                 hljs.QUOTE_STRING_MODE
     29               ]
     30             }
     31           }
     32         ]
     33       },
     34       {
     35         className: 'template-variable',
     36         begin: /\{/, end: /\}/, illegal: /;/,
     37         keywords: EXPRESSION_KEYWORDS
     38       }
     39     ]
     40   };
     41 }
     42 
     43 module.exports = dust;