|(require pollen/file)||package: pollen|
A utility module that provides functions for working with Pollen source and output files. In ordinary use, you probably won’t need these. But if you want to do more elaborate Pollen hacking, here they are.
Pollen handles six kinds of source files:
Preprocessor, with file extension .pp
Markup, with file extension .pm
Markdown, with file extension .pmd
Null, with file extension .p
Scribble, with file extension .scrbl
Pagetree, with file extension .ptree. This is the only source type that does not produce an output file.
For each kind of Pollen source file, the corresponding output file name is derived by removing the extension from the name of the source file. So the preprocessor source file "default.css.pp" would become "default.css". (See Saving & naming your source file if this rings no bells.)
Scribble files work differently — the corresponding output file is the source file but with an "html" extension rather than "scrbl". So "pollen.scrbl" would become "pollen.html".
For more about Pollen’s file model, see File formats.
> (preproc-source? "main.css.pp")
> (markup-source? "default.html.pm")
> (markdown-source? "default.html.pmd")
> (null-source? "index.html.p")
> (scribble-source? "file.scrbl")
> (pagetree-source? "index.ptree")
> (define name "default.html") > (->preproc-source-path name)
> (->markup-source-path name)
> (->markdown-source-path name)
> (->scribble-source-path name)
> (->null-source-path name)
The type-specific variants will, of course, only return a source file of the specified type.
In all cases, if there is no corresponding source, return #f.
Otherwise, there are no type-specific variants for this function because the output path of a Pollen source file is determined by its name.