Commit 78cfde24 authored by Robert Ricci's avatar Robert Ricci

Start experimenting with a different way of embedding code samples

Make a new element rather than trying to use scribble's own code
element. The problem with Scribble's way of doing things is that it
makes this weird table thing, which is going to interfere with using
a Javascript to do syntax highlighting on the code. This way, it's all
in one element and we can more easily style it from outside.

Suggested by mflatt
parent f7c8f2be
.code-sample {
display: block;
unicode-bidi: embed;
font-family: monospace;
white-space: pre;
border: 1px solid #000000;
#lang racket/base
(require scribble/base)
(require scribble/core)
(require scribble/decode)
(require scribble/manual)
(require scribble/html-properties)
(require scribble/latex-properties)
(require racket/class)
(require racket/draw)
(require racket/system)
......@@ -118,5 +121,10 @@
(define (ssh)
(tt "ssh"))
(define code-sample-style
(make-style "code-sample"
(list (make-css-addition "code-sample.css")
(make-tex-addition "code-sample.tex"))))
(define (code-sample filename)
(code-inset (verbatim (file->string (string-append "code-samples/" filename)))))
(elem #:style code-sample-style (file->string (string-append "code-samples/" filename))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment