racket / scribble

Other
199 stars 91 forks source link

Using @examples from scribble/example with #:lang can mess up indentation #46

Open takikawa opened 8 years ago

takikawa commented 8 years ago

Here is an example document that illustrates the issue:

#lang scribble/manual

@(require scribble/example)

@examples[#:lang racket
(require racket/gui/base
         ffi/unsafe
         ffi/unsafe/define)
(define cairo-lib
  (ffi-lib #f))
(define-ffi-definer define-cairo
                    (ffi-lib #f))
(define-cairo cairo-create
  (_fun _pointer -> _pointer)
  #:c-id cairo_create)
]

If you produce HTML output from this, the indentation of the cairo-lib definition and the cairo-create definition are both off. The indented lines are shown with no indentation. Removing the #:lang racket argument restores the correct indentation behavior.

mflatt commented 8 years ago

It's a strange workaround, but FWIW, I think moving the racket the next line also avoids the problem.