adjusting the documentation to include link to the runtime.

This commit is contained in:
Danny Yoo 2011-07-21 14:04:57 -04:00
parent 22d0522b8c
commit b6682c2a5f
2 changed files with 30 additions and 8 deletions

View File

@ -5,18 +5,17 @@
scribble/eval scribble/eval
racket/sandbox racket/sandbox
(only-in racket/contract any/c) (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 racket/runtime-path
"scribble-helpers.rkt" "scribble-helpers.rkt"
"../last-commit-name.rkt" "../last-commit-name.rkt"
"../js-assembler/get-js-vm-implemented-primitives.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 || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24146890-1']); _gaq.push(['_setAccount', 'UA-24146890-1']);
_gaq.push(['_trackPageview']); _gaq.push(['_trackPageview']);
@ -29,6 +28,9 @@
}| }|
@inject-javascript-src{http://hashcollision.org/whalesong/examples/runtime.js}
@(define-runtime-path whalesong-path "..") @(define-runtime-path whalesong-path "..")

View File

@ -1,13 +1,14 @@
#lang racket/base #lang racket/base
(provide inject-javascript) (provide inject-javascript-inline inject-javascript-src)
(require scribble/core (require scribble/core
scribble/html-properties scribble/html-properties
scriblib/render-cond) scriblib/render-cond)
;; Adds JavaScript if we're rendering in HTML. ;; Adds JavaScript if we're rendering in HTML.
(define (inject-javascript . body) (define (inject-javascript-inline . body)
(cond-element (cond-element
[latex ""] [latex ""]
[html (make-element (make-style #f (list (make-script-property "text/javascript" [html (make-element (make-style #f (list (make-script-property "text/javascript"
@ -16,5 +17,24 @@
[text ""])) [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) ;;(define (google-analytics)
;; (make-tag ;; (make-tag