This repository is a sandbox for developing EJS templates that will be used in the Oxidize application.
- Oxidize Metadata Json Structure. Metadata Documentation
- Embedded Javascript Templating. EJS
- JSONPath Query. Goessner, JSONPath Plus
- Regular Expressions. Regex 101
- Javascript
- Json ("object") and Arrays. json.org
- Array Functions: map, filter, find, sort, indexOf, concat, etc. Mozilla - Array
- Destructuring. Mozilla - Destructuring
- console.log. Mozilla - Console
- Install Visual Studio Code. VS Code Download
- Install Node. Node Download
- Open Visual Studio Code.
- Install Yarn - Open terminal window and type
npm install yarn
- Load this repository onto you local desktop.
- Open the root folder of the repository in VS Code
- Open the terminal window and type
yarn install
. This will pull down all the packages for this repository. - In the terminal window type
yarn run start
.
- Install the VSCode Extension: EJS language support
- Examine demos for
codifier
andjsonHelper
- Exensively use
console.log
for troublshooting.
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]@@@
Code is generated through the CodeGenerator
class in generate.js
.