1.2.0 • Published 3 years ago

dgenerate v1.2.0

Weekly downloads
48
License
ISC
Repository
github
Last release
3 years ago

DGenerate Build Status

Docx templating system using a sophisticated JSON interface. This is WIP and not production ready.

Simple, conditional-less example (in example/simple_example/example.js)

let {DGenerateState, GenerateState, GeneratorSettings} = require('DGenerate');
let fs = require('fs');
let templateDocx = fs.readFileSync('./template.docx');
let templateJson = JSON.parse(fs.readFileSync('./template.json'));
let observationJson = JSON.parse(fs.readFileSync('./observation.json'));
let state = new DGenerateState({observation_json: observationJson, variable_definitions_json_arr:[templateJson], template_files: [templateDocx], output_name:"output.docx"})
state.run();

More complicated example with conditions

The example.js is the exact same code as above in this example, but the template has changed to account for conditions. Make note of the following files:

This is an example where the given gender will affect all the potential pronouns when applied. The gender is {demographics.gender} meaning that the corresponding pronouns are {demographics.pronouns.personal.upper}, {demographics.pronouns.possessive.upper} for example.

When running all these together, it outputs transformed text so that one can modify all pronouns based off a single gender throughout a document, or multiple documents.

This is an example where the given gender will affect all the potential pronouns when applied. The gender is MALE meaning that the corresponding pronouns are He, His for example.

1.2.0

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.1

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago