This generator, although named Constitution Generator, is an effort to implement a simple templating workflow on the web.
Its user interface is a webpage.
Current proposed workflow as follows. Step 3 to 4 is what this project's supposed to cover.
- Construct template (see constructing-template)
- Export document from word processing software (we have now only tested Google Doc)
- Parse the resultant HTML and identify fields
- Replace fields with values
- Export HTML for import into work processing software (e.g. straight copy-and-pasting generated webpage into Google Doc works)
-
Start google doc document.
-
Insert fields where necessary. Fields is in format of
[fieldname]
.e.g. In the document we wrote:
[caretaker] gives [animal] food; [animal] gives [caretaker] warmth and care
This generator would identify 2 fields:
[caretaker]
and[animal]
. It would then display 2 textboxes on the side. A preview would update the sentence like this, depending on input:John gives cat food; cat gives John warmth and care.
TODOs:
-
Display HTML template exported from word processing software (currently Google Doc only)
-
Identify fields
-
Replace values for a given field
-
Expose UI for user to change values
-
Find a way to template fields which are lists (<- next TODO maybe)
e.g. [[goals]] would expand to
- Work hard
- Buy a cat
- Word hard
- Buy expensive cat food
After clone the repository, run the following
yarn && yarn start
Original work based on https://gitlab.com/hulloanson/constitution-generator