docs-rst: conf.py: only setup notice box colors if Sphinx < 1.6

Sphinx 1.5 added a new way to change backward colors for note
boxes, but kept backward compatibility with 1.4. On Sphinx 1.6,
the old way stopped working, in favor of a new less hackish
way.

Unfortunately, this is currently too buggy to be used, and
the old way doesn't work anymore. So, we have no option but
to stick with boring notice boxes.

One example of such bug is the notice that it is inside
struct v4l2_plane, at the "bytesused" field.

At least, add a notice about how to use, as maybe some day
the bug will vanish.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
9fdcd6af c4b326e1

+43 -19
+43 -19
Documentation/conf.py
··· 271 271 272 272 # Additional stuff for the LaTeX preamble. 273 273 'preamble': ''' 274 + % Use some font with UTF-8 support with XeLaTeX 275 + \\usepackage{fontspec} 276 + \\setsansfont{DejaVu Serif} 277 + \\setromanfont{DejaVu Sans} 278 + \\setmonofont{DejaVu Sans Mono} 279 + 280 + % To allow adjusting table sizes 281 + \\usepackage{adjustbox} 282 + 283 + ''' 284 + } 285 + 286 + # Fix reference escape troubles with Sphinx 1.4.x 287 + if major == 1 and minor > 3: 288 + latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' 289 + 290 + if major == 1 and minor <= 4: 291 + latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}' 292 + elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)): 293 + latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in' 294 + latex_elements['preamble'] += '\\fvset{fontsize=auto}\n' 295 + 296 + # Customize notice background colors on Sphinx < 1.6: 297 + if major == 1 and minor < 6: 298 + latex_elements['preamble'] += ''' 274 299 \\usepackage{ifthen} 275 300 276 301 % Put notes in color and let them be inside a table ··· 347 322 } 348 323 \\makeatother 349 324 350 - % Use some font with UTF-8 support with XeLaTeX 351 - \\usepackage{fontspec} 352 - \\setsansfont{DejaVu Serif} 353 - \\setromanfont{DejaVu Sans} 354 - \\setmonofont{DejaVu Sans Mono} 355 - 356 - % To allow adjusting table sizes 357 - \\usepackage{adjustbox} 358 - 359 325 ''' 360 - } 361 326 362 - # Fix reference escape troubles with Sphinx 1.4.x 363 - if major == 1 and minor > 3: 364 - latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' 365 - 366 - if major == 1 and minor <= 4: 367 - latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}' 368 - elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)): 369 - latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in' 370 - latex_elements['preamble'] += '\\fvset{fontsize=auto}\n' 327 + # With Sphinx 1.6, it is possible to change the Bg color directly 328 + # by using: 329 + # \definecolor{sphinxnoteBgColor}{RGB}{204,255,255} 330 + # \definecolor{sphinxwarningBgColor}{RGB}{255,204,204} 331 + # \definecolor{sphinxattentionBgColor}{RGB}{255,255,204} 332 + # \definecolor{sphinximportantBgColor}{RGB}{192,255,204} 333 + # 334 + # However, it require to use sphinx heavy box with: 335 + # 336 + # \renewenvironment{sphinxlightbox} {% 337 + # \\begin{sphinxheavybox} 338 + # } 339 + # \\end{sphinxheavybox} 340 + # } 341 + # 342 + # Unfortunately, the implementation is buggy: if a note is inside a 343 + # table, it isn't displayed well. So, for now, let's use boring 344 + # black and white notes. 371 345 372 346 # Grouping the document tree into LaTeX files. List of tuples 373 347 # (source start file, target name, title,