Accessing metas
from Racket
#103
Closed
opened 4 years ago by casouri
·
2 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
The tutorial mentions using
(require "pollen-source.rkt")
to gain access tometas
outside Pollen. What does this "pollen-source.rkt" refer to? Currently in mypollen.rkt
there iswhich doesn't work. Apparently, none of them provide
metas
. What should I do?Background:
I'm trying to write a little helper that turns the filename of the pollen source into the title of the page. For example, it turns "day-12.html.pm" into "Day 12". This is how I implemented it:
The problem is when I wrote my function in
pollen.rkt
, Racket complains thatmetas
is not defined.My complete
pollen.rkt
:It’s a placeholder for the actual name. So if your source is
"day-12.html.pm"
, then(require "day-12.html.pm")
.If you want to use
metas
in a tag function, you probably want to use the(current-metas)
parameter, which holds themetas
of the Pollen source currently being evaluated (or#false
if none is available)Thanks!
(current-metas)
is what I'm looking for. It would be nice if the tutorial can mention it in12.3.1.5 Retrieving metas
.