meta-like snippets with expansion of macros?
#58
Closed
opened 4 years ago by aalexei
·
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?
Hi,
Sorry if this is an obvious question, I'm new to pollen and racket.
I want to be able to define a title and abstract snippet in a page and then use that in the page template and other pages such as an overview page. The issue is that those snippets should expand all included macros, like for math, links and formatting. Something like
where I have ◊m defined in pollen.rkt.
I've tried the pattern above and can get the expanded expression and insert it into a template with
◊(->html (select* 'abstract doc))
. That works great, but I don't know how to remove the abstract tag from the doc so◊(->html doc)
doesn't also include it on the page at the point where I defined it. How would I filterdoc
so certain tags and content was dropped?The other approach I've tried is to use metas with
and inserting it with
◊(->html (decode-elements (select* 'abstract metas)))
but that seems to expand only html tags such as◊em{this}
, not the ones I've defined in the pollen.rkt file.Are either of these the right approach?
In your template, rather than using
select
, you can separate theabstract
tags from the rest withsplitf-txexpr
. Then you can handle them separately in the HTML.Awesome. That worked a treat, thanks!