======================== Pweave example gallery ======================== Basic document: FIR filter design --------------------------------- This example demonstrates most basic chunk options, output and capturing figures and it is available in several formats. .. csv-table:: Example in different formats. :header: "Format", "Source", "Pweaved", "HTML", "PDF" :widths: 7, 11, 5, 5, 5 md2html, :download:`FIR_designp.pmd ` , ,:download:`open `, texpygments, :download:`FIR_design_pygments.texw ` , :download:`open ` , , :download:`open ` tex, :download:`FIR_design_verb.texw `, :download:`open `, , :download:`open ` texminted, :download:`FIR_design_minted.texw `, :download:`open `, ,:download:`open ` rst, :download:`FIR_design.rstw `, :download:`open `, :download:`open `, script, :download:`FIR_design.py `, , :download:`open `, :download:`open ` pandoc, :download:`FIR_designp.pmd `, :download:`open ` , :download:`open `, The commands used to process the examples from command line are shown below. Markdown ======== HTML output ~~~~~~~~~~~ `md2html` and `pandoc2html` formats produce output that is identical to pypublish command. :download:`FIR_designp.pmd `, :download:`FIR_designp.html ` .. code:: python %%bash pweave -f md2html FIR_designp.pmd To pandoc markdown ~~~~~~~~~~~~~~~~~~ :download:`FIR_designp.pmd `, :download:`FIR_designp.md ` , :download:`FIR_design_pandoc.html ` .. code:: python %%bash pweave -f pandoc FIR_designp.pmd pandoc -s --mathjax FIR_designp.md -o FIR_design_pandoc.html Latex ===== Pweave has several options for LaTeX output, here is a demonstation of differences: Latex with pygments syntax highlighting: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :download:`FIR_design_pygments.texw `, :download:`FIR_design_pygments.tex `, :download:`FIR_design_pygments.pdf ` and with IPython shell :download:`FIR_design_pygments_ipy.pdf `. Notice that the first command creates the needed :download:`pygments.sty `. See `pygments docs `__ for more info. .. code:: python %%bash pygmentize -f tex -S default > pygments.sty pweave -f texpygments FIR_design_pygments.texw pdflatex FIR_design_pygments.tex pweave -s ipython -f texpygments FIR_design_pygments.texw cp FIR_design_pygments.tex FIR_design_pygments_ipy.tex pdflatex FIR_design_pygments_ipy.tex Latex with verbatim output: ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :download:`FIR_design_verb.texw `, :download:`FIR_design_verb.tex `, :download:`FIR_design_verb.pdf `. .. code:: python %%bash pweave -f tex FIR_design_verb.texw pdflatex FIR_design_verb.tex Latex with Minted package for syntax highlighting: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :download:`FIR_design_minted.texw `, :download:`FIR_design_minted.tex ` , :download:`FIR_design_minted.pdf ` . .. code:: python %%bash pweave -f texminted FIR_design_minted.texw pdflatex -shell-escape FIR_design_minted.tex .. note:: Using pygments directly from Pweave is much faster than using Minted separately. reStructuredText ================ :download:`FIR_design.rstw `, :download:`FIR_design.rst ` , :download:`FIR_design_rst.html `. .. code:: python %%bash pweave FIR_design.rstw rst2html.py FIR_design.rst FIR_design_rst.html Published from script ===================== You can publish documents directly using the `pypublish` command. Using doxygen mark up: :download:`FIR_design.py `, :download:`FIR_design.html ` , :download:`FIR_design.pdf ` . Using cell mark up: :download:`FIR_design_cells.py `, :download:`FIR_design_cells.html ` , :download:`FIR_design_cells.pdf ` . .. code:: python %%bash pypublish FIR_design.py pypublish FIR_design_cells.py pypublish -f pdf FIR_design.py pypublish -f pdf FIR_design_cells.py .. _multi-chunk-example: Splitting code to multiple chunks --------------------------------- This example shows how to split code between multiple chunks to write documentation within a class using `complete` chunk option. :download:`AR_yw.mdw ` , :download:`AR_yw.html ` , :download:`AR_yw.pdf ` . .. code:: python %%bash pweave -f md2html AR_yw.mdw pweave -f pandoc2latex AR_yw.mdw pdflatex AR_yw.tex Miscellaneous ------------- Linear regression with Statsmodels: :download:`linear_regression.py `, :download:`linear_regression.html ` .. code:: python %%bash pypublish linear_regression.py About the gallery ----------------- This page is an executable document that be run using Pweave using IPython shell to run all examples using:: pweave index.rstw The latest version of the examples with any required extra files are available from the `Git `__ repository in examples directory. This gallery was created using: .. code:: python import pweave pweave.__version__ .. code:: '0.30' .. code:: python import sys print(sys.version) .. code:: 3.6.2 |Anaconda custom (64-bit)| (default, Jul 20 2017, 13:51:32) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]