commit 54606422140136dbc8f0759f2d44e757a0193ac4
parent ac37653988764b089e41a9c9fe1c1db5887312f1
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Wed, 27 Feb 2019 14:53:49 -0700
make `verbatim` suppress line breaks in HTML output
Diffstat:
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/scribble-doc/scribblings/scribble/config.scrbl b/scribble-doc/scribblings/scribble/config.scrbl
@@ -369,6 +369,7 @@ The style classes:
add space before and after suitable for code.}]
[@css{SCentered} @elem{For a @racket[nested-flow] created by @racket[centered]: horizontally
centered.}]
+ [@css{SVerbatim} @elem{For a @racket[table] created by @racket[verbatim]: disables line breaks.}]
[@spacer @spacer]
@@ -630,7 +631,10 @@ style:
with the @racket['code-inset] style name.}
@item{@ltxe{SVInsetFlow} environment --- for a @racket[nested-flow]
- with the @racket['vertical-inset] style name.}
+ with the @racket['vertical-inset] style name.}
+
+ @item{@ltxe{SVerbatim} environment --- for a @racket[table] created
+ by @racket[verbatim].}
@item{@ltxd[1]{SCodeBox}, @ltxd[1]{SVInsetBox} --- for a
@racket[nested-flow] with the @racket['code-inset] or
diff --git a/scribble-lib/scribble/base.rkt b/scribble-lib/scribble/base.rkt
@@ -759,7 +759,7 @@
;; and non-strings --- to a paragraph for the line:
(let* ([line (indent (strs->elts line))])
(list (make-paragraph omitable-style (make-nonempty line)))))
- (make-table plain (map make-line lines)))
+ (make-table (make-style "SVerbatim" null) (map make-line lines)))
(define omitable-style (make-style 'omitable null))
diff --git a/scribble-lib/scribble/scribble.css b/scribble-lib/scribble/scribble.css
@@ -452,6 +452,10 @@ ol ol ol ol { list-style-type: upper-alpha; }
border: 0;
}
+.SVerbatim {
+ white-space: nowrap;
+}
+
.SAuthorListBox {
position: relative;
float: right;
diff --git a/scribble-lib/scribble/scribble.tex b/scribble-lib/scribble/scribble.tex
@@ -387,6 +387,9 @@
% Helper for box-mode macros:
\newcommand{\Svcenter}[1]{$\vcenter{#1}$}
+% Verbatim
+\newenvironment{SVerbatim}{}{}
+
% Helper to work around a problem with "#"s for URLs within \href
% within other macros:
\newcommand{\Shref}[3]{\href{#1\##2}{#3}}