Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/capjamesg/codename-apple

A static site generator for my blog posts. Built in Common Lisp.
https://github.com/capjamesg/codename-apple

common-lisp lisp static-site-generator

Last synced: about 2 months ago
JSON representation

A static site generator for my blog posts. Built in Common Lisp.

Awesome Lists containing this project

README

        

# Codename: Apple

Codename: Apple is a static site generator built in Common Lisp.

Codename: Apple lets you:

- Define HTML templates in Lisp.
- Generate templates for markdown documents based on their front matter.

## Screenshot

Here is a static HTML page generated by Codename: Apple:

![Screenshot of a web page for a MediaWiki sparkline generator tool with an example graph of wiki contributions](screenshot.png)

## Using the Generator

To use Codename: Apple, first load the `generator.lisp` file into your script:

(load "generator.lisp")

You can now start defining and generating HTML documents in Lisp.

## Defining a HTML element

To define a HTML element, you can use this syntax:

(tag tagname contents attributes)

Here's an example of a tag that defines a link:

(princ
(tag "a" "This is a link!"
(list
(attr "href" "example.com")
(attr "style" "border-bottom: none;"))))

The generator returns this code as a HTML element:

This is a link!

To define more complicated documents, you can nest values:

(princ
(tag "div"
(tag "a" "This is a link!"
(list
(attr "href" "example.com")
(attr "style" "border-bottom: none;")))
(list (attr "class" "h-entry"))))

This nests our `` tag from earlier in a `

` with the class name `h-entry`:

This is a link!

## TODOs

- [ ] Document how front matter parsing works.
- [ ] Add inline comments for all functions.
- [ ] Remove functions used for my specific website.
- [ ] Document example in `examples/` folder.

## Dependencies

This project relies on the following Common Lisp dependencies:

- cl-ppcre
- uiop
- markdown

## License

This project is licensed under an [MIT license](LICENSE).

## Contributors

- capjamesg