From 8a28499503be46a98d34f728a244d3abce6c5a87 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 4 Jun 2010 17:17:09 -0400 Subject: [PATCH] Scheme -> Racket in styles Scribble style names. .tex and .css files original commit: ab70fed8a8c521222950d0cfeb7c58edc02c49c6 --- collects/scribble/private/manual-bib.rkt | 2 +- collects/scribble/private/manual-sprop.rkt | 4 +- collects/scribble/private/manual-style.rkt | 8 +-- collects/scribble/{scheme.css => racket.css} | 56 +++++++++---------- collects/scribble/racket.rkt | 40 +++++++------- collects/scribble/racket.tex | 58 ++++++++++++++++++++ 6 files changed, 113 insertions(+), 55 deletions(-) rename collects/scribble/{scheme.css => racket.css} (82%) create mode 100644 collects/scribble/racket.tex diff --git a/collects/scribble/private/manual-bib.rkt b/collects/scribble/private/manual-bib.rkt index 2e5b70b1..d00e1b1e 100644 --- a/collects/scribble/private/manual-bib.rkt +++ b/collects/scribble/private/manual-bib.rkt @@ -65,7 +65,7 @@ (if date `(" " ,@(decode-content (list date)) ".") null) (if url `(" " ,(link url (tt url))) null))))) -(define-on-demand bib-style (make-style "SBibliography" scheme-properties)) +(define-on-demand bib-style (make-style "RBibliography" scheme-properties)) (define (bibliography #:tag [tag "doc-bibliography"] . citations) (make-unnumbered-part diff --git a/collects/scribble/private/manual-sprop.rkt b/collects/scribble/private/manual-sprop.rkt index 349a73ce..80d7311d 100644 --- a/collects/scribble/private/manual-sprop.rkt +++ b/collects/scribble/private/manual-sprop.rkt @@ -11,5 +11,5 @@ (define-on-demand scheme-properties (let ([abs (lambda (s) (path->main-collects-relative (build-path (collection-path "scribble") s)))]) - (list (make-css-addition (abs "scheme.css")) - (make-tex-addition (abs "scheme.tex"))))) + (list (make-css-addition (abs "racket.css")) + (make-tex-addition (abs "racket.tex"))))) diff --git a/collects/scribble/private/manual-style.rkt b/collects/scribble/private/manual-style.rkt index 98f74075..6784fe8e 100644 --- a/collects/scribble/private/manual-style.rkt +++ b/collects/scribble/private/manual-style.rkt @@ -217,17 +217,17 @@ (define (filebox filename . inside) (make-nested-flow - (make-style "Sfilebox" scheme-properties) + (make-style "Rfilebox" scheme-properties) (list (make-styled-paragraph (list (make-element - (make-style "Sfilename" scheme-properties) + (make-style "Rfilename" scheme-properties) (if (string? filename) (filepath filename) filename))) - (make-style "Sfiletitle" scheme-properties)) + (make-style "Rfiletitle" scheme-properties)) (make-nested-flow - (make-style "Sfilecontent" scheme-properties) + (make-style "Rfilecontent" scheme-properties) (decode-flow inside))))) diff --git a/collects/scribble/scheme.css b/collects/scribble/racket.css similarity index 82% rename from collects/scribble/scheme.css rename to collects/scribble/racket.css index 21b42dbd..0644698e 100644 --- a/collects/scribble/scheme.css +++ b/collects/scribble/racket.css @@ -2,9 +2,9 @@ /* See the beginning of "scribble.css". */ /* Monospace: */ -.ScmIn, .ScmRdr, .ScmPn, .ScmMeta, -.ScmMod, .ScmKw, .ScmVar, .ScmSym, -.ScmRes, .ScmOut, .ScmCmt, .ScmVal { +.RktIn, .RktRdr, .RktPn, .RktMeta, +.RktMod, .RktKw, .RktVar, .RktSym, +.RktRes, .RktOut, .RktCmt, .RktVal { font-family: monospace; } @@ -35,84 +35,84 @@ } /* ---------------------------------------- */ -/* Scheme text styles */ +/* Racket text styles */ -.ScmIn { +.RktIn { color: #cc6633; background-color: #eeeeee; } -.ScmInBG { +.RktInBG { background-color: #eeeeee; } -.ScmRdr { +.RktRdr { } -.ScmPn { +.RktPn { color: #843c24; } -.ScmMeta { +.RktMeta { color: black; } -.ScmMod { +.RktMod { color: black; } -.ScmOpt { +.RktOpt { color: black; } -.ScmKw { +.RktKw { color: black; font-weight: bold; } -.ScmErr { +.RktErr { color: red; font-style: italic; } -.ScmVar { +.RktVar { color: #262680; font-style: italic; } -.ScmSym { +.RktSym { color: #262680; } -.ScmValLink { +.RktValLink { text-decoration: none; color: blue; } -.ScmModLink { +.RktModLink { text-decoration: none; color: blue; } -.ScmStxLink { +.RktStxLink { text-decoration: none; color: black; font-weight: bold; } -.ScmRes { +.RktRes { color: #0000af; } -.ScmOut { +.RktOut { color: #960096; } -.ScmCmt { +.RktCmt { color: #c2741f; } -.ScmVal { +.RktVal { color: #228b22; } @@ -130,7 +130,7 @@ vertical-align: bottom; } -.ScmBlk td { +.RktBlk td { vertical-align: baseline; } @@ -151,7 +151,7 @@ float: right; } -.SBibliography td { +.RBibliography td { vertical-align: text-top; } @@ -165,17 +165,17 @@ margin-right: 1em; } -.Sfilebox { +.Rfilebox { margin-left: 1em; margin-right: 1em; } -.Sfiletitle { +.Rfiletitle { text-align: right; margin: 0em 0em 0em 0em; } -.Sfilename { +.Rfilename { border-top: 1px solid #6C8585; border-right: 1px solid #6C8585; padding-left: 0.5em; @@ -183,6 +183,6 @@ background-color: #ECF5F5; } -.Sfilecontent { +.Rfilecontent { margin: 0em 0em 0em 0em; } diff --git a/collects/scribble/racket.rkt b/collects/scribble/racket.rkt index 08d417f7..9c2be06c 100644 --- a/collects/scribble/racket.rkt +++ b/collects/scribble/racket.rkt @@ -58,26 +58,26 @@ (cons 'tt-chars scheme-properties) scheme-properties))) - (define-on-demand output-color (make-racket-style "ScmOut")) - (define-on-demand input-color (make-racket-style "ScmIn")) - (define-on-demand input-background-color (make-racket-style "ScmInBG")) - (define-on-demand no-color (make-racket-style "ScmPlain")) - (define-on-demand reader-color (make-racket-style "ScmRdr")) - (define-on-demand result-color (make-racket-style "ScmRes")) - (define-on-demand keyword-color (make-racket-style "ScmKw")) - (define-on-demand comment-color (make-racket-style "ScmCmt")) - (define-on-demand paren-color (make-racket-style "ScmPn")) - (define-on-demand meta-color (make-racket-style "ScmMeta")) - (define-on-demand value-color (make-racket-style "ScmVal")) - (define-on-demand symbol-color (make-racket-style "ScmSym")) - (define-on-demand variable-color (make-racket-style "ScmVar")) - (define-on-demand opt-color (make-racket-style "ScmOpt")) - (define-on-demand error-color (make-racket-style "ScmErr" #:tt? #f)) - (define-on-demand syntax-link-color (make-racket-style "ScmStxLink")) - (define-on-demand value-link-color (make-racket-style "ScmValLink")) - (define-on-demand module-color (make-racket-style "ScmMod")) - (define-on-demand module-link-color (make-racket-style "ScmModLink")) - (define-on-demand block-color (make-racket-style "ScmBlk")) + (define-on-demand output-color (make-racket-style "RktOut")) + (define-on-demand input-color (make-racket-style "RktIn")) + (define-on-demand input-background-color (make-racket-style "RktInBG")) + (define-on-demand no-color (make-racket-style "RktPlain")) + (define-on-demand reader-color (make-racket-style "RktRdr")) + (define-on-demand result-color (make-racket-style "RktRes")) + (define-on-demand keyword-color (make-racket-style "RktKw")) + (define-on-demand comment-color (make-racket-style "RktCmt")) + (define-on-demand paren-color (make-racket-style "RktPn")) + (define-on-demand meta-color (make-racket-style "RktMeta")) + (define-on-demand value-color (make-racket-style "RktVal")) + (define-on-demand symbol-color (make-racket-style "RktSym")) + (define-on-demand variable-color (make-racket-style "RktVar")) + (define-on-demand opt-color (make-racket-style "RktOpt")) + (define-on-demand error-color (make-racket-style "RktErr" #:tt? #f)) + (define-on-demand syntax-link-color (make-racket-style "RktStxLink")) + (define-on-demand value-link-color (make-racket-style "RktValLink")) + (define-on-demand module-color (make-racket-style "RktMod")) + (define-on-demand module-link-color (make-racket-style "RktModLink")) + (define-on-demand block-color (make-racket-style "RktBlk")) (define-on-demand highlighted-color (make-racket-style "highlighted" #:tt? #f)) (define current-keyword-list diff --git a/collects/scribble/racket.tex b/collects/scribble/racket.tex new file mode 100644 index 00000000..817f6bc8 --- /dev/null +++ b/collects/scribble/racket.tex @@ -0,0 +1,58 @@ + +% Redefine \SColorize to produce B&W Scheme text +\newcommand{\SColorize}[2]{\color{#1}{#2}} + +\newcommand{\inColor}[2]{{\Scribtexttt{\SColorize{#1}{#2}}}} +\definecolor{PaleBlue}{rgb}{0.90,0.90,1.0} +\definecolor{LightGray}{rgb}{0.90,0.90,0.90} +\definecolor{CommentColor}{rgb}{0.76,0.45,0.12} +\definecolor{ParenColor}{rgb}{0.52,0.24,0.14} +\definecolor{IdentifierColor}{rgb}{0.15,0.15,0.50} +\definecolor{ResultColor}{rgb}{0.0,0.0,0.69} +\definecolor{ValueColor}{rgb}{0.13,0.55,0.13} +\definecolor{OutputColor}{rgb}{0.59,0.00,0.59} + +\newcommand{\RktPlain}[1]{\inColor{black}{#1}} +\newcommand{\RktKw}[1]{{\SColorize{black}{\Scribtexttt{\textbf{#1}}}}} +\newcommand{\RktStxLink}[1]{\RktKw{#1}} +\newcommand{\RktCmt}[1]{\inColor{CommentColor}{#1}} +\newcommand{\RktPn}[1]{\inColor{ParenColor}{#1}} +\newcommand{\RktInBG}[1]{\inColor{ParenColor}{#1}} +\newcommand{\RktSym}[1]{\inColor{IdentifierColor}{#1}} +\newcommand{\RktVal}[1]{\inColor{ValueColor}{#1}} +\newcommand{\RktValLink}[1]{\inColor{blue}{#1}} +\newcommand{\RktModLink}[1]{\inColor{blue}{#1}} +\newcommand{\RktRes}[1]{\inColor{ResultColor}{#1}} +\newcommand{\RktOut}[1]{\inColor{OutputColor}{#1}} +\newcommand{\RktMeta}[1]{\inColor{IdentifierColor}{#1}} +\newcommand{\RktMod}[1]{\inColor{black}{#1}} +\newcommand{\RktRdr}[1]{\inColor{black}{#1}} +\newcommand{\RktVarCol}[1]{\inColor{IdentifierColor}{#1}} +\newcommand{\RktVar}[1]{{\RktVarCol{\textsl{#1}}}} +\newcommand{\RktErrCol}[1]{\inColor{red}{#1}} +\newcommand{\RktErr}[1]{{\RktErrCol{\textrm{\textit{#1}}}}} +\newcommand{\RktOpt}[1]{#1} +\newcommand{\RktIn}[1]{\incolorbox{LightGray}{\RktInBG{#1}}} +\newcommand{\highlighted}[1]{\colorbox{PaleBlue}{\hspace{-0.5ex}\RktInBG{#1}\hspace{-0.5ex}}} + +\newenvironment{RktBlk}{}{} +\newenvironment{defmodule}{}{} +\newenvironment{prototype}{}{} +\newenvironment{argcontract}{}{} +\newenvironment{together}{}{} + +\newenvironment{specgrammar}{}{} + + +\newenvironment{RBibliography}{}{} +\newcommand{\bibentry}[1]{\parbox[t]{0.8\linewidth}{#1}} + +\newenvironment{leftindent}{\begin{quote}}{\end{quote}} +\newenvironment{insetpara}{\begin{quote}}{\end{quote}} + +\newcommand{\Rfiletitle}[1]{\hfill \fbox{#1}} +\newcommand{\Rfilename}[1]{#1} +\newenvironment{Rfilebox}{\begin{list}{}{\topsep=0pt\partopsep=0pt% +\listparindent=0pt\itemindent=0pt\labelwidth=0pt\leftmargin=2ex\rightmargin=2ex% +\itemsep=0pt\parsep=0pt}\item}{\end{list}} +\newenvironment{Rfilecontent}{}{}