Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/capjamesg/codename-apple
- Owner: capjamesg
- License: mit
- Created: 2022-09-20T12:23:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-27T18:20:17.000Z (over 2 years ago)
- Last Synced: 2024-12-15T07:48:47.364Z (about 2 months ago)
- Topics: common-lisp, lisp, static-site-generator
- Language: Common Lisp
- Homepage:
- Size: 161 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:
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"))))