You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/tests/requires/include-me.rkt

48 lines
1.4 KiB
Racket

11 years ago
#lang racket/base
(require racket/contract racket/list racket/match)
(require pollen/tools pollen/decode
pollen/library/decode-tools)
11 years ago
(provide (all-defined-out))
11 years ago
(module+ test (require rackunit))
11 years ago
11 years ago
;; register custom block tags
(register-block-tag 'bloq)
(register-block-tag 'fooble)
11 years ago
;; detect paragraphs
;; todo: unit tests
(define/contract (xexpr-elements-proc elements)
(xexpr-elements? . -> . xexpr-elements?)
(let ([elements (prep-paragraph-flow elements)])
(if (ormap paragraph-break? elements) ; need this condition to prevent infinite recursion
(map wrap-paragraph (splitf-at* elements paragraph-break?)) ; split into ¶¶
elements)))
11 years ago
11 years ago
(define/contract (block-xexpr-proc bx)
(tagged-xexpr? . -> . tagged-xexpr?)
11 years ago
(wrap-hanging-quotes (nonbreaking-last-space bx)))
(define (string-proc str)
(string? . -> . string?)
(typogrify str))
11 years ago
(define/contract (root . items)
(() #:rest (listof xexpr-element?) . ->* . tagged-xexpr?)
11 years ago
(decode (cons 'root-function items)
; #:exclude-xexpr-tags 'em
; #:xexpr-tag-proc [xexpr-tag-proc (λ(x)x)]
; #:xexpr-attr-proc [xexpr-attr-proc (λ(x)x)]
#:xexpr-elements-proc xexpr-elements-proc
11 years ago
#:block-xexpr-proc block-xexpr-proc
; #:inline-xexpr-proc [inline-xexpr-proc (λ(x)x)]
#:string-proc string-proc))
11 years ago
11 years ago
(define foo "bar")