Skip to content

OikoumE/itsoik_web_v2_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

itsoik_web_v2_backend

Powered by ChocoJS

made by itsOik


Features:

  • It sucks!

  • its only by luck that it works!

  • Replace tags in HTML by using EXACTLY this syntax:

    • for CSS:
      (requires opening and closing <style> tags)
      <style>{% style <nameOfFile>.css %}</style>

    • for scripts(js):
      (requires opening and closing <script> tags)
      <script>{% script <nameOfFile>.js %}</script>

    • INCLUDES tag:
      {% INCLUDES <nameOfFile>.html %}

    • EXTENDS tag
      (supports BLOCK (must have matching block in file it extends))
      {% EXTENDS <nameOfFile>.html %}
      {% BLOCK <nameOfBlock> %} {% ENDBLOCK <nameOfBlock> %}

    • FOR loops:
      (must be nested in block if extends) to pass data to use in for loops use following syntax:

      in app.js:

      const data = {data: ["value1", ...]} // must be key/array pairs
      templateEngine.render(templateName.html, data) // call with "data" as 2nd variable in the function call
      
      

      in template HTML:

      {% FOR dataVar of data %} <br>
      // do something with `{{ dataVar }}` <br>
      {% ENDFOR %}
      
    • {{ tag }} (single-tag) replacement:
      Replaces tag with data from a "key,value" object with same "key" as the {{ tag }}


TODO:


DONE:

20/12-21:

  • passing variables
  • for loop templating
  • single tag replacing

19/12-21:

  • EXTENDS tag
  • BLOCK tag
  • INCLUDES tag
  • style tag
  • script tag

Requirments:

  • NodeJS: v16+

Install instructions:

  • Coming soon™

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published