|
31 | 31 | # -- General configuration ------------------------------------------------ |
32 | 32 |
|
33 | 33 | # If your documentation needs a minimal Sphinx version, state it here. |
34 | | -needs_sphinx = '1.3' |
| 34 | +needs_sphinx = '1.7' |
35 | 35 |
|
36 | 36 | # Add any Sphinx extension module names here, as strings. They can be |
37 | 37 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
|
112 | 112 |
|
113 | 113 | else: |
114 | 114 | extensions.append('cdomain') |
115 | | - if major == 1 and minor < 7: |
116 | | - sys.stderr.write('WARNING: Sphinx 1.7 or greater will be required as of ' |
117 | | - 'the 5.12 release\n') |
118 | 115 |
|
119 | 116 | # Ensure that autosectionlabel will produce unique names |
120 | 117 | autosectionlabel_prefix_document = True |
121 | 118 | autosectionlabel_maxdepth = 2 |
122 | 119 |
|
123 | | -# The name of the math extension changed on Sphinx 1.4 |
124 | | -if (major == 1 and minor > 3) or (major > 1): |
125 | | - extensions.append("sphinx.ext.imgmath") |
126 | | -else: |
127 | | - extensions.append("sphinx.ext.pngmath") |
| 120 | +extensions.append("sphinx.ext.imgmath") |
128 | 121 |
|
129 | 122 | # Add any paths that contain templates here, relative to this directory. |
130 | 123 | templates_path = ['_templates'] |
|
375 | 368 | ''' |
376 | 369 |
|
377 | 370 | # Fix reference escape troubles with Sphinx 1.4.x |
378 | | -if major == 1 and minor > 3: |
| 371 | +if major == 1: |
379 | 372 | latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' |
380 | 373 |
|
381 | | -if major == 1 and minor <= 4: |
382 | | - latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}' |
383 | | -elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)): |
384 | | - latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in' |
385 | | - latex_elements['preamble'] += '\\fvset{fontsize=auto}\n' |
386 | | - |
387 | | -# Customize notice background colors on Sphinx < 1.6: |
388 | | -if major == 1 and minor < 6: |
389 | | - latex_elements['preamble'] += ''' |
390 | | - \\usepackage{ifthen} |
391 | | -
|
392 | | - % Put notes in color and let them be inside a table |
393 | | - \\definecolor{NoteColor}{RGB}{204,255,255} |
394 | | - \\definecolor{WarningColor}{RGB}{255,204,204} |
395 | | - \\definecolor{AttentionColor}{RGB}{255,255,204} |
396 | | - \\definecolor{ImportantColor}{RGB}{192,255,204} |
397 | | - \\definecolor{OtherColor}{RGB}{204,204,204} |
398 | | - \\newlength{\\mynoticelength} |
399 | | - \\makeatletter\\newenvironment{coloredbox}[1]{% |
400 | | - \\setlength{\\fboxrule}{1pt} |
401 | | - \\setlength{\\fboxsep}{7pt} |
402 | | - \\setlength{\\mynoticelength}{\\linewidth} |
403 | | - \\addtolength{\\mynoticelength}{-2\\fboxsep} |
404 | | - \\addtolength{\\mynoticelength}{-2\\fboxrule} |
405 | | - \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}% |
406 | | - \\ifthenelse% |
407 | | - {\\equal{\\py@noticetype}{note}}% |
408 | | - {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}% |
409 | | - {% |
410 | | - \\ifthenelse% |
411 | | - {\\equal{\\py@noticetype}{warning}}% |
412 | | - {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}% |
413 | | - {% |
414 | | - \\ifthenelse% |
415 | | - {\\equal{\\py@noticetype}{attention}}% |
416 | | - {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}% |
417 | | - {% |
418 | | - \\ifthenelse% |
419 | | - {\\equal{\\py@noticetype}{important}}% |
420 | | - {\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}% |
421 | | - {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}% |
422 | | - }% |
423 | | - }% |
424 | | - }% |
425 | | - }\\makeatother |
426 | | -
|
427 | | - \\makeatletter |
428 | | - \\renewenvironment{notice}[2]{% |
429 | | - \\def\\py@noticetype{#1} |
430 | | - \\begin{coloredbox}{#1} |
431 | | - \\bf\\it |
432 | | - \\par\\strong{#2} |
433 | | - \\csname py@noticestart@#1\\endcsname |
434 | | - } |
435 | | - { |
436 | | - \\csname py@noticeend@\\py@noticetype\\endcsname |
437 | | - \\end{coloredbox} |
438 | | - } |
439 | | - \\makeatother |
440 | | -
|
441 | | - ''' |
442 | | - |
443 | 374 | # With Sphinx 1.6, it is possible to change the Bg color directly |
444 | 375 | # by using: |
445 | 376 | # \definecolor{sphinxnoteBgColor}{RGB}{204,255,255} |
|
0 commit comments