[pollen] Re: How to create a tag whose content is modified before rendering?

2018-01-20 Thread clozach
Oops! Never mind. I was just missing a pair of parentheses around the 
`default-tag-function`.

Solution (*pollen.rkt*)
















*#lang racket/base(require pollen/tag  racket/string  txexpr  
pollen/decode)(provide (all-defined-out))(define (title text) 
((default-tag-function 'book-title) (string-join (list " " 
text(define (root . items)  (decode (txexpr 'root '() items)  
#:txexpr-elements-proc decode-paragraphs  #:exclude-tags '(style 
script)))Sorry for the distraction. *

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[pollen] How to create a tag whose content is modified before rendering?

2018-01-20 Thread clozach
*How can I achieve the Desired Output as shown below?*

I think I'm running into an issue with `define`. According to the docs, 
there are two forms of `define`, one which binds to the result of an 
expression, and the other to a procedure. It seems as if the 2nd, 
parameter-taking form is somehow stirpping the default-tag-function of its 
tag. How can I preserve the `txexpr` generated by `default-tag-function`?

Input (*test.poly.pm*)
#lang pollen

Joan Didion called Joseph Conrad's ◊title{Victory}, "maybe my favorite book 
in the world."

Input (*pollen.rkt*)















*#lang racket/base(require pollen/tag  racket/string  txexpr  
pollen/decode)(provide (all-defined-out))(define (title text) 
(default-tag-function 'book-title) (string-join (list " " text)))(define 
(root . items)  (decode (txexpr 'root '() items)  
#:txexpr-elements-proc decode-paragraphs  #:exclude-tags '(style 
script)))*Actual Output (*test.html*)


  
  : 
  


Joan Didion called Joseph Conrad's   Victory, "maybe my favorite 
book in the world."



Desired Output (*test.html*)


  
  : 
  


Joan Didion called Joseph Conrad's   Victory
, "maybe my favorite book in the world."



-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pollen] Re: Pollen project server does not invalidate compile cache when files required by pollen.rkt change. Any lighter option than turning off the compile caches?

2018-01-20 Thread Matthew Butterick
I've been persuaded this is a good idea & therefore implemented it. You can 
now track extra dependencies with the new setup value 
`compile-cache-watchlist`.


On Friday, May 5, 2017 at 10:01:07 PM UTC-4, Matthew Butterick wrote:
>
> On May 5, 2017, at 6:48 PM, Shannon Severance  
> wrote:
>
> Finally found the answer in the documentation, Pollen tracks what it 
> tracks and not any more, turning off the cache is the only sollution. 
> https://docs.racket-lang.org/pollen/Cache.html#%28part._.Scope_of_dependency_tracking%29
>  
> 
>
>
> Right. I once considered adding a project setup value that would let you 
> add other external "rkt" files to the list of files tracked by the cache. 
> But when any "rkt" file changes (like "pollen.rkt"), usually the whole 
> cache gets invalidated anyhow. Which is basically equivalent to turning it 
> off. So the extra housekeeping seemed pointless. Anyhow, I'm open to better 
> suggestions.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.