dev-gang-render
Matthew Butterick 3 years ago
parent 5dff753c01
commit e9cb0e8478

@ -0,0 +1,2 @@
#lang pollen
40 file

@ -0,0 +1,2 @@
#lang pollen
41 file

@ -0,0 +1,2 @@
#lang pollen
42 file

@ -0,0 +1,2 @@
#lang pollen
43 file

@ -0,0 +1,2 @@
#lang pollen
44 file

@ -0,0 +1,2 @@
#lang pollen
45 file

@ -0,0 +1,2 @@
#lang pollen
46 file

@ -0,0 +1,2 @@
#lang pollen
47 file

@ -0,0 +1,2 @@
#lang pollen
48 file

@ -0,0 +1,2 @@
#lang pollen
49 file

@ -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)))

@ -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))

@ -0,0 +1,6 @@
#lang br
(module setup racket/base
(provide (all-defined-out))
#;(define render-cache-active #false)
#;(define compile-cache-active #false))

@ -0,0 +1 @@
here is doc: ◊(cdr doc)
Loading…
Cancel
Save