@@ -101,21 +101,22 @@ @examples[#:eval dust-eval (tx-strs '(p [[class "intro"]] (em "I’m not opening the safe") ", Wilson remembers thinking."))] -@defproc[(make-tag-predicate [sym symbol?]) (-> any/c boolean?)] +@defproc[(make-tag-predicate [sym symbol?] ...) (-> any/c boolean?)] Returns a function (or @italic{predicate}) that returns @racket[#t] if its argument is -a @racket[_txexpr] whose tag is @racket[_sym]. This predicate is useful for passing as the +a @racket[_txexpr] whose tag matches any @racket[_sym]. This predicate is useful for passing as the @racket[_pred] expression in functions @racket[splitf-txexpr] and @racket[findf-txexpr]. -@examples[#:eval dust-eval -(define is-aside? (make-tag-predicate 'aside)) +@examples[#:eval dust-eval +(define is-aside? (make-tag-predicate 'aside 'sidebar)) (is-aside? '(q "I am not mad, Sir Topas. I say to you this house is dark.")) -(is-aside? '(aside "How smart a lash that speech doth give my Conscience?"))] +(is-aside? '(aside "How smart a lash that speech doth give my Conscience?")) +(is-aside? '(sidebar "Many copies that we use today are conflated texts."))] @defproc[(first-words [txprs (listof txexpr?)] [n exact-nonnegative-integer?]) string?] Given a list of tagged X-expressions, returns a string containing the first @racket[_n] words found in the string elements of @racket[_txprs], or all of the words if there are less than @racket[_n]