[pollen] Re: Library for rendering Pollen to JSON?

2019-02-26 Thread Joel Dueck
What kind of JSON object are you interested in getting from a Pollen document? I.e. are you looking to produce the entire tree of X-expressions in JSON form? I haven’t heard of anyone doing it. You might want to check out flexpr: https://docs.racket-lang.org/flexpr/index.html — It can’t quite

Re: [pollen] Re: Simple question about nested custom tags

2019-02-26 Thread Sorawee Porncharoenwase
The third arguments of txexpr should be a list. That is, you should have: (define (digram-row . digrams) (txexpr 'table '((class "digram-table")) (list (txexpr `tr empty (list (txexpr `tbody empty (map (lambda (e) (txexpr 'td '((class "digram-row-cell"))

[pollen] Re: Simple question about nested custom tags

2019-02-26 Thread Brendan Stromberger
If someone might indulge me yet again, I have a simple question with a link to pasterack… http://pasterack.org/pastes/97336 -> the essential problem is that "" and "" are being rendered as plain text, rather than as DOM elements, and I'm not sure what I'm doing wrong. Thanks in advance! --

Re: [pollen] Re: Simple question about nested custom tags

2019-02-26 Thread Brendan Stromberger
Thanks a lot! This worked! Though, the fundamental difference between what I was trying and this is is a little lost on me. But I’m sure I’ll start to intuit this stuff soon. On Tuesday, February 26, 2019 at 10:46:20 AM UTC-5, Sorawee Porncharoenwase wrote: > > You want to *invoke* digram, so:

Re: [pollen] Re: Simple question about nested custom tags

2019-02-26 Thread Sorawee Porncharoenwase
You want to *invoke* digram, so: (define (lesser-yin) (case (current-poly-target) [(txt) "figure out later"] [else (digram "⚍")])) (note: untested) On Tue, Feb 26, 2019 at 7:39 AM Brendan Stromberger < brendanstromber...@gmail.com> wrote: > ;;; pollen.rkt > (define (digram . elements) >

[pollen] Re: Simple question about nested custom tags

2019-02-26 Thread Brendan Stromberger
Thanks Matthew, Sorawee; this is all super helpful. After reading your responses, I stumbled across https://docs.racket-lang.org/pollen/programming-pollen.html which helped me understand decoders a lot more as well. Going to play around a bit with this! Fun stuff. On Monday, February 25,

[pollen] Library for rendering Pollen to JSON?

2019-02-26 Thread Brendan Stromberger
Has anyone written a library to generalize (at least to some extent) the process of rendering a Pollen document to JSON? Thanks! Brendan -- You received this message because you are subscribed to the Google Groups "Pollen" group. To unsubscribe from this group and stop receiving emails from

Re: [pollen] Simple question about nested custom tags

2019-02-26 Thread Sorawee Porncharoenwase
If digram-row‘s items will always be single, you can also make digram-row responsible for wrapping , which seems cleaner IMO. (define (digram-row . elements) (case (current-poly-target) [(txt) elements] [else (txexpr 'ol empty (map (lambda (e) (txexpr 'li empty (list e))) elements))]))