@@ -102,15 +102,15 @@ ;; Get the index entries from the SQLite cache, return them as a list of vectors (Records!) (define (fetch-entries) (define q ◊string-append{ - SELECT entry, subentry, a.rowid, "◊web-root" || k.pagenode || "#" || anchor AS href, title_plain - FROM keywordindex k INNER JOIN articles a - ON a.pagenode = k.pagenode + SELECT entry, subentry, a.rowid, "◊web-root" || k.page || "#" || html_anchor AS href, title_plain + FROM index_entries k INNER JOIN articles a + ON a.page = k.page ORDER BY entry COLLATE NOCASE ASC, subentry COLLATE NOCASE ASC;}) - (query-rows (sqltools:dbc) q)) + (query-rows cache-conn q)) ;; Convert a list of vectors from the cache DB into a list of the form: ;; ((FIRST-LETTER (entries ...)) ...) ;; The method relies on the records being pre-sorted by the SQL query. (define (group-entries records) @@ -158,11 +158,10 @@ ◊html$-page-body-close[] }) (define (main) - (spell-of-summoning!) ; Turn on DB (displayln "Writing keyword-index.html…") (display-to-file (html$-keywordindex-page (html$-index (group-entries (fetch-entries)))) "keyword-index.html" #:mode 'text #:exists 'replace))