From 2849f0ef14e97ed6ad5f8a8abec25270d1927c18 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 13 Feb 2014 17:27:58 -0800 Subject: [PATCH] start xexpr file --- hyphenate/xexpr.rkt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hyphenate/xexpr.rkt diff --git a/hyphenate/xexpr.rkt b/hyphenate/xexpr.rkt new file mode 100644 index 00000000..a90e5efc --- /dev/null +++ b/hyphenate/xexpr.rkt @@ -0,0 +1,39 @@ +#lang racket/base +(require "main.rkt") +(require xml) + + + +#| +The following grammar describes expressions that create X-expressions: + + xexpr = string + | (list symbol (list (list symbol string) ...) xexpr ...) + | (cons symbol (list xexpr ...)) + | symbol + | valid-char? + | cdata + | misc + +|# + + +;; recursively hyphenate strings within xexpr +;; todo: add exclusion #:only [only-proc (λ(x) x)] +(define (hyphenate-xexpr x ) + (define exclusions '(style script)) ; omit these from ever being hyphenated + + (cond + ; todo: the only-proc semantics are illogical. + ; main issue: keep it out of tags like