Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual: fewer hevea-generated css classes #10605

Merged
merged 8 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 11 additions & 12 deletions manual/src/html_processing/scss/manual.scss
Expand Up @@ -307,24 +307,23 @@ div.caml-example.toplevel div.caml-input::before{
span.number{
padding-right: 1ex;
}
span.c004, span.syntax-token, span.c007 {
span.machine, span.syntax-token {
font-family: $font-mono;
}
span.syntax-token {
color: rgba(91, 33, 6, 0.87);
}
span.c002{
span.ocamlprompt{
color:#888
}
span.c006{
span.font-bold.machine{
font-weight:700;
color:#564233;
font-family: $font-mono;
}
.c008 {
.osvariant {
font-family: $font-sans;
}
span.c010 {
span.font-it {
font-style: italic;
}
span.authors{
Expand All @@ -334,20 +333,20 @@ span.authors{
span.nonterminal {
font-style: italic;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked a bit more into the italic/oblique distinction. If we intend to be consistent with the PDF manual, this would be better expressed with oblique. But it doesn't matter with the current font, because it doesn't distinguish them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the difference between oblique and italic is faint on the web. I have not realized that the html and tex version had diverged. This is fixed now, more for the sake of consistency than anything else. Thanks!

}
.c012 {
font-style: italic;
.font-sl {
font-style: oblique;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PDF version, "c012" actually had italic font, not slanted. But again, this doesn't matter with the current web font.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more a mismatch on the diff, I generalized the span.font-it rule to .font-it.

}
span.c013{
font-style: italic;
span.sl{
Octachron marked this conversation as resolved.
Show resolved Hide resolved
font-style: oblique;
}
.center table {
margin-left: inherit;
margin-right: inherit;
}
td .c014 {
td .font-bold {
font-weight: bold;
}
.c016 {
.syntax-token {
Octachron marked this conversation as resolved.
Show resolved Hide resolved
text-align: center;
}
.cellpadding1 tr td {
Expand Down
23 changes: 19 additions & 4 deletions manual/src/macros.hva
Expand Up @@ -160,7 +160,8 @@
%%% Code examples
\newcommand{\input@color}{\htmlcolor{006000}}
\newcommand{\output@color}{\maroon}
\newcommand{\machine}{\tt}
\newcommand{\machine}{\@span{class=machine}}
\newstyle{.machine}{font-family:monospace}
\newenvironment{machineenv}{\begin{alltt}}{\end{alltt}}
\newcommand{\var}[1]{\textit{#1}}

Expand All @@ -180,6 +181,8 @@
\newcommand{\ocamlcomment}{\@span{class="ocamlcomment"}}
\newcommand{\ocamlstring}{\@span{class="ocamlstring"}}

\newcommand{\?}{\@span{class=ocamlprompt}\#}
\newstyle{.ocamlprompt}{color:black;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous definition of \? also used \normalsize, is anything lost here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As seen in my table above, this was translated in css to

color:black;

thus nothing has been lost as far as I can see.


%%% End of code example

Expand All @@ -191,8 +194,9 @@


%%venant de macros.tex

\def\versionspecific#1{\begin{quote}\textsf{#1:}\quad}
\newcommand{\osvariant}{\@span{class=osvariant}}
\newstyle{.osvariant}{font-family:sans-serif}
\def\versionspecific#1{\begin{quote}{\osvariant{}#1:}\quad}
\def\unix{\versionspecific{Unix}}
\def\endunix{\end{quote}}
\def\windows{\versionspecific{Windows}}
Expand Down Expand Up @@ -252,7 +256,8 @@
\def\ikwd#1{\indexentry{\jobname.kwd}{#1}}
% nth

\def\th{^{\mbox{\scriptsize th}}}
\def\th{^{\mbox{\@span{class=th}th}}}
\newstyle{.th}{font-size:small;}
\renewcommand{\hbox}[1]{\mbox{#1}}

% Notations pour les metavariables
Expand Down Expand Up @@ -302,3 +307,13 @@
\else
\newcommand{\stddocitem}[2]{\docitem{libref/Stdlib}{#1}{#2}}
\fi

\renewcommand{\tt}{\@span{class=font-tt}}
\newstyle{.font-tt}{font-family:monospace;}
\renewcommand{\it}{\@span{class=font-it}}
\newstyle{.font-it}{font-style:italic;}
\renewcommand{\bf}{\@span{class=font-bold}}
\newstyle{.font-bold}{font-weight:bold;}
\renewcommand{\sl}{\ifmath\ifmathml\@span{class='sl-math'}%
\else\@span{class="font-sl"}\fi\else\@span{class="font-sl"}\fi}
\newstyle{.font-sl}{font-style:oblique;}
1 change: 1 addition & 0 deletions manual/src/macros.tex
Expand Up @@ -247,6 +247,7 @@
\newcommand{\ocamlhighlight}{\bfseries\uline}
\newcommand{\ocamlerror}{\bfseries}
\newcommand{\ocamlwarning}{\bfseries}
\newcommand{\?}{\color{black}\normalsize\tt\#{}}

\definecolor{gray}{gray}{0.5}
\newcommand{\ocamlcomment}{\color{gray}\normalfont\small}
Expand Down
2 changes: 0 additions & 2 deletions manual/src/manual.tex
Expand Up @@ -127,7 +127,6 @@
\fi
}{}

\newcommand{\?}{\color{black}\normalsize\tt\#{}}

\ifocamldoc\else
\lstnewenvironment{ocamlcodeblock}{
Expand Down Expand Up @@ -187,7 +186,6 @@
\usepackage[strings,nohyphen]{underscore}

%\makeatletter \def\@wrindex#1#2{\xdef \@indexfile{\csname #1@idxfile\endcsname}\@@wrindex#2||\\}\makeatother
\def\th{^{\hbox{\scriptsize th}}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this uses hbox but the macros.hva version (old and new) use mbox. Does it make a difference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably be using the latex macro hbox rather the tex one (mbox) but this doesn't really make a difference in html mode. Using hbox or mbox yields the same generated html.



\raggedbottom
Expand Down