roc/examples/static-site-gen
Agus Zubiaga 8dedd9f03c
New app header syntax
Implements the new app header syntax as discussed in Zulip [1].

    app [main] {
	cli: platform "../platform/main.roc",
	json: "../json/main.roc"
    }

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] 418444862
2024-05-01 10:49:01 -03:00
..
input New app header syntax 2024-05-01 10:49:01 -03:00
output Remove the whole #var1 thing 2023-09-17 06:31:51 -04:00
platform New module header 2024-05-01 10:39:12 -03:00
README.md Add a lexing-based 'highlight' mode to the parser 2023-02-28 17:03:49 +11:00
static-site.roc New app header syntax 2024-05-01 10:49:01 -03:00

Static site generator

This is an example of how you might build a static site generator using Roc. It searches for Markdown (.md) files in the input directory, inserts them into a HTML template defined in Roc, and writes the result into the corresponding file path in the output directory.

To run, cd into this directory and run this in your terminal:

If roc is on your PATH:

roc run static-site.roc -- input/ output/

If not, and you're building Roc from source:

cargo run -- static-site.roc -- input/ output/

The example in the input directory is a copy of the 2004 website by John Gruber, introducing the Markdown format. https://daringfireball.net/projects/markdown/