Directory Structure #98

Open
opened 3 years ago by matms · 1 comments
matms commented 3 years ago (Migrated from github.com)

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.

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 (Migrated from github.com)

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.

Sounds like a good job for a package. Set up your common code [as a separate package](https://beautifulracket.com/jsonic-3/the-info.rkt-file.html) (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.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen-users#98
Loading…
There is no content yet.