From bb79dcff2d7b6f4d958239b6a4e660158ad570af Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 20 Sep 2013 22:34:04 -0600 Subject: [PATCH] scribble: CSS repairs & clean-up toward documentation of class names original commit: 7d0dc0e6581e3f167058f99efbd241a1dd91074a --- .../scribblings/scribble/core.scrbl | 2 +- .../scribble-lib/scribble/html-render.rkt | 20 +++++----- .../scribble-lib/scribble/scribble.css | 39 +++++++------------ .../scribble-lib/scribble/scribble.tex | 3 +- 4 files changed, 26 insertions(+), 38 deletions(-) diff --git a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl index 45b95952..b8dfe219 100644 --- a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl +++ b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl @@ -404,7 +404,7 @@ The recognized @tech{style properties} are as follows: the listing.} @item{@racket['no-toc] --- As a @tech{style property} for the main part of a - document, causes the HTML output to not include a margin box + rendered page, causes the HTML output to not include a margin box for the main table of contents; the ``on this page'' box that contains @racket[toc-element] and @racket[toc-target-element] links (and that only includes an ``on this page'' label for diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/html-render.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/html-render.rkt index fb98ddc1..3e6b6ee3 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/html-render.rkt +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/html-render.rkt @@ -522,8 +522,9 @@ ,(if expand? 9660 9658)))) (td () ,@num) (td () ,@title)))) - `(div ([class "tocviewlist"] - ,@(if top? `([style "margin-bottom: 1em;"]) '())) + `(div ([class ,(if top? + "tocviewlist tocviewlisttopspace" + "tocviewlist")]) ,(if top? `(div ([class "tocviewtitle"]) ,header) header) ,(if (null? children) "" @@ -626,7 +627,7 @@ blocks)) (table-blockss table))) (define ps - ((if (nearly-top? d) values (lambda (p) (if (pair? p) (cdr p) null))) + ((if (or (nearly-top? d) (eq? d top)) values (lambda (p) (if (pair? p) (cdr p) null))) (let flatten ([d d] [prefixes null] [top? #t]) (let ([prefixes (if (and (not top?) (part-tag-prefix d)) (cons (part-tag-prefix d) prefixes) @@ -1344,7 +1345,7 @@ [(roman) '([class "sroman"])] [(url) '([class "url"])] [(no-break) '([class "nobreak"])] - [(sf) '([style "font-family: sans-serif; font-size: 80%; font-weight: bold"])] + [(sf) '([class "ssansserif"])] [(superscript) '([style "vertical-align: super; font-size: 80%"])] [(subscript) '([style "vertical-align: sub; font-size: 80%"])] [(smaller) '([class "Smaller"])] @@ -1466,14 +1467,15 @@ ,@(super render-compound-paragraph t part ri starting-item?))))) (define/override (render-itemization t part ri) - (let ([style-str (or (and (string? (style-name (itemization-style t))) - (style-name (itemization-style t))) - (and (eq? 'compact (itemization-style t)) - "compact"))]) + (let ([style-str (and (string? (style-name (itemization-style t))) + (style-name (itemization-style t)))]) `((,(if (eq? 'ordered (style-name (itemization-style t))) 'ol 'ul) - ,(style->attribs (itemization-style t)) + (,@(style->attribs (itemization-style t)) + ,@(if (eq? 'compact (style-name (itemization-style t))) + `([class "compact"]) + '())) ,@(map (lambda (flow) `(li ,(if style-str `([class ,(string-append style-str "Item")]) `()) diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.css b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.css index 045d7e87..9c1b2041 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.css +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.css @@ -18,9 +18,13 @@ } /* Sans-serif: */ -.version, .versionNoNav { +.version, .versionNoNav, .ssansserif { font-family: sans-serif; } +.ssansserif { + font-size: 80%; + font-weight: bold; +} /* ---------------------------------------- */ @@ -193,7 +197,7 @@ table td { margin-bottom: 0; } -.refparaleft { +.refparaleft, .refelemleft { position: relative; float: left; right: 2em; @@ -202,7 +206,7 @@ table td { margin: 0em 0em 0em -13em; } -.refcolumnleft, .refelemleft { +.refcolumnleft { background-color: #F5F5DC; display: block; position: relative; @@ -262,6 +266,10 @@ table td { font-size: 82%; } +.tocviewlisttopspace { + margin-bottom: 1em; +} + .tocviewsublist, .tocviewsublistonly, .tocviewsublisttop, .tocviewsublistbottom { margin-left: 0.4em; border-left: 1px solid #bbf; @@ -328,14 +336,6 @@ table td { margin: 0.2em; } -.sepspace { - font-size: 40%; -} - -.septitle { - font-size: 70%; -} - /* ---------------------------------------- */ /* Some inline styles */ @@ -347,16 +347,6 @@ table td { white-space: nowrap; } -.stt { -} - -.title { - font-size: 200%; - font-weight: normal; - margin-top: 2.8em; - text-align: center; -} - pre { margin-left: 2em; } blockquote { margin-left: 2em; } @@ -365,9 +355,6 @@ ol ol { list-style-type: lower-alpha; } ol ol ol { list-style-type: lower-roman; } ol ol ol ol { list-style-type: upper-alpha; } -i { -} - .SCodeFlow { display: block; margin-left: 1em; @@ -431,11 +418,11 @@ i { margin-right: 0.3em; } -.Smaller{ +.Smaller { font-size: 82%; } -.Larger{ +.Larger { font-size: 122%; } diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex index 3641debc..0d85f5da 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex @@ -83,7 +83,6 @@ \newcommand{\badlink}[1]{#1} \newcommand{\indexlink}[1]{#1} \newcommand{\noborder}[1]{#1} -\newcommand{\imageleft}[1]{} % drop it \newcommand{\Smaller}[1]{\textsmaller{#1}} \newcommand{\Larger}[1]{\textlarger{#1}} \newcommand{\planetName}[1]{PLane\hspace{-0.1ex}T} @@ -171,7 +170,7 @@ \newcommand{\refparaleft}[1]{\reversemarginpar\marginpar{\raggedright \footnotesize #1}} \newcommand{\refelemleft}[1]{\refparaleft{#1}} -\newenvironment{refcolumnleft}{\begin{refcolumn}}{\end{refcolumn}} +\newenvironment{refcolumnleft}{}{} % Macros used by `title' and `author': \newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}\author{#3}\maketitle}