Hello,

I've been using Pollen for about 9 months now and have been enjoying it. I 
primarily use it to generate LaTeX so that I can write consistently in 
pollen and abstract away the different LaTeX templates each conference has. 
I've been doing this using the multi-target method described in Tutorial 4 
(because, being able to generate an HTML version is nice too). This has 
worked pretty well, and I've turned out a few papers, an essay, and a 
project proposal doing this.

Recently, I was looking through the TFL pollen.rkt to see if there were any 
cool ideas I could borrow. And I saw the detect-list-items function and 
corresponding bullet-list tag. 

◊bullet-list{
Foo


Bar


Baz
}


I liked this better than explicitly adding all the tags myself (for 
example):
◊ul{
◊li{foo}
◊li{bar}
◊li{baz}}

In this case, these ul and li tags more or less pass-through for HTML (li 
does a decode paragraph too) and get translated to the LaTeX equivalent.

Both bullet-list as-is and my stew of tags get me the same HTML result, but 
I was hoping that I could "evaluate" the result that comes out of the 
bullet-list and have it generate the LaTeX, sparing me from creating a new 
"detect-list-items" for LaTeX. Something like (forgive novice Racket code):

(define (my-bullet-list . args)
  (define results `(bullet-list ,@args))
  (define results2 (eval results ns))
  (eval results2 ns))

I tried this in the REPL, but got an error "#%app: missing procedure 
expression;" So, I suspect I'm "doing it wrong" in more ways than one.

So, I'm wondering if there is some mechanism for evaluating a txexpr in 
Pollen? If this is not how it's done, I'm certainly willing to to know the 
right way to do this (maybe a hook in decode?). Eval feels a bit risky, but 
since it's only my own feet I'm stepping on, I don't mind too much (for 
now).

The right way may be that I just "port" my old code over to the 
detect-list-items, but I just figured I would ask here as I've run into 
this need(?) another time when I was playing with attributes and suddenly 
wanted to put a tag in one of them (solved another way).

Best regards,

-- 
Trenton

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to