Commit 41cff161 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet

docs-rst: Use better colors for note/warning/attention boxes

Instead of painting the box with gray, let's use a colored
box. IMHO, that makes easier to warn users about some issue
pointed by the Sphinx. It also matches to what we do already
with the HTML output.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent aa4e37a3
...@@ -277,11 +277,12 @@ latex_elements = { ...@@ -277,11 +277,12 @@ latex_elements = {
% Allow generate some pages in landscape % Allow generate some pages in landscape
\\usepackage{lscape} \\usepackage{lscape}
% Put notes in gray color and let them be inside a table % Put notes in color and let them be inside a table
\\definecolor{NoteColor}{RGB}{204,255,255}
\\definecolor{MyGray}{rgb}{0.80,0.80,0.80} \\definecolor{WarningColor}{RGB}{255,204,204}
\\definecolor{AttentionColor}{RGB}{255,255,204}
\\makeatletter\\newenvironment{graybox}{% \\definecolor{OtherColor}{RGB}{204,204,204}
\\makeatletter\\newenvironment{coloredbox}[1]{%
\\newlength{\\py@noticelength} \\newlength{\\py@noticelength}
\\setlength{\\fboxrule}{1pt} \\setlength{\\fboxrule}{1pt}
\\setlength{\\fboxsep}{7pt} \\setlength{\\fboxsep}{7pt}
...@@ -289,20 +290,33 @@ latex_elements = { ...@@ -289,20 +290,33 @@ latex_elements = {
\\addtolength{\\py@noticelength}{-2\\fboxsep} \\addtolength{\\py@noticelength}{-2\\fboxsep}
\\addtolength{\\py@noticelength}{-2\\fboxrule} \\addtolength{\\py@noticelength}{-2\\fboxrule}
\\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\py@noticelength}}{\\end{minipage}\\end{lrbox}% \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\py@noticelength}}{\\end{minipage}\\end{lrbox}%
\\colorbox{MyGray}{\\usebox{\\@tempboxa}} \\ifthenelse%
{\\equal{\\py@noticetype}{note}}%
{\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
{%
\\ifthenelse%
{\\equal{\\py@noticetype}{warning}}%
{\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
{%
\\ifthenelse%
{\\equal{\\py@noticetype}{attention}}%
{\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
{\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
}%
}%
}\\makeatother }\\makeatother
\\makeatletter \\makeatletter
\\renewenvironment{notice}[2]{ \\renewenvironment{notice}[2]{%
\\begin{graybox}
\\bf\\it
\\def\\py@noticetype{#1} \\def\\py@noticetype{#1}
\\begin{coloredbox}{#1}
\\bf\\it
\\par\\strong{#2} \\par\\strong{#2}
\\csname py@noticestart@#1\\endcsname \\csname py@noticestart@#1\\endcsname
} }
{ {
\\csname py@noticeend@\\py@noticetype\\endcsname \\csname py@noticeend@\\py@noticetype\\endcsname
\\end{graybox} \\end{coloredbox}
} }
\\makeatother \\makeatother
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment