Merge pull request #18 from vishesh/master
FIX broken standalone build by ditching XHTML in favor of HTML #17
This commit is contained in:
commit
e792c32a3a
|
@ -1,7 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "assemble.rkt"
|
||||
"quote-cdata.rkt"
|
||||
"../logger.rkt"
|
||||
"../make/make.rkt"
|
||||
"../make/make-structs.rkt"
|
||||
|
@ -43,7 +42,7 @@
|
|||
|
||||
(provide package
|
||||
package-anonymous
|
||||
package-standalone-xhtml
|
||||
package-standalone-html
|
||||
get-inert-code
|
||||
get-standalone-code
|
||||
write-standalone-code
|
||||
|
@ -506,14 +505,13 @@ M.installedModules[~s] = function() {
|
|||
|
||||
|
||||
|
||||
;; package-standalone-xhtml: X output-port -> void
|
||||
(define (package-standalone-xhtml source-code op)
|
||||
;; package-standalone-html: X output-port -> void
|
||||
(define (package-standalone-html source-code op)
|
||||
(display (get-header) op)
|
||||
(display (quote-cdata
|
||||
(string-append (get-runtime)
|
||||
(display (string-append (get-runtime)
|
||||
(get-inert-code source-code
|
||||
(lambda () (error 'package-standalone-xhtml)))
|
||||
invoke-main-module-code)) op)
|
||||
(lambda () (error 'package-standalone-html)))
|
||||
invoke-main-module-code) op)
|
||||
(display *footer* op))
|
||||
|
||||
|
||||
|
@ -591,7 +589,7 @@ M.installedModules[~s] = function() {
|
|||
(format
|
||||
#<<EOF
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<html xml:lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1.0, width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta charset="utf-8"/>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "assemble.rkt"
|
||||
"quote-cdata.rkt"
|
||||
"../logger.rkt"
|
||||
"../make/make.rkt"
|
||||
"../make/make-structs.rkt"
|
||||
|
@ -43,7 +42,7 @@
|
|||
|
||||
(provide package
|
||||
package-anonymous
|
||||
package-standalone-xhtml
|
||||
package-standalone-html
|
||||
get-inert-code
|
||||
get-standalone-code
|
||||
write-standalone-code
|
||||
|
@ -506,14 +505,13 @@ M.installedModules[~s] = function() {
|
|||
|
||||
|
||||
|
||||
;; package-standalone-xhtml: X output-port -> void
|
||||
(define (package-standalone-xhtml source-code op)
|
||||
;; package-standalone-html: X output-port -> void
|
||||
(define (package-standalone-html source-code op)
|
||||
(display (get-header) op)
|
||||
(display (quote-cdata
|
||||
(string-append (get-runtime)
|
||||
(display (string-append (get-runtime)
|
||||
(get-inert-code source-code
|
||||
(lambda () (error 'package-standalone-xhtml)))
|
||||
invoke-main-module-code)) op)
|
||||
(lambda () (error 'package-standalone-html)))
|
||||
invoke-main-module-code) op)
|
||||
(display *footer* op))
|
||||
|
||||
|
||||
|
@ -591,7 +589,7 @@ M.installedModules[~s] = function() {
|
|||
(format
|
||||
#<<EOF
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<html xml:lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="initial-scale=1.0, width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta charset="utf-8"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
;; Usage:
|
||||
;;
|
||||
;; * Build standalone .xhtml application.
|
||||
;; * Build standalone .html application.
|
||||
;;
|
||||
;; $ whalesong build main-module-name.rkt
|
||||
;;
|
||||
|
@ -102,8 +102,8 @@
|
|||
dest-dir
|
||||
("Set destination directory (default: current-directory)")
|
||||
(current-output-dir dest-dir)]
|
||||
[("--as-standalone-xhtml")
|
||||
("Write single standalone xhtml file")
|
||||
[("--as-standalone-html")
|
||||
("Write single standalone html file")
|
||||
(as-standalone-html? #t)]
|
||||
#:multi
|
||||
[("--include-script")
|
||||
|
@ -115,7 +115,7 @@
|
|||
|
||||
(maybe-with-profiling
|
||||
(if (as-standalone-html?)
|
||||
(build-standalone-xhtml path)
|
||||
(build-standalone-html path)
|
||||
(build-html-and-javascript path)))]
|
||||
|
||||
["print-il" "print the intermediate translation of a module"
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
(flush-output (current-report-port))]))
|
||||
(loop)))))))
|
||||
|
||||
(define (build-standalone-xhtml f)
|
||||
(define (build-standalone-html f)
|
||||
(with-catchall-exception-handler
|
||||
(lambda ()
|
||||
(turn-on-logger!)
|
||||
|
@ -104,7 +104,7 @@
|
|||
(build-path
|
||||
(regexp-replace #rx"[.](rkt|ss)$"
|
||||
(path->string filename)
|
||||
".xhtml"))])
|
||||
".html"))])
|
||||
(unless (directory-exists? (current-output-dir))
|
||||
(fprintf (current-report-port) "Creating destination directory ~s\n" (current-output-dir))
|
||||
(make-directory* (current-output-dir)))
|
||||
|
@ -129,10 +129,10 @@
|
|||
(build-path (current-output-dir)
|
||||
(resource-key r)))]))])
|
||||
(fprintf (current-report-port)
|
||||
(format "Writing program ~s\n" (build-path (current-output-port) output-filename)))
|
||||
(format "Writing program ~s\n" (build-path (current-output-dir) output-filename)))
|
||||
(call-with-output-file* (build-path (current-output-dir) output-filename)
|
||||
(lambda (op)
|
||||
(package-standalone-xhtml
|
||||
(package-standalone-html
|
||||
(make-MainModuleSource
|
||||
(normalize-path (build-path f)))
|
||||
op))
|
||||
|
|
Loading…
Reference in New Issue
Block a user