Skip to content

Instantly share code, notes, and snippets.

@benknoble
Last active September 22, 2021 19:00
Show Gist options
  • Save benknoble/44a83076ab2c9091e4794274c9214ca8 to your computer and use it in GitHub Desktop.
Save benknoble/44a83076ab2c9091e4794274c9214ca8 to your computer and use it in GitHub Desktop.
Beeswax breaks when/splice in templates
  • beeswax-render-*.html produced by
raco beeswax render *.pmd
for f in {,b,c}article.html; do mv "$f" "beewswax-render-$f"; done
  • pollen-render-*.html produced by
mv pollen.rkt .pollen.rkt
raco pollen render *.pmd
for f in {,b,c}article.html; do mv "$f" "pollen-render-$f"; done
mv .pollen.rkt pollen.rkt
#lang pollen
Deep Thought
============
I am **so** happy to be writing this.
#lang pollen
Barticle Title
==============
The wonderful second part of the article.
<html>
<head>
<meta charset="UTF-8">
<title>Deep Thought, by MB</title>
</head>
<body><root><h1 id="deep-thought">Deep Thought</h1><p>I am <strong>so</strong> happy to be writing this.</p></root>
The current page is called article.html.
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Barticle Title, by MB</title>
</head>
<body><root><h1 id="barticle-title">Barticle Title</h1><p>The wonderful second part of the article.</p></root>
The current page is called barticle.html.
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Carticle Title, by MB</title>
</head>
<body><root><h1 id="carticle-title">Carticle Title</h1><p>The terrific third part.</p></root>
The current page is called carticle.html.
</body>
</html>
#lang pollen
Carticle Title
==============
The terrific third part.
#lang pollen
carticle.html
article.html
barticle.html
<html>
<head>
<meta charset="UTF-8">
<title>Deep Thought, by MB</title>
</head>
<body><root><h1 id="deep-thought">Deep Thought</h1><p>I am <strong>so</strong> happy to be writing this.</p></root>
The current page is called article.html.
The previous is <a href="carticle.html">carticle.html</a>.
The next is <a href="barticle.html">barticle.html</a>.
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Barticle Title, by MB</title>
</head>
<body><root><h1 id="barticle-title">Barticle Title</h1><p>The wonderful second part of the article.</p></root>
The current page is called barticle.html.
The previous is <a href="article.html">article.html</a>.
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>Carticle Title, by MB</title>
</head>
<body><root><h1 id="carticle-title">Carticle Title</h1><p>The terrific third part.</p></root>
The current page is called carticle.html.
The next is <a href="article.html">article.html</a>.
</body>
</html>
#lang racket/base
(module setup racket/base
(provide (all-defined-out))
(define external-renderer '(beeswax/for-pollen external-renderer)))
<html>
<head>
<meta charset="UTF-8">
<title>◊(select 'h1 doc), by MB</title>
</head>
<body>◊(->html doc)
The current page is called ◊|here|.
◊(define prev-page (previous here))
◊when/splice[prev-page]{The previous is <a href="◊|prev-page|">◊|prev-page|</a>.}
◊(define next-page (next here))
◊when/splice[next-page]{The next is <a href="◊|next-page|">◊|next-page|</a>.}
</body>
</html>
#lang beeswax/template
<html>
<head>
<meta charset="UTF-8">
<title>◊(select 'h1 doc), by MB</title>
</head>
<body>◊(->html doc)
The current page is called ◊|here|.
◊(define prev-page (previous here))
◊when/splice[prev-page]{The previous is <a href="◊|prev-page|">◊|prev-page|</a>.}
◊(define next-page (next here))
◊when/splice[next-page]{The next is <a href="◊|next-page|">◊|next-page|</a>.}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment