summaryrefslogtreecommitdiffstats
path: root/Documentation/conf.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-21 14:23:03 -0400
committerJonathan Corbet <corbet@lwn.net>2016-08-22 17:34:48 -0400
commit41cff161fe99d1c6a773becc2250a1dc3ac035ff (patch)
tree8b57fbc88d1dac23c1c621ed50e03699af7e4175 /Documentation/conf.py
parentaa4e37a3d13679dccf7945dd864375b698cf0df9 (diff)
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: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r--Documentation/conf.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index aaa3f70aafcb..2a02a817b1a0 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -277,11 +277,12 @@ latex_elements = {
277 % Allow generate some pages in landscape 277 % Allow generate some pages in landscape
278 \\usepackage{lscape} 278 \\usepackage{lscape}
279 279
280 % Put notes in gray color and let them be inside a table 280 % Put notes in color and let them be inside a table
281 281 \\definecolor{NoteColor}{RGB}{204,255,255}
282 \\definecolor{MyGray}{rgb}{0.80,0.80,0.80} 282 \\definecolor{WarningColor}{RGB}{255,204,204}
283 283 \\definecolor{AttentionColor}{RGB}{255,255,204}
284 \\makeatletter\\newenvironment{graybox}{% 284 \\definecolor{OtherColor}{RGB}{204,204,204}
285 \\makeatletter\\newenvironment{coloredbox}[1]{%
285 \\newlength{\\py@noticelength} 286 \\newlength{\\py@noticelength}
286 \\setlength{\\fboxrule}{1pt} 287 \\setlength{\\fboxrule}{1pt}
287 \\setlength{\\fboxsep}{7pt} 288 \\setlength{\\fboxsep}{7pt}
@@ -289,20 +290,33 @@ latex_elements = {
289 \\addtolength{\\py@noticelength}{-2\\fboxsep} 290 \\addtolength{\\py@noticelength}{-2\\fboxsep}
290 \\addtolength{\\py@noticelength}{-2\\fboxrule} 291 \\addtolength{\\py@noticelength}{-2\\fboxrule}
291 \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\py@noticelength}}{\\end{minipage}\\end{lrbox}% 292 \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\py@noticelength}}{\\end{minipage}\\end{lrbox}%
292 \\colorbox{MyGray}{\\usebox{\\@tempboxa}} 293 \\ifthenelse%
294 {\\equal{\\py@noticetype}{note}}%
295 {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
296 {%
297 \\ifthenelse%
298 {\\equal{\\py@noticetype}{warning}}%
299 {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
300 {%
301 \\ifthenelse%
302 {\\equal{\\py@noticetype}{attention}}%
303 {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
304 {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
305 }%
306 }%
293 }\\makeatother 307 }\\makeatother
294 308
295 \\makeatletter 309 \\makeatletter
296 \\renewenvironment{notice}[2]{ 310 \\renewenvironment{notice}[2]{%
297 \\begin{graybox}
298 \\bf\\it
299 \\def\\py@noticetype{#1} 311 \\def\\py@noticetype{#1}
312 \\begin{coloredbox}{#1}
313 \\bf\\it
300 \\par\\strong{#2} 314 \\par\\strong{#2}
301 \\csname py@noticestart@#1\\endcsname 315 \\csname py@noticestart@#1\\endcsname
302 } 316 }
303 { 317 {
304 \\csname py@noticeend@\\py@noticetype\\endcsname 318 \\csname py@noticeend@\\py@noticetype\\endcsname
305 \\end{graybox} 319 \\end{coloredbox}
306 } 320 }
307 \\makeatother 321 \\makeatother
308 322