From e9cb0e847860345e226768bbfe21d79752bb0e11 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 26 Jun 2022 18:24:05 -0700 Subject: [PATCH] test dir --- gangtest/40.txt.pm | 2 ++ gangtest/41.txt.pm | 2 ++ gangtest/42.txt.pm | 2 ++ gangtest/43.txt.pm | 2 ++ gangtest/44.txt.pm | 2 ++ gangtest/45.txt.pm | 2 ++ gangtest/46.txt.pm | 2 ++ gangtest/47.txt.pm | 2 ++ gangtest/48.txt.pm | 2 ++ gangtest/49.txt.pm | 2 ++ gangtest/gang.rkt | 34 ++++++++++++++++++++++++++++++++++ gangtest/makem.rkt | 8 ++++++++ gangtest/pollen.rkt | 6 ++++++ gangtest/template.txt | 1 + 14 files changed, 69 insertions(+) create mode 100644 gangtest/40.txt.pm create mode 100644 gangtest/41.txt.pm create mode 100644 gangtest/42.txt.pm create mode 100644 gangtest/43.txt.pm create mode 100644 gangtest/44.txt.pm create mode 100644 gangtest/45.txt.pm create mode 100644 gangtest/46.txt.pm create mode 100644 gangtest/47.txt.pm create mode 100644 gangtest/48.txt.pm create mode 100644 gangtest/49.txt.pm create mode 100644 gangtest/gang.rkt create mode 100644 gangtest/makem.rkt create mode 100644 gangtest/pollen.rkt create mode 100644 gangtest/template.txt diff --git a/gangtest/40.txt.pm b/gangtest/40.txt.pm new file mode 100644 index 0000000..24eee26 --- /dev/null +++ b/gangtest/40.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +40 file \ No newline at end of file diff --git a/gangtest/41.txt.pm b/gangtest/41.txt.pm new file mode 100644 index 0000000..276974e --- /dev/null +++ b/gangtest/41.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +41 file \ No newline at end of file diff --git a/gangtest/42.txt.pm b/gangtest/42.txt.pm new file mode 100644 index 0000000..b51e73c --- /dev/null +++ b/gangtest/42.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +42 file \ No newline at end of file diff --git a/gangtest/43.txt.pm b/gangtest/43.txt.pm new file mode 100644 index 0000000..6a5133b --- /dev/null +++ b/gangtest/43.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +43 file \ No newline at end of file diff --git a/gangtest/44.txt.pm b/gangtest/44.txt.pm new file mode 100644 index 0000000..6dfe798 --- /dev/null +++ b/gangtest/44.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +44 file \ No newline at end of file diff --git a/gangtest/45.txt.pm b/gangtest/45.txt.pm new file mode 100644 index 0000000..9d7cb05 --- /dev/null +++ b/gangtest/45.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +45 file \ No newline at end of file diff --git a/gangtest/46.txt.pm b/gangtest/46.txt.pm new file mode 100644 index 0000000..47c3bc4 --- /dev/null +++ b/gangtest/46.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +46 file \ No newline at end of file diff --git a/gangtest/47.txt.pm b/gangtest/47.txt.pm new file mode 100644 index 0000000..910435c --- /dev/null +++ b/gangtest/47.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +47 file \ No newline at end of file diff --git a/gangtest/48.txt.pm b/gangtest/48.txt.pm new file mode 100644 index 0000000..5009016 --- /dev/null +++ b/gangtest/48.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +48 file \ No newline at end of file diff --git a/gangtest/49.txt.pm b/gangtest/49.txt.pm new file mode 100644 index 0000000..9c9881b --- /dev/null +++ b/gangtest/49.txt.pm @@ -0,0 +1,2 @@ +#lang pollen +49 file \ No newline at end of file diff --git a/gangtest/gang.rkt b/gangtest/gang.rkt new file mode 100644 index 0000000..df158f5 --- /dev/null +++ b/gangtest/gang.rkt @@ -0,0 +1,34 @@ +#lang br +(require racket/path + pollen/private/file-utils + racket/file) + +(define sources (for/list ([p (in-directory ".")] + #:when (path-has-extension? p #"pm")) + p)) + +#R sources + +(define temp-template (build-path "/Users/MB/Desktop/sources/template.txt")) +(define output-paths (map simplify-path (map path->complete-path (map ->output-path sources)))) +#R output-paths + +(define render-results +(eval (with-syntax ([MODNAME (gensym)] + [TEMPLATE-PATH-STRING (path->string temp-template)]) + #`(begin + (println 'MODNAME) + (module MODNAME pollen/private/gang-helper + #:sources #,@(map path->string sources) + #:template TEMPLATE-PATH-STRING + #:result-id result) + (let () + (local-require 'MODNAME) + result))))) + +(for ([render-result (in-list render-results)] + [output-path (in-list output-paths)]) + (display-to-file render-result + output-path + #:exists 'replace + #:mode (if (string? render-result) 'text 'binary))) \ No newline at end of file diff --git a/gangtest/makem.rkt b/gangtest/makem.rkt new file mode 100644 index 0000000..7425f43 --- /dev/null +++ b/gangtest/makem.rkt @@ -0,0 +1,8 @@ +#lang br +(require racket/file) + +(for ([i 50]) + (display-to-file (format "#lang pollen\n~a file" i) + (string->path (format "~a.txt.pm" i)) + #:exists 'replace + #:mode 'text)) \ No newline at end of file diff --git a/gangtest/pollen.rkt b/gangtest/pollen.rkt new file mode 100644 index 0000000..d1baa03 --- /dev/null +++ b/gangtest/pollen.rkt @@ -0,0 +1,6 @@ +#lang br + +(module setup racket/base + (provide (all-defined-out)) + #;(define render-cache-active #false) + #;(define compile-cache-active #false)) \ No newline at end of file diff --git a/gangtest/template.txt b/gangtest/template.txt new file mode 100644 index 0000000..f6a3943 --- /dev/null +++ b/gangtest/template.txt @@ -0,0 +1 @@ +here is doc: ◊(cdr doc) \ No newline at end of file