@@ -18,19 +18,18 @@ cache-conn ; The most eligible bachelor in Neo Yokyo (schema-out cache:article) (schema-out cache:note) (schema-out cache:series) (schema-out cache:index-entry) + (schema-out listing) delete-article! delete-notes! current-plain-title articles articles+notes listing-htmls - - - + fenced-listing unfence preheat-series! series-grouped-list) ;; Cache DB and Schemas @@ -184,23 +183,12 @@ (for/list ([l (in-entities (cache-conn) list-query)]) (listing-html l))) ;; Return cached HTML of articles and/or notes, fenced within a style txexpr to prevent it being ;; escaped by ->html. See also: definition of `unfence` - -;; E.g.: ( articles+notes) -(define ( query-func #:series [s #t] #:limit [lim -1] #:order [ord 'desc]) - `(style ,@(listing-htmls (query-func 'full #:series s #:limit lim #:order ord)))) -;; ^^^^^ - -(define ( query-func #:series [s #t] #:limit [lim -1] #:order [ord 'desc]) - `(style ,@(listing-htmls (query-func 'excerpt #:series s #:limit lim #:order ord)))) -;; ^^^^^^^^ - -(define ( query-func #:series [s #t] #:limit [lim -1] #:order [ord 'desc]) - `(style ,@(listing-htmls (query-func 'short #:series s #:limit lim #:order ord)))) -;; ^^^^^^ +(define (fenced-listing q) + `(style ,@(listing-htmls q))) ;; Remove "" introduced by using ->html on docs containing output from ;; listing functions (define (unfence html-str) (regexp-replace* #px"<[\\/]{0,1}style>" html-str ""))