Skip to content

Latest commit

 

History

History
78 lines (68 loc) · 1.97 KB

README.md

File metadata and controls

78 lines (68 loc) · 1.97 KB

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