[Tb] Including "source code" in notes

From: Oliver Wrede <Wrede__AT__fh-aachen.de>
Date: Thu Apr 08 2004 - 05:58:44 EDT

Am 07.04.2004 um 17:23 schrieb Gary King:

> I'd like to have a note that includes some source code (Lisp in this
> case). For example:
>
> blah, blah, blah...
>
> (defun mean (list)
> (let ((sum 0) (count 0))
> (loop for x in list do
> (incf sum x)
> (incf count))
> (float (/ sum count))))
>
> blah, blah, blah...
>
> The problem is that Tinderbox treats each line of the source code as a
> separate paragraph which means that the source code is all separated
> out with great big gaps... Some programs let you type "control+Return"
> to add a newline without starting a new paragraph but Tinderbox
> doesn't seem to allow this.
>
> Any ideas...

Hello Gary.

I would add a prototype for code elements and redefine these attributes:

HTMLExportBefore to <code>
HTMLExporAfter to </code>
HTMLFirstParagraphStart blank
HTMLFirstParagraphEnd to <br/>
HTMLParagraphStart blank
HTMLParagraphEnd to <br/>

You potentially want to try PRE instead of CODE as well. The problem
could be that the spaces in the beginning of each line need to be
displayed - I am not sure how CODE behaves here...

The template should be a file containing maybe just this line:

^text^

Regards,
Oliver

Prof. Oliver Wrede
e-Mail: wrede__AT__fh-aachen.de
Web: http://wrede.interfacedesign.org/

Aachen University of Applied Sciences
Department of Design
Boxgraben 100
54062 Aachen
Germany
Received on Thu Apr 8 05:58:44 2004

This archive was generated by hypermail 2.1.8 : Wed Dec 14 2005 - 10:45:20 EST