Skip to content

stachemu is an experimental template syntax for building and matching strings inspired by mustache syntax

License

Notifications You must be signed in to change notification settings

team-chiru/stache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stachemu

FOSSA Status

Stachemu uses a super-set of the Mustache templating syntax in order to build data structures.

Verlan is an argot in the French language, featuring inversion of syllables in a word, and is common in slang and youth language. Wikipedia

motivation

Stachemu can be used to easily build and match templatized strings from data format.

example

from this template:

{{=Node}}
   {{#root}}
      <TITLE>{{name}}</TITLE>
      <H1>{{description}}</H1>
   {{/root}}
   {{^root}}
      <DT><H3{{?...}}>{{name}}</H3>
      <DD>{{?description}}
   {{/root}}
   <DL><p>
      {{#links}}
         {{=Link}}
            <DT><A HREF={{url}} {{?...}}>{{name}}</A>
         {{/Link}}
      {{/links}}
      {{#nodes}}
         {{>Node}}
      {{/nodes}}
   </DL><p>
{{/Node}}

this html content:

<TITLE>root</TITLE>
<H1>description of root</H1>
<DL><p>
   <DT><H3>node 1</H3>
   <DL><p>
      <DT><A HREF="url">link 1</A>
   </DL><p>
</DL><p>

will become the following raw structure:

{
   Node: {
      name: "root",
      description: "description of root",
      root: true,
      nodes: [
         Node: {
            name: "node 1",
            links: [
               Link: {
                  name: "link 1",
                  url: "url"
               }
            ]
         }
      ]
   }
}

and vice versa with a compliant mustache renderer.

license

see license file

FOSSA Status

About

stachemu is an experimental template syntax for building and matching strings inspired by mustache syntax

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages