bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8002d98e5d93683287dd03f09b024e689fb75eb8
parent b951c48fca62ef7dbe36f8691f5a6c418afe033a
Author: Matthew Flatt <mflatt@racket-lang.org>
Date:   Fri,  2 Nov 2012 07:39:33 -0600

scribble: more control over version formatting

Add "Version" in front of a version name via `.version:before' or
`.versionNoNav:before' and `\SVersionBefore', so that they can
be configured through overriding CSS or Latex macro declarations.

Also, improve the documentation for how the `#:version' argument
of `title' is propagated to a `part' style property.

Closes PR 13227

original commit: a830f77403a1f51de7359c7946b01ef10d401cee

Diffstat:
Mcollects/scribble/html-render.rkt | 2+-
Mcollects/scribble/scribble.css | 4++++
Mcollects/scribble/scribble.tex | 5+++--
Mcollects/scribblings/scribble/core.scrbl | 7++++++-
Mcollects/scribblings/scribble/decode.scrbl | 10++++++----
5 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/collects/scribble/html-render.rkt b/collects/scribble/html-render.rkt @@ -890,7 +890,7 @@ (list (make-element (if (include-navigation?) "version" "versionNoNav") - (list "Version: " v))) + v)) d ri)))))) diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css @@ -154,6 +154,10 @@ table td { font-size: xx-small; /* avoid overlap with author */ } +.version:before, .versionNoNav:before { + content: "Version "; +} + /* ---------------------------------------- */ /* Margin notes */ diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex @@ -141,12 +141,13 @@ \newenvironment{refcolumnleft}{\begin{refcolumn}}{\end{refcolumn}} % Macros used by `title' and `author': -\newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize Version #2}}\author{#3}\maketitle} -\newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize Version #2}}#3\maketitle} +\newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}\author{#3}\maketitle} +\newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}#3\maketitle} \newcommand{\titleAndEmptyVersionAndAuthors}[3]{\title{#1}\author{#3}\maketitle} \newcommand{\titleAndEmptyVersionAndEmptyAuthors}[3]{\title{#1}\maketitle} \newcommand{\SAuthor}[1]{#1} \newcommand{\SAuthorSep}[1]{\qquad} +\newcommand{\SVersionBefore}[1]{Version } % Useful for some styles, such as sigalternate: \newcommand{\SNumberOfAuthors}[1]{} diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl @@ -400,7 +400,12 @@ The recognized @tech{style properties} are as follows: not @racket[""] may be used when rendering a document; at a minimum, a non-@racket[""] version is rendered when it is attached to a part representing the whole document. The default - version for a document is @racket[(version)].} + version for a document is @racket[(version)]. In rendered form, + the version is normally prefixed with the word ``Version,'' but + this formatting can be controlled by overriding + @tt{.version:before} and/or @tt{.versionNoNav:before} in CSS + for HTML rendering or by redefining the @tt{\SVersionBefore} + macro for Latex rendering (see @secref["config"]).} @item{@racket[document-date] structure --- A date for the part, normally used on a document's main part for for Latex diff --git a/collects/scribblings/scribble/decode.scrbl b/collects/scribblings/scribble/decode.scrbl @@ -168,18 +168,20 @@ otherwise.} @defstruct[title-decl ([tag-prefix (or/c #f string?)] [tags (listof string?)] [version (or/c string? #f)] - [style any/c] + [style style?] [content content?])]{ -See @racket[decode] and @racket[decode-part]. The @racket[_tag-prefix] -and @racket[_style] fields are propagated to the resulting +See @racket[decode] and @racket[decode-part]. The @racket[tag-prefix] +and @racketidfont{style} fields are propagated to the resulting +@racket[part]. If the @racketidfont{version} field is not @racket[#f], +it is propagated as a @racket[document-version] style property on the @racket[part].} @defstruct[part-start ([depth integer?] [tag-prefix (or/c #f string?)] [tags (listof string?)] - [style any/c] + [style style?] [title content?])]{ Like @racket[title-decl], but for a sub-part. See @racket[decode] and