<commit_before>#lang at-exp s-exp "../common.rkt"

;; This stub is to generate fancy directory listings with the Racket style

(define-context "stubs/dirlist")

(require racket/port)
(define (xml->string content)
  (regexp-replace* #rx"&nbsp;"
                   (with-output-to-string (lambda () (output-xml content)))
                   "\\&#160;"))

;; (define (racket-navbar)  (xml->string (www:the-resources 'navbar #f)))
;; (define (racket-favicon) (xml->string (www:the-resources 'favicon-headers)))

(define header+footer
  (delay (regexp-split #rx"{{{BODY}}}"
                       (xml->string @page[#:id 'browse-downloads
                                          #:html-only #t
                                          "{{{BODY}}}"]))))

(define header @plain[#:file "header.html" (car  (force header+footer))])
(define footer @plain[#:file "footer.html" (cadr (force header+footer))])<commit_msg>Make dirlist use www resources<commit_after>#lang at-exp s-exp "../common.rkt"

;; This stub is to generate fancy directory listings with the Racket style

(require (prefix-in www: (only-in "../www/shared.rkt" the-resources)))

(define-context "stubs/dirlist" #:resources www:the-resources)

(require racket/port)
(define (xml->string content)
  (regexp-replace* #rx"&nbsp;"
                   (with-output-to-string (lambda () (output-xml content)))
                   "\\&#160;"))

;; (define (racket-navbar)  (xml->string (www:the-resources 'navbar #f)))
;; (define (racket-favicon) (xml->string (www:the-resources 'favicon-headers)))

(define header+footer
  (delay (regexp-split #rx"{{{BODY}}}"
                       (xml->string @page[#:id 'browse-downloads
                                          #:html-only #t
                                          "{{{BODY}}}"]))))

(define header @plain[#:file "header.html" (car  (force header+footer))])
(define footer @plain[#:file "footer.html" (cadr (force header+footer))])
{'fraction_non_alphanumeric': 0.17671303451828954, 'fraction_numerical': 0.0030911901081916537, 'mean_word_length': 2.6299065420560748, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7230403', 'n_tokens_mistral': 619, 'n_tokens_neox': 585, 'n_words': 143}