Closed mbutterick closed 5 years ago
I'd love this feature! If possible, I'd also love a feature that enables Racket file that calls render
to communicate Racket values to Pollen files that are being rendered -- though I understand if that's not possible. Dealing with namespaces is hard.
I'd also love a feature that enables Racket file that calls
render
to communicate Racket values to Pollen files that are being rendered
Can you give me an example?
BTW I’ve now pushed an update with envvar-watchlist
:
(define envvar-watchlist '("PUB"))
Can you give me an example?
Someone asks in the Slack channel a few months ago about this. Pretty much, s/he wants to render twice, each with different parameter. Trying to mutate variables doesn't work because they live in different namespace. The final solution we came up with is using environment variables, but being able to use Racket values are obviously better and less restrictive than using environment variables.
(The Slack post was gone due to Slack limitation)
Someone asks in the Slack channel a few months ago about this … The Slack post was gone
Well if they come back and post a question here, I will look into it. Otherwise I can only speculate …
I’m working on a project where I’d like to use mutiple environment variables (not just
POLLEN
). You don’t need Pollen’s permission to do this, but ordinarily the cache only tracks the value of thePOLLEN
variable itself, so if you use others, the cache will not be invalidated correctly (assuming that the other environment variables affect the output).I’m thinking of adding
pollen/setup
value — let’s call itenvvar-watchlist
— that would allow a project to specify the environment variables that matter. (Simply looking at all the environment variables is not a good policy.)Thoughts? Objections? Improvements?