racket / racket/scribble

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

Open
#46 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
250
Forks
102
Avg merge
11d 11h
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example document using scribble/example with #:lang racket and compare its HTML output with the version without #:lang. Start by tracing how the #:lang argument processes the indented definitions, then verify that the cairo-lib and cairo-create bodies retain their indentation in the generated HTML.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.