Ingesting Files

Ingest functionality provides a convenient way to initialize a variable from the contents of a file. The file uses the same |. syntax as the rest of TextCarver:

This

$$IngestFile{person.md}
$$person.first{}


//person.md contains:
|.first Alex
|.last Bobo

Becomes

Alex

$$IngestFile{person | alex.md} initializes $$person from the contents of alex.md.

$$IngestDirectory{staffDirectory} loads each file in staffDirectory and initializes a variable with that name from the contents of the file.

Next: The Code Stack