www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

scribble-enhanced-example.lp2.rkt (1650B)


      1 #lang scribble/lp2
      2 @(require scribble-enhanced/doc)
      3 @doc-lib-setup
      4 
      5 @title[#:style manual-doc-style]{Implementation of structures}
      6 
      7 @;Racket is distributed with implementations of many SRFIs, most of
      8 @;which can be implemented as libraries. To import the bindings of SRFI
      9 @;@math{n}, use
     10 @;
     11 @;@racketblock[
     12 @;(require @#,elem{@racketidfont{srfi/}@math{n}})
     13 @;]
     14 
     15 @section{A section}
     16 
     17 In section @secref{doc/example|foo} we present, blah blah.
     18 
     19 @subsection[#:tag "doc/example|foo"]{My subsection}
     20 
     21 @;Works only with HTML, as \class is not defined. TODO: define it.
     22 @;@$${\frac{\href{//jsmaniac.github.io}{2x}}{\class{some-css-class}{x^2}}}
     23 
     24 
     25 @(colorize (filled-ellipse 30 15) "blue")
     26 @; Line comment
     27 
     28 Blah @math{n}, as described by M@._ Foo@.__
     29 @racketblock[
     30  (require @#,elem{@racketidfont{srfi/}@math{n}})]
     31 
     32 @(define to-insert 42)
     33 @chunk[<scribble-enhanced-example.lp2.rkt-main-chunk>
     34        ;(displayln #,to-insert) ;; Should work.
     35        (provide some-ident)
     36        <some-ident>
     37        
     38        (module* test racket
     39          (require (submod ".."))
     40          (require rackunit)
     41          (check-equal? (some-ident) "foo"))]
     42 
     43 @CHUNK[<some-ident>
     44        (define (some-ident)
     45          (syntax-e #`#,"foo"))]
     46 
     47 @itemlist[
     48  @item{Item 1}
     49  @item{Item 2}]
     50 
     51 It would be nice to be able to alter existing chunks, by inserting stuff later,
     52 for example:
     53 
     54 @chunk[<c>
     55        (define-syntax-rule (double x)
     56          (+ x x))]
     57 
     58 But we would actually want:
     59 
     60 @chunk[<redef-c>
     61        (define-syntax-rule (double x) -- should be greyed out
     62          (let ((x-cache x))
     63            (+ x-cache x-cache))) -- everything except the changed bits should
     64        -- be greyed out]