diff --git a/scribblings/manual.scrbl b/scribblings/manual.scrbl index 21c7fd9..c26c69a 100644 --- a/scribblings/manual.scrbl +++ b/scribblings/manual.scrbl @@ -5,18 +5,17 @@ scribble/eval racket/sandbox (only-in racket/contract any/c) - ; (for-label racket/base) - (for-label (this-package-in lang/base)) - (for-label (this-package-in js)) - - racket/runtime-path "scribble-helpers.rkt" "../last-commit-name.rkt" "../js-assembler/get-js-vm-implemented-primitives.rkt") +@(require (for-label (this-package-in js)) + (for-label (this-package-in lang/base))) -@inject-javascript|{ + + +@inject-javascript-inline|{ var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-24146890-1']); _gaq.push(['_trackPageview']); @@ -29,6 +28,9 @@ }| +@inject-javascript-src{http://hashcollision.org/whalesong/examples/runtime.js} + + @(define-runtime-path whalesong-path "..") diff --git a/scribblings/scribble-helpers.rkt b/scribblings/scribble-helpers.rkt index 2f9555a..bd6b6d4 100644 --- a/scribblings/scribble-helpers.rkt +++ b/scribblings/scribble-helpers.rkt @@ -1,13 +1,14 @@ #lang racket/base -(provide inject-javascript) +(provide inject-javascript-inline inject-javascript-src) (require scribble/core scribble/html-properties scriblib/render-cond) + ;; Adds JavaScript if we're rendering in HTML. -(define (inject-javascript . body) +(define (inject-javascript-inline . body) (cond-element [latex ""] [html (make-element (make-style #f (list (make-script-property "text/javascript" @@ -16,5 +17,24 @@ [text ""])) +(define (inject-javascript-src src) + (cond-element + [latex ""] + [html + (make-element + (make-style #f + (list + (make-alt-tag "script") + (make-attributes + `((type . "text/javascript") + (src . ,src))))) + '())] + + [text ""])) + + + + + ;;(define (google-analytics) ;; (make-tag \ No newline at end of file