Custom command-char leading to incorrect HTML output #210

Closed
opened 5 years ago by typesanitizer · 2 comments
typesanitizer commented 5 years ago (Migrated from github.com)

raco pollen version = 2.1.2229.709

I was trying out the tutorial

;; pollen.rkt
#lang racket/base

(require pollen/tag)
(provide (all-defined-out))
(define headline (default-tag-function 'h2))
(define items (default-tag-function 'ul))
(define item (default-tag-function 'li 'p))
(define (link url text) `(a ((href ,url)) ,text))

(module setup racket/base
  (provide (all-defined-out))
  (define command-char #\%)) ;; This is ok?

;; index.html.pm
#lang pollen

%headline{Pollen markup}

%items{
  %item{You %strong{wanted} it — you %em{got} it.}
  %item{%link["https://google.com/search?q=racket"]{search for Racket}}
}

However, when I run raco pollen render index.html.pm, the output index.html is simply

◊(->html (html (head (meta #:charset "UTF-8")) (body doc)))

Am I doing something incorrectly or is this a bug?

`raco pollen version` = 2.1.2229.709 I was trying out the tutorial ``` ;; pollen.rkt #lang racket/base (require pollen/tag) (provide (all-defined-out)) (define headline (default-tag-function 'h2)) (define items (default-tag-function 'ul)) (define item (default-tag-function 'li 'p)) (define (link url text) `(a ((href ,url)) ,text)) (module setup racket/base (provide (all-defined-out)) (define command-char #\%)) ;; This is ok? ;; index.html.pm #lang pollen %headline{Pollen markup} %items{ %item{You %strong{wanted} it — you %em{got} it.} %item{%link["https://google.com/search?q=racket"]{search for Racket}} } ``` However, when I run `raco pollen render index.html.pm`, the output `index.html` is simply ``` ◊(->html (html (head (meta #:charset "UTF-8")) (body doc))) ``` Am I doing something incorrectly or is this a bug?
mbutterick commented 5 years ago (Migrated from github.com)

The default HTML template uses a lozenge as the command char. You would need to make your own template (even just copying the default) with your custom command char.

On Sep 14, 2019, at 1:04 PM, Varun Gandhi notifications@github.com wrote:

raco pollen version = 2.1.2229.709

I was trying out the tutorial

;; pollen.rkt
#lang racket/base

(require pollen/tag)
(provide (all-defined-out))
(define headline (default-tag-function 'h2))
(define items (default-tag-function 'ul))
(define item (default-tag-function 'li 'p))
(define (link url text) `(a ((href ,url)) ,text))

(module setup racket/base
(provide (all-defined-out))
(define command-char #%)) ;; This is ok?

;; index.html.pm
#lang pollen

%headline{Pollen markup}

%items{
%item{You %strong{wanted} it — you %em{got} it.}
%item{%link["https://google.com/search?q=racket"]{search for Racket}}
}
However, when I run raco pollen render index.html.pm, the output index.html is simply

◊(->html (html (head (meta #:charset "UTF-8")) (body doc)))
Am I doing something incorrectly or is this a bug?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

The default HTML template uses a lozenge as the command char. You would need to make your own template (even just copying the default) with your custom command char. > On Sep 14, 2019, at 1:04 PM, Varun Gandhi <notifications@github.com> wrote: > > raco pollen version = 2.1.2229.709 > > I was trying out the tutorial > > ;; pollen.rkt > #lang racket/base > > (require pollen/tag) > (provide (all-defined-out)) > (define headline (default-tag-function 'h2)) > (define items (default-tag-function 'ul)) > (define item (default-tag-function 'li 'p)) > (define (link url text) `(a ((href ,url)) ,text)) > > (module setup racket/base > (provide (all-defined-out)) > (define command-char #\%)) ;; This is ok? > > ;; index.html.pm > #lang pollen > > %headline{Pollen markup} > > %items{ > %item{You %strong{wanted} it — you %em{got} it.} > %item{%link["https://google.com/search?q=racket"]{search for Racket}} > } > However, when I run raco pollen render index.html.pm, the output index.html is simply > > ◊(->html (html (head (meta #:charset "UTF-8")) (body doc))) > Am I doing something incorrectly or is this a bug? > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or mute the thread.
typesanitizer commented 5 years ago (Migrated from github.com)

Thanks, that explains it! In case anyone is reading this in the future: I followed the instructions here and added a template.html.p file to fix the issue:

%(->html (html (head (meta #:charset "UTF-8")) (body doc)))
Thanks, that explains it! In case anyone is reading this in the future: I followed the instructions [here](https://docs.racket-lang.org/pollen/second-tutorial.html#(part._tutorial-2._.The_doc_export_and_the_-_html_function)) and added a `template.html.p` file to fix the issue: ``` %(->html (html (head (meta #:charset "UTF-8")) (body doc))) ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
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#210
Loading…
There is no content yet.