From b8f3b01eaa33615765451ec1f7a0a562efa55afe Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 4 Jul 2012 18:19:22 +0200 Subject: [PATCH 1/4] Add texinfo build target in doc/make.py --- doc/conf.py | 7 +++++++ doc/make.py | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 4e5e3557ce5f..11daa41e94b2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -186,3 +186,10 @@ rst_epilog = """ .. |minimum_numpy_version| replace:: %s """ % matplotlib.__version__numpy__ + +texinfo_documents = [ + ("contents", 'matplotlib', 'Matplotlib Documentation', + 'Darren Dale@*Michael Droettboom@*Eric Firing@*John Hunter', + 'Matplotlib', "Python plotting package", 'Programming', + 1), +] diff --git a/doc/make.py b/doc/make.py index 748a34fc39d3..3ee0800f5bbd 100755 --- a/doc/make.py +++ b/doc/make.py @@ -173,6 +173,26 @@ def latex(): else: print('latex build has not been tested on windows') +def texinfo(): + check_build() + #figs() + if sys.platform != 'win32': + # Texinfo format. + if os.system( + 'sphinx-build -b texinfo -d build/doctrees . build/texinfo'): + raise SystemExit("Building Texinfo failed.") + + # Produce pdf. + os.chdir('build/texinfo') + + # Call the makefile produced by sphinx... + if os.system('make'): + raise SystemExit("Rendering Texinfo failed.") + + os.chdir('../..') + else: + print('texinfo build has not been tested on windows') + def clean(): shutil.rmtree("build", ignore_errors=True) shutil.rmtree("examples", ignore_errors=True) @@ -198,6 +218,7 @@ def all(): 'figs' : figs, 'html' : html, 'latex' : latex, + 'texinfo' : texinfo, 'clean' : clean, 'sf' : sf, 'sfpdf' : sfpdf, From 126d980ff87b3e3bd7f2ff1dbcbec3f546394f2a Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 5 Jul 2012 17:16:00 +0200 Subject: [PATCH 2/4] Make directory build/texinfo in check_build() --- doc/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/make.py b/doc/make.py index 3ee0800f5bbd..0595a57f8b32 100755 --- a/doc/make.py +++ b/doc/make.py @@ -114,7 +114,7 @@ def copy_if_out_of_date(original, derived): def check_build(): build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex', - '_static', '_templates'] + 'build/texinfo', '_static', '_templates'] for d in build_dirs: try: os.mkdir(d) From 6449920c2bef179b1b92b818348ab48f0169e55b Mon Sep 17 00:00:00 2001 From: Jonathan Waltman Date: Wed, 8 Aug 2012 17:11:14 -0500 Subject: [PATCH 3/4] Add texinfo support to plot_directive.py --- lib/matplotlib/sphinxext/plot_directive.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 94ae17265822..490eafbcc3f4 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -394,6 +394,16 @@ def split_code_at_show(text): .. image:: {{ build_dir }}/{{ img.basename }}.pdf {% endfor %} +{{ only_texinfo }} + + {% for img in images %} + .. image:: {{ build_dir }}/{{ img.basename }}.png + {%- for option in options %} + {{ option }} + {% endfor %} + + {% endfor %} + """ exception_template = """ @@ -726,6 +736,7 @@ def run(arguments, content, options, state_machine, state, lineno): only_html = ".. only:: html" only_latex = ".. only:: latex" + only_texinfo = ".. only:: texinfo" if j == 0: src_link = source_link @@ -740,6 +751,7 @@ def run(arguments, content, options, state_machine, state, lineno): multi_image=len(images) > 1, only_html=only_html, only_latex=only_latex, + only_texinfo=only_texinfo, options=opts, images=images, source_code=source_code, From 9951938d531158538ae721dae93f0cc637cd0522 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 9 Aug 2012 02:38:04 +0200 Subject: [PATCH 4/4] Fix comment in texinfo document build target --- doc/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/make.py b/doc/make.py index 0595a57f8b32..f287f3d082f3 100755 --- a/doc/make.py +++ b/doc/make.py @@ -182,7 +182,7 @@ def texinfo(): 'sphinx-build -b texinfo -d build/doctrees . build/texinfo'): raise SystemExit("Building Texinfo failed.") - # Produce pdf. + # Produce info file. os.chdir('build/texinfo') # Call the makefile produced by sphinx...