From dc0ba7e761e413890e580f2a425f1b3d3894d38f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 3 Jan 2010 11:28:40 +0000 Subject: Info and warning icons instead of words. --- docs/.static/exclaim.png | Bin 0 -> 3542 bytes docs/.static/info.png | Bin 0 -> 3844 bytes docs/Makefile | 3 +++ docs/conf.py | 20 ++++++++++++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 docs/.static/exclaim.png create mode 100644 docs/.static/info.png (limited to 'docs') diff --git a/docs/.static/exclaim.png b/docs/.static/exclaim.png new file mode 100644 index 000000000..6707bc362 Binary files /dev/null and b/docs/.static/exclaim.png differ diff --git a/docs/.static/info.png b/docs/.static/info.png new file mode 100644 index 000000000..95d00a973 Binary files /dev/null and b/docs/.static/info.png differ diff --git a/docs/Makefile b/docs/Makefile index 674c605d8..1980953ab 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -57,7 +57,10 @@ htmlhelp: latex: mkdir -p .build/latex .build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) .build/latex + cp .static/*.png .build/latex ./convert_images.sh + cp .static/exclaim.png .build/latex + cp .static/info.png .build/latex @echo @echo "Build finished; the LaTeX files are in .build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ diff --git a/docs/conf.py b/docs/conf.py index 58b985869..03b38ca8f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -269,12 +269,28 @@ _PREAMBLE = r""" \endSbox \fbox{\TheSbox} } -\renewcommand{\py@noticestart@warning}{\py@veryheavybox} -\renewcommand{\py@noticeend@warning}{\py@endveryheavybox} +\renewcommand{\py@noticestart@warning}{\py@heavybox} +\renewcommand{\py@noticeend@warning}{\py@endheavybox} \renewcommand{\py@noticestart@note}{\py@heavybox} \renewcommand{\py@noticeend@note}{\py@endheavybox} \makeatother +\usepackage{ifthen} +% Keep a copy of the original notice environment +\let\origbeginnotice\notice +\let\origendnotice\endnotice + +% Redefine the notice environment so we can add our own code to it +\renewenvironment{notice}[2]{% + \origbeginnotice{#1}{}% equivalent to original \begin{notice}{#1}{#2} + % load graphics + \ifthenelse{\equal{#1}{warning}}{\includegraphics{exclaim.png}}{} + \ifthenelse{\equal{#1}{note}}{\includegraphics{info.png}}{} + % etc. +}{% + \origendnotice% equivalent to original \end{notice} +} + \sloppy """ -- cgit v1.2.3