l0bsterssg

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

leaf.js (1049B)


      1 /*
      2 Language: Leaf
      3 Author: Hale Chan <halechan@qq.com>
      4 Description: Based on the Leaf reference from https://vapor.github.io/documentation/guide/leaf.html.
      5 */
      6 
      7 function leaf (hljs) {
      8   return {
      9     name: 'Leaf',
     10     contains: [
     11       {
     12         className: 'function',
     13         begin: '#+' + '[A-Za-z_0-9]*' + '\\(',
     14         end:' {',
     15         returnBegin: true,
     16         excludeEnd: true,
     17         contains : [
     18           {
     19             className: 'keyword',
     20             begin: '#+'
     21           },
     22           {
     23             className: 'title',
     24             begin: '[A-Za-z_][A-Za-z_0-9]*'
     25           },
     26           {
     27             className: 'params',
     28             begin: '\\(', end: '\\)',
     29             endsParent: true,
     30             contains: [
     31               {
     32                 className: 'string',
     33                 begin: '"',
     34                 end: '"'
     35               },
     36               {
     37                 className: 'variable',
     38                 begin: '[A-Za-z_][A-Za-z_0-9]*'
     39               }
     40             ]
     41           }
     42         ]
     43       }
     44     ]
     45   };
     46 }
     47 
     48 module.exports = leaf;