Thank you guys!<br>I brought the modfile.rkt out to the directory where I
am writing the scrbl files and imported it as shown in one of the other
scriblings (reader-extractor I think), worked like a charm!<br>Cheers!<br>(I know I'm probably doing something stupid by bringing files out from /usr/plt/... but what works works!)<br><br><div class="gmail_quote">On Wed, Sep 29, 2010 at 7:10 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5"><br>
On Sep 29, 2010, at 7:24 AM, Matthew Flatt wrote:<br>
<br>
> At Wed, 29 Sep 2010 14:40:17 +0530, Ishaan Singh wrote:<br>
>> I'm new here, but went through the documentation and couldn't find an answer<br>
>> to this so was wondering:<br>
>> If I want to write a scribble file and somehow 'include' a text file by just<br>
>> referencing the name of that text file, is it possible?<br>
>> I want to do this to set up an example and add scheme codes '.ss' but want<br>
>> to make it such that if i make changes to the scheme code in the .ss files,<br>
>> and then re-execute scribble --html, the updated code should be embedded in<br>
>> the generated html file.<br>
><br>
> See "collects/scribblings/guide/modfile.rkt".<br>
><br>
> The "modfile.rkt" module defines a `racketmodfile' form that is like<br>
> `racketmod', but `racketmodfile' takes the content to typeset from a<br>
> file.<br>
><br>
> Something like that is probably what you want. In fact, let me know how<br>
> what you wanted differs, because I should add a suitably general form<br>
> of `racketmodfile' in the Scribble libraries.<br>
<br>
</div></div>If you don't want it type set you may wish to write a function like this:<br>
<br>
(provide/contract<br>
[file-is<br>
;; read count lines from file f and label it 'name' in the scribble document<br>
(-> natural-number/c (and/c string? file-exists?) string?<br>
nested-flow?)])<br>
<br>
<br>
(define (file-is count f name)<br>
(define prefix (map tt (append (take (read-lines f) count) '("..."))))<br>
(define newln* (add-between prefix nl))<br>
(centered<br>
(tabular (list (list "file name:" sp (italic name))))<br>
(tabular (list (list newln*)))))<br>
<br>
<br>
<br>
</blockquote></div><br>