change margin-note to generate a blockquote insteda of a single paragraph

svn: r14535
This commit is contained in:
Matthew Flatt 2009-04-17 01:30:15 +00:00
parent 09320cea1c
commit 8aa8b938a0
8 changed files with 38 additions and 17 deletions

View File

@ -1119,7 +1119,7 @@
(define/override (render-blockquote t part ri)
`((blockquote ,(if (string? (blockquote-style t))
`([class ,(blockquote-style t)])
`([class ,(regexp-replace #rx"^[\\]" (blockquote-style t) "")])
`())
,@(append-map (lambda (i) (render-block i part ri #f))
(blockquote-paragraphs t)))))

View File

@ -403,10 +403,14 @@
(define/override (render-blockquote t part ri)
(let ([kind (or (blockquote-style t) "quote")])
(printf "\\begin{~a}" kind)
(if (regexp-match #rx"^[\\]" kind)
(printf "~a{" kind)
(printf "\\begin{~a}" kind))
(parameterize ([current-table-mode (list "blockquote" t)])
(render-flow (make-flow (blockquote-paragraphs t)) part ri #f))
(printf "\\end{~a}" kind)
(if (regexp-match #rx"^[\\]" kind)
(printf "}")
(printf "\\end{~a}" kind))
null))
(define/override (render-other i part ri)

View File

@ -199,10 +199,15 @@
`(part ,(doc-prefix '(lib "scribblings/guide/guide.scrbl") "hash-lang"))))
(define (margin-note . c)
(make-styled-paragraph
(list (make-element "refcolumn"
(list (make-element "refcontent" (decode-content c)))))
"refpara"))
(make-blockquote
"\\refpara"
(list
(make-blockquote
"refcolumn"
(list
(make-blockquote
"refcontent"
(flow-paragraphs (decode-flow c))))))))
(define void-const
(schemeresultfont "#<void>"))

View File

@ -152,9 +152,16 @@ table td {
width: 13em;
font-size: 85%;
border: 0.5em solid #F5F5DC;
margin: 0 0 0 0;
}
.refcontent {
margin: 0 0 0 0;
}
.refcontent p {
margin-top: 0;
margin-bottom: 0;
}
/* ---------------------------------------- */

View File

@ -42,8 +42,6 @@
\newcommand{\schemeopt}[1]{#1}
\newcommand{\textsub}[1]{$_{\hbox{\textsmaller{#1}}}$}
\newcommand{\textsuper}[1]{$^{\hbox{\textsmaller{#1}}}$}
\newcommand{\refcolumn}[1]{#1}
\newcommand{\refcontent}[1]{#1}
\newcommand{\intextcolor}[2]{\textcolor{#1}{#2}}
\newcommand{\intextrgbcolor}[2]{\textcolor[rgb]{#1}{#2}}
\newcommand{\incolorbox}[2]{{\fboxrule=0pt\fboxsep=0pt\colorbox{#1}{#2}}}
@ -58,9 +56,12 @@
\newcommand{\noborder}[1]{#1}
\newcommand{\imageleft}[1]{} % drop it
\renewcommand{\smaller}[1]{\textsmaller{#1}}
\newcommand{\refpara}[1]{\marginpar{\raggedright \footnotesize #1}}
\newcommand{\planetName}[1]{PLane\hspace{-0.1ex}T}
\newcommand{\refpara}[1]{\marginpar{\raggedright \footnotesize #1}}
\newenvironment{refcolumn}{}{}
\newenvironment{refcontent}{}{}
\newcommand{\titleAndEmptyVersion}[2]{\title{#1}\maketitle}
\newcommand{\titleAndVersion}[2]{\title{#1\\{\normalsize Version #2}}\maketitle}

View File

@ -43,12 +43,15 @@ When a string is uses as a style in an @scheme[element],
@scheme[styled-paragraph], @scheme[table],
@scheme[styled-itemization], or @scheme[blockquote], it corresponds to
a CSS class for HTML output or a Tex macro/environment for Latex
output. In Latex output, the string is used as a macro name for a
output. In Latex output, the string is used as a command name for a
@scheme[styled-paragraph] and an environment name for a
@scheme[table], @scheme[itemization], or @scheme[blockquote]. In
addition, for an itemization, the style string is suffixed with
@scheme["Item"] and used as a CSS class or Tex macro name to use for
the itemization's items (in place of @tt{item} in the case of Latex).
@scheme[table], @scheme[itemization], or @scheme[blockquote], except
that a @scheme[blockquote] style name that starts with @litchar{\} is
used (sans @litchar{\}) as a command instead of an environment.
In addition, for an itemization, the style string is
suffixed with @scheme["Item"] and used as a CSS class or Tex macro
name to use for the itemization's items (in place of @tt{item} in the
case of Latex).
Scribble includes a number of predefined styles that are used by the
exports of @scheme[scribble/manual], but they are not generally

View File

@ -1141,7 +1141,7 @@ centered table with the @scheme[pre-flow] parsed by
an inset command-line example (e.g., in typewriter font).}
@defproc[(margin-note [pre-content any/c] ...) paragraph?]{Produces
a paragraph to be typeset in the margin instead of inlined.}
a @tech{blockquote} to be typeset in the margin instead of inlined.}
@; ------------------------------------------------------------------------
@section[#:tag "index-entries"]{Index-Entry Descriptions}

View File

@ -476,7 +476,8 @@ The @scheme[style] can be
A @techlink{blockquote} has a style and a list of @tech{blocks}. The
@scheme[style] field is normally a string that corresponds to a CSS
class for HTML output or Latex environment for Latex output (see
class for HTML output or Latex environment for Latex output where a
leading @litchar{\} in the style name is treated specially (see
@secref["extra-style"]).
}