mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
53 stars 0 forks source link

Directory Structure #98

Open matms opened 3 years ago

matms commented 3 years ago

First off, I hope that opening another issue isn't too much of an inconvenience.

Anyways, I was thinking about how I might use pollen in practice and I'd like to know if anyone else has done something like what I am thinking of doing and if this even fits into the pollen workflow.

I would like to have the pollen code and supporting files (i.e. pollen.rkt, templates, etc.) in a common folder (which would be able to be shared), and the content in various separate locations in the file system.

Is there some way to indicate the use of a different pollen.rkt file (other than a file in the current directory or in a parent directory thereof)? Perhaps this could be supported as a parameter to raco pollen start and raco pollen render, or as a meta defined in each file?

I suppose this might have some relevance to dealing with issue #97, as well.

otherjoel commented 3 years ago

Sounds like a good job for a package. Set up your common code as a separate package (even just a local one, no need to publish it if you don’t want to). Then in your other projects you’ll still have a small pollen.rkt file but (assuming you’ve moved everything you need into the package) it can just (require mypackage) and (provide (all-from-out mypackage)).

Or you could avoid having a pollen.rkt altogether and just require it within each pollen source file, but you’ll have no way to specify setup values if you do this.