Skip to content

centricconsulting/oxidize-template-sandbox

Repository files navigation

Oxidize Template Sandbox

This repository is a sandbox for developing EJS templates that will be used in the Oxidize application.


Valuable Concepts to Learn


Installation Steps

Prepare Environment

  1. Install Visual Studio Code. VS Code Download
  2. Install Node. Node Download
  3. Open Visual Studio Code.
  4. Install Yarn - Open terminal window and type npm install yarn

Prepare and Run the Project

  1. Load this repository onto you local desktop.
  2. Open the root folder of the repository in VS Code
  3. Open the terminal window and type yarn install. This will pull down all the packages for this repository.
  4. In the terminal window type yarn run start.

Recommendations

  • Install the VSCode Extension: EJS language support
  • Examine demos for codifier and jsonHelper
  • Exensively use console.log for troublshooting.

Templated Code Generation

EJS Template

The EJS template (sample: template.js) uses template tags to move between Javascript and rendered text. The following code objects are accessible for use by Javascript in the template:

  • jsonHelper Provides JSONPath query functionality. json.helper.js
  • codifier Transforms text so that it can be used in code. codifier.js
  • project Top level of the metadata object. metadata.json

This project will also look for a special file-break tag that will be detected and used to split files:

@@@FILE:[<path>]@@@

The <path> is relative to the specified target directory and may include nested directories. The file-break tag must rendered on its own line.

Examples:

@@@FILE:[test/<%- entity.name.substring(0,1) %>/<%- entity.__code %>.txt]@@@

Generating Code

Code is generated through the CodeGenerator class in generate.js.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •