#lang scribble/manual @(require scribble/eval pollen/decode pollen/setup txexpr (for-label pollen/unstable/convert pollen/setup txexpr racket (except-in pollen #%module-begin))) @(define my-eval (make-base-eval)) @(my-eval `(require pollen pollen/unstable/convert)) @(require "mb-tools.rkt") @title{Convert} @defmodule[pollen/unstable/convert] Helper functions for converting well-made X-expressions or HTML into Pollen markup. @defproc[ (xexpr->pollen [x xexpr?] [#:white-p? white-p? boolean? #f] ) string?] Convert @racket[_x] to Pollen markup, using @racket[setup:command-char] as the leading character. If @racket[_white-p?] is @racket[#t], convert @racket[p] tags by taking the content out of the tag, and inserting @racket[setup:paragraph-separator] in front. @examples[#:eval my-eval (xexpr->pollen '(div)) (xexpr->pollen '(div ((class "pups")))) (xexpr->pollen '(div ((class "pups")) "Lex")) (xexpr->pollen '(div ((class "pups")) (p "Roxy") (p "Sidney"))) (xexpr->pollen #:white-p? #t '(div ((class "pups")) (p "Roxy") (p "Sidney"))) ] @defproc[ (html->pollen [html string?] [#:white-p? white-p? boolean? #f] ) string?] Convert @racket[_html] to Pollen markup, using @racket[setup:command-char] as the leading character. If @racket[_white-p?] is @racket[#t], convert @racket[p] tags by taking the content out of the tag, and inserting @racket[setup:paragraph-separator] in front. @examples[#:eval my-eval (html->pollen "
Roxy
Sidney
Roxy
Sidney