otherjoel / beeswax Goto Github PK
View Code? Open in Web Editor NEW๐๐ง Prototype template #lang for Pollen
License: Other
๐๐ง Prototype template #lang for Pollen
License: Other
If someone has gone so far as to set their own command character in pollen/setup
then it would probably be frustrating for them to have to use the default again in the templates.
Any define
s in a Beeswax template get moved to the top of the apply-template
function that Beeswax wraps around the template. It so happens that the place they get put is outside the scope of the parameterize
that sets the value of the current-pagetree
and current-metas
. (See these lines in the expander.) So any definitions that depend, directly or indirectly, on those two parameters will receive incorrect values.
Surfaced by @benknoble in follow-up for #12.
If this things ends up living on as a separate project, it might end up including things besides templating and the raco
commands.
The current-pagetree
parameter is always #false
in a Beeswax template unless manually set. This should match Pollenโs behavior, which is to initialize it to either the result of (setup:main-pagetree)
if it exists, or to an automatic pagetree.
See example gist in #12 by @benknoble.
There may be a good case for folding this functionality into Pollen if there are clear performance benefits. The benefits of having a templating #lang
that interacts well with DrRacket are axiomatic, but minor.
C:\>raco test -p beeswax
...
--------------------
Check (current-project-root) required from pollen/setup
FAILURE
name: check-equal?
location: test-output.rkt:41:1
actual: "beeswax\\test\\data"
expected: "beeswax/test/data"
--------------------
Like Pollen templates, #lang beeswax/template
modules should be able to use everything in pollen/template
, as well as the magic variable here
. Possibly also pollen/pagetree
. The project's โpollen.rktโ will not be auto-required.
I've got a sample based on the second pollen tutorial: https://gist.github.com/benknoble/44a83076ab2c9091e4794274c9214ca8 (see second revision).
Notice the '(@)
and blank lines where there should be data, as in the pollen version.
There are workarounds in some (but probably not all) cases, and it would be nice if this were fixed. (Also, when the body is a call to a tag function that produces a txexpr, it's not HTML-ified right, though I admit I don't have an example of that.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.