Scribfile: File and Operating System related Scribble Functionality
Grant Rettke <grettke@acm.org>
1 File Loading
1.1 lispblock0
syntax
(lispblock0 options ... path)
If you want to use Scribble for non-Racket languages, this is a decent substitute; you get the power of Scribble with only a little loss of functionality. For example, to load some JESS code, the following:
@lispblock0{sample.clp} |
results in:
; account for anything |
(watch all) |
(reset) |
(defrule do-anything |
"A rule for anything." |
?ne <- (anything) |
=> |
(printout t "Someone did something.") |
(retract ?ne)) |
(assert (anything)) |
(run) |
2 File Execution
2.1 systemout
syntax
(systemout command)
It works on Linux, but not Windows (use systemout* instead).
If you want to capture the results of arbitrary commands, then this is a simple way to do it. For example on Linux:
@systemout["~/git/scribfile/scribfile/test.sh"] |
results in:
This is a message going to STDOUT. |
This is a message going to STDERR. |
2.2 systemout*
syntax
(systemout* command args ...)
It works on Linux and Windows.
@systemout*["/bin/ls" "-a" "-l"] |
results in:
total 88 |
drwxrwxr-x 4 gcr gcr 4096 Jan 15 12:14 . |
drwxr-xr-x 4 gcr gcr 4096 Jan 14 20:47 .. |
drwxrwxr-x 3 gcr gcr 4096 Jan 14 20:25 compiled |
-rw-rw-r-- 1 gcr gcr 104 Jan 14 20:41 .gitignore |
-rw-rw-r-- 1 gcr gcr 1893 Jan 15 10:58 info.rkt |
-rw-rw-r-- 1 gcr gcr 2341 Jan 14 20:29 info.rkt~ |
drwxrwxr-x 3 gcr gcr 4096 Jan 14 20:35 planet-docs |
-rw-rw-r-- 1 gcr gcr 2964 Jan 14 16:20 racket.css |
-rw-rw-r-- 1 gcr gcr 197 Jan 14 20:13 sample.clp |
-rw-rw-r-- 1 gcr gcr 5062 Jan 14 16:05 scribble-common.js |
-rw-rw-r-- 1 gcr gcr 7697 Jan 14 16:05 scribble.css |
-rw-rw-r-- 1 gcr gcr 0 Jan 14 16:05 scribble-style.css |
-rw-rw-r-- 1 gcr gcr 12412 Jan 15 11:25 scribfile.html |
-rw-rw-r-- 1 gcr gcr 1811 Jan 15 12:20 scribfile.rkt |
-rw-rw-r-- 1 gcr gcr 19 Jan 14 15:45 scribfile.rkt~ |
-rw-rw-r-- 1 gcr gcr 1785 Jan 15 12:32 scribfile.scrbl |
-rw-rw-r-- 1 gcr gcr 23 Jan 14 16:03 scribfile.scrbl~ |
-rwxrwxr-x 1 gcr gcr 98 Jan 15 10:57 test.sh |