examples: add "Examples:" label as compound para
Instead of creating a table to combine "Examples:" with the exmaple content, use a compound paragraph (which didn't exist when `examples` was first implemented). A compound paragraph provides better and more consistent typesetting; for example, it doesn't make the word "Examples:" use a fixed-width font in HTML output.
This commit is contained in:
parent
81aeab1687
commit
0bd9a0d070
|
@ -1,7 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt"
|
(require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt"
|
||||||
(only-in "core.rkt" content?)
|
(only-in "core.rkt" content? compound-paragraph plain)
|
||||||
racket/contract/base
|
racket/contract/base
|
||||||
racket/file
|
racket/file
|
||||||
racket/list
|
racket/list
|
||||||
|
@ -170,9 +170,18 @@
|
||||||
(if inset?
|
(if inset?
|
||||||
(let ([p (code-inset (make-table block-color lines))])
|
(let ([p (code-inset (make-table block-color lines))])
|
||||||
(if title
|
(if title
|
||||||
(make-table block-color (list (list.flow.list title) (list.flow.list p)))
|
(compound-paragraph
|
||||||
|
plain
|
||||||
|
(list
|
||||||
|
title
|
||||||
|
p))
|
||||||
p))
|
p))
|
||||||
(make-table block-color (if title (cons (list.flow.list title) lines) lines)))))
|
(if title
|
||||||
|
(compound-paragraph plain
|
||||||
|
(list
|
||||||
|
title
|
||||||
|
(make-table block-color lines)))
|
||||||
|
(make-table block-color lines)))))
|
||||||
|
|
||||||
;; extracts from a datum or syntax object --- while keeping the
|
;; extracts from a datum or syntax object --- while keeping the
|
||||||
;; syntax-objectness of the original intact, instead of always
|
;; syntax-objectness of the original intact, instead of always
|
||||||
|
@ -843,5 +852,8 @@
|
||||||
(case-lambda
|
(case-lambda
|
||||||
[(t) (as-examples examples-title t)]
|
[(t) (as-examples examples-title t)]
|
||||||
[(example-title t)
|
[(example-title t)
|
||||||
(make-table #f (list (list.flow.list example-title)
|
(compound-paragraph
|
||||||
(list (make-flow (do-splice (list t))))))]))
|
plain
|
||||||
|
(list
|
||||||
|
example-title
|
||||||
|
(make-table #f (list (list (make-flow (do-splice (list t))))))))]))
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
(make-blockquote "insetpara" (flow-paragraphs (decode-flow c))))
|
(make-blockquote "insetpara" (flow-paragraphs (decode-flow c))))
|
||||||
|
|
||||||
(define code-inset-style
|
(define code-inset-style
|
||||||
(make-style 'code-inset null))
|
(make-style 'code-inset '(never-indents)))
|
||||||
(define (code-inset b)
|
(define (code-inset b)
|
||||||
(make-blockquote code-inset-style (list b)))
|
(make-blockquote code-inset-style (list b)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user