{
"info": {
"author": "hertogp",
"author_email": "git.hertogp@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Topic :: Text Processing :: Filters"
],
"description": "::\n\n \\\\\\///\n / _ _ \\\n (| (.)(.) |)\n .--------------------.OOOo--()--oOOO.-------------------.\n | |\n | ____ _ |\n | / _/____ ___ ____ _ ____ _ (_)____ ___ |\n | / / / __ `__ \\ / __ `// __ `// // __ \\ / _ \\ |\n | _/ / / / / / / // /_/ // /_/ // // / / // __/ |\n | /___//_/ /_/ /_/ \\__,_/ \\__, //_//_/ /_/ \\___/ |\n | /____/ |\n | |\n '-------------------.oooO-------------------------------'\n ( ) Oooo.\n \\ ( ( )\n \\_) ) /\n (_/\n\nA pandoc filter to process codeblocks into images and/or ascii art\n------------------------------------------------------------------\n\nImagine is a pandoc filter that will turn codeblocks tagged with certain\nclasses into images or ascii art. The following are currently supported:\n\n::\n\n actdiag, asy, asymptote, blockdiag, boxes, circo, ctioga2, ditaa, dot, fdp,\n figlet, flydraw, gle, gnuplot, graph, graphviz, gri, imagine, mermaid, mscgen,\n neato, nwdiag, octave, packetdiag, pic, pic2plot, plantuml, plot, ploticus,\n protocol, pyxplot, rackdiag, seqdiag, sfdp, shebang, twopi\n\nExamples\n--------\n\n`Mscgen `__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n ```{.mscgen im_out=\"fcb,img\"}\n msc {\n hscale=\"1.3\", arcgradient = \"8\";\n\n a [label=\"Client\"],b [label=\"Server\"];\n\n a=>b [label=\"data1\"];\n a-xb [label=\"data2\"];\n a=>b [label=\"data3\"];\n a<=b [label=\"ack1, nack2\"];\n a=>b [label=\"data2\", arcskip=\"1\"];\n |||;\n a<=b [label=\"ack3\"];\n |||;\n }\n ```\n\n|image0|\n\n`Octave `__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n ```{.octave im_out=\"fcb,img\"}\n figure(1, 'visible', 'off');\n surf(peaks);\n title(\"peaks\");\n print(1, argv(){1});\n ```\n\n|image1|\n\n`Shebang `__ using Python & Pygal\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n ```{.shebang im_out=\"fcb,img\"}\n #!/usr/bin/env python3\n import sys\n import pygal\n from math import cos\n xy_chart = pygal.XY()\n xy_chart.title = 'XY Cosinus'\n xy_chart.add('x = cos(y)', [(cos(x / 10.), x / 10.) for x in range(-50, 50, 5)])\n xy_chart.add('y = cos(x)', [(x / 10., cos(x / 10.)) for x in range(-50, 50, 5)])\n xy_chart.render_to_png(sys.argv[-1])\n ```\n\n|image2|\n\n`boxes `__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n ```{.shebang im_out=\"fcb,stdout\"}\n #!/bin/bash\n # I seem to have got myself boxed in!\n cat $0 | boxes -d peek -p h4\n ```\n\n::\n\n /* _\\|/_\n (o o)\n +----oOO-{_}-OOo------------------------------+\n | #!/bin/bash |\n | # I seem to have got myself boxed in! |\n | cat $0 | boxes -d peek -p h4 |\n +--------------------------------------------*/\n\nMore examples in the sample.pdf on\n`github `__.\n\nDocumentation\n-------------\n\n::\n\n Imagine\n A pandoc filter to turn fenced codeblocks into graphics or ascii art by\n wrapping some external command line utilities, such as:\n\n actdiag, asy, asymptote, blockdiag, boxes, circo, ctioga2, ditaa, dot,\n fdp, figlet, flydraw, gle, gnuplot, graph, graphviz, gri, imagine,\n mermaid, mscgen, neato, nwdiag, octave, packetdiag, pic, pic2plot,\n plantuml, plot, ploticus, protocol, pyxplot, rackdiag, seqdiag, sfdp,\n shebang, twopi\n\n\n Installation\n\n % sudo -H pip install pandoc-imagine\n\n or simply save `pandoc-imagine.py` anywhere along $PATH\n\n\n Dependencies\n\n % sudo -H pip install pandocfilters\n\n and one (or more) of the packages that provide above utilities.\n\n\n Pandoc usage\n\n % pandoc --filter pandoc-imagine.py document.md -o document.pdf\n\n\n Markdown usage\n\n ```cmd\n code\n ```\n\n which will run `cmd` (if known) to proces the `code` into a png image and\n replaces the fenced code block with an Image in a paragraph of its own or any\n ascii art in its own CodeBlock.\n\n Alternate, longer form:\n\n ```{.cmd im_opt=\"..\" im_out=\"..\" im_prg=}\n code\n ```\n\n - im_opt=\"...\" will be passed onto the command line.\n Some classes already provide some defaults (as required by the command).\n\n - im_out=\"...\", csv-list of keywords each specifying a certain output\n - img image in a paragraph\n - fcb codeblock (class fcb) containing the original codeblock\n - stdout, codeblock (class stdout) containing stdout output (if any)\n - stderr, codeblock (class stderr) containing stderr output (if any)\n\n - im_prg=, overrides class-to-command map.\n Only useful if `cmd` itself is not an appropiate class in your document.\n\n If the command fails, the original fenced code block is retained unchanged.\n Any info on stderr is relayed by Imagine, which might be useful for\n troubleshooting.\n\n If the command succeeds but produces no image, a line reporting the missing\n image is included in the output document.\n\n Notes:\n - filenames are based on a hash of the codeblock + its attributes\n - uses subdir `pd-images` to store any input/output files\n - there's no clean up of files stored there\n - if an output filename exists, it is not regenerated but simply linked to.\n - `packetdiag` & `sfdp`s underlying libraries seem to have some problems.\n\n Some commands follow a slightly different pattern:\n - 'img' directive is ignored by commands that only produce ascii\n - ctioga2 defaults to pdf instead of png\n - flydraw produces a gif, not png\n - gle also creates a .gle subdir inside the images-dir\n - gri produces a ps, which is `convert`ed to png\n - imagine reads its code as help-topics, returns codeblocks with help-info\n - plot reads its codeblock as the relative path to the file to process\n - pyxplot will have `set terminal` & `set output` prepended to its `code`\n - shebang runs its codeblock as a script with .png as its argument.\n - use {.shebang im_out=\"stdout\"} for text instead of an png\n\n\n Security\n\n Imagine just hands the fenced codeblocks to plotting tools to process or\n simply runs them as system scripts, as-is.\n\n Shebang's are inherently unsafe and most of the plotting tools implement\n their own 'little' languages, which can create beautiful images, but can also\n cause harm.\n\n There is no way to check for 'side effects' in advance, so make sure to check\n the fenced codeblocks before running them through the filter.\n\n\n Imagine class\n\n The imagine class puts documentation of topics at your fingertips, like so:\n\n ```imagine\n class\n ```\n\n Use `imagine` as class to get the module's docstring (ie this text) and/or\n one or more of the commands you're interested in, each on a separate line.\n\nIndividual Classes\n------------------\n\n::\n\n Asy\n\n sudo-apt-get install asymptote\n http://asymptote.sourceforge.net/\n \n Runs asy -o .png [options] .asy\n Wraps:\n - 'asymptote' -> asy\n - 'asy' -> asy\n\n BlockDiag\n\n sudo pip install blockdiag nwdiag actdiag seqdiag\n http://blockdiag.com/\n \n Runs cmd -T png .txt -o .png\n Wraps:\n - 'actdiag' -> actdiag\n - 'blockdiag' -> blockdiag\n - 'rackdiag' -> rackdiag\n - 'seqdiag' -> seqdiag\n - 'packetdiag' -> packetdiag\n - 'nwdiag' -> nwdiag\n\n Boxes\n\n sudo apt-get install boxes\n http://boxes.thomasjensen.com\n \n Runs boxes [options] .boxes\n Wraps:\n - 'boxes' -> boxes\n\n Ctioga2\n\n sudo apt-get install ctioga2\n http://ctioga2.sourceforge.net\n \n Runs ctioga2 [options] -f .ctioga2\n Wraps:\n - 'ctioga2' -> ctioga2\n\n Ditaa\n\n sudo apt-get install ditaa\n http://ditaa.sourceforge.net\n \n Runs ditaa .ditaa .png -T [options]\n Wraps:\n - 'ditaa' -> ditaa\n\n Figlet\n\n sudo apt-get install figlet\n http://www.figlet.org\n \n Runs figlet [options] < code-text\n Wraps:\n - 'figlet' -> figlet\n\n Flydraw\n\n sudo apt-get install flydraw\n http://manpages.ubuntu.com/manpages/precise/man1/flydraw.1.html\n notes:\n - graphic data is printed to stdout\n - so 'stdout' in im_out option is silently ignored\n \n Runs flydraw [options] < code-text\n Wraps:\n - 'flydraw' -> flydraw\n\n Gle\n\n sudo apt-get install gle-graphics\n http://glx.sourceforge.net\n \n Runs gle -verbosity 0 -output . .gle\n Wraps:\n - 'gle' -> gle\n\n GnuPlot\n\n sudo apt-get install gnuplot\n http://www.gnuplot.info\n notes:\n - graphic data is printed to stdout\n - so 'stdout' in im_out option is silently ignored\n \n Runs gnuplot [options] .gnuplot > .png\n Wraps:\n - 'gnuplot' -> gnuplot\n\n Graph\n\n sudo apt-get install plotutils\n https://www.gnu.org/software/plotutils\n notes:\n - graphic data is printed to stdout\n - so 'stdout' in im_out option is silently ignored\n \n Runs graph -T png [options] .graph\n Wraps:\n - 'graph' -> graph\n\n Graphviz\n\n sudo apt-get install graphviz\n http://graphviz.org\n \n Runs cmd [options] -T .dot .\n Wraps:\n - 'twopi' -> twopi\n - 'graphviz' -> dot\n - 'fdp' -> fdp\n - 'circo' -> circo\n - 'neato' -> neato\n - 'dot' -> dot\n - 'sfdp' -> sfdp\n\n Gri\n\n sudo apt-get install gri imagemagick\n http://gri.sourceforge.net\n - requires `convert` from imagemagick\n \n Runs gri -c 0 -b .gri\n Wraps:\n - 'gri' -> gri\n\n Imagine\n\n pip install pandoc-imagine\n https://github.com/hertogp/imagine\n \n Runs return documentation in a CodeBlock\n Wraps:\n - 'imagine' -> imagine\n\n Mermaid\n\n sudo nmp install mermaid\n https://knsv.github.io/mermaid (needs phantomjs)\n \n Runs mermaid -o [options] .mermaid\n Wraps:\n - 'mermaid' -> mermaid\n\n MscGen\n\n sudo apt-get install mscgen\n http://www.mcternan.me.uk/mscgen\n \n Runs mscgen -T png -o .png .mscgen\n Wraps:\n - 'mscgen' -> mscgen\n\n Octave\n\n sudo apt-get install octave\n https://www.gnu.org/software/octave\n \n Runs octage --no-gui -q [options] .octave .png\n Wraps:\n - 'octave' -> octave\n\n Pic2Plot\n\n sudo apt-get install plotutils\n https://www.gnu.org/software/plotutils\n notes:\n - graphic data is printed to stdout\n - so 'stdout' in im_out option is silently ignored\n \n Runs pic2plot -T png [options] .pic2plot\n Wraps:\n - 'pic2plot' -> pic2plot\n - 'pic' -> pic2plot\n\n PlantUml\n\n sudo apt-get install plantuml\n http://plantuml.com\n \n Runs plantuml -t png .plantuml\n Wraps:\n - 'plantuml' -> plantuml\n\n Plot\n\n sudo apt-get install plotutils\n https://www.gnu.org/software/plotutils\n notes:\n - graphic data is printed to stdout\n - so 'stdout' in im_out option is silently ignored\n \n Runs plot -T png [options] \n Wraps:\n - 'plot' -> plot\n\n Ploticus\n\n sudo apt-get install ploticus\n http://ploticus.sourceforge.net/doc/welcome.html\n \n Runs ploticus -png -o .png [options] .ploticus\n Wraps:\n - 'ploticus' -> ploticus\n\n Protocol\n\n git clone https://github.com/luismartingarcia/protocol.git .\n python setup install\n https://github.com/luismartingarcia/protocol.git\n \n Runs protocol [options] code-text\n Wraps:\n - 'protocol' -> protocol\n\n PyxPlot\n\n sudo apt-get install pyxplot\n http://pyxplot.org.uk\n \n Runs pyxplot [options] .pyxplot\n Wraps:\n - 'pyxplot' -> pyxplot\n\n SheBang\n\n http://www.google.com/search?q=shebang+line\n \n Runs .shebang [options] .png\n Wraps:\n - 'shebang' -> shebang\n\n.. |image0| image:: https://raw.githubusercontent.com/hertogp/imagine/master/pd-images/d62d0d7d8810c53dfe749df1427748295b8c4be5.png\n.. |image1| image:: https://raw.githubusercontent.com/hertogp/imagine/master/pd-images/33684de9782c072667d6f8903fd7db2e69af0aa3.png\n.. |image2| image:: https://raw.githubusercontent.com/hertogp/imagine/master/pd-images/3657c812d9b3b906fbefcda7ef2bee167ada055e.png",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/hertogp/imagine",
"keywords": "pandoc,filter,codeblock,image,ascii-art",
"license": "UNKNOWN",
"maintainer": null,
"maintainer_email": null,
"name": "pandoc-imagine",
"package_url": "https://pypi.org/project/pandoc-imagine/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/pandoc-imagine/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/hertogp/imagine"
},
"release_url": "https://pypi.org/project/pandoc-imagine/0.1.5/",
"requires_dist": null,
"requires_python": null,
"summary": "A filter to process codeblocks into images or ascii art",
"version": "0.1.5"
},
"last_serial": 2874107,
"releases": {
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "2d7c23cea36e817de5ec3a2c743df042",
"sha256": "60dba7318baecdb9ff73d9a6b1eeaa9a9ddc80d9a8bfc3695a221e6c2ed1fa4e"
},
"downloads": -1,
"filename": "pandoc-imagine-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "2d7c23cea36e817de5ec3a2c743df042",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16523,
"upload_time": "2017-05-02T19:48:37",
"url": "https://files.pythonhosted.org/packages/29/17/3a71cb915fce524d9157215cc56f2980c69901cadb01b23ad6ae9fe9cd31/pandoc-imagine-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "a39d7cbaf1a9d3e29163ead30bf763f7",
"sha256": "f93e541686500a67d5499fe9900a4941c7d0176abfe0af1f754f68fb7905a014"
},
"downloads": -1,
"filename": "pandoc-imagine-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "a39d7cbaf1a9d3e29163ead30bf763f7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16530,
"upload_time": "2017-05-02T20:15:23",
"url": "https://files.pythonhosted.org/packages/14/ea/db819d9687a78d4f53fb5bc23f21a454d7758ad2b8efc1b6d561a857aed3/pandoc-imagine-0.1.2.tar.gz"
}
],
"0.1.4": [
{
"comment_text": "",
"digests": {
"md5": "c7325c81839f004c212ad29b7b9ba452",
"sha256": "abb813438cb2d9ea6f4ce9f3feff2384adfd5ad00600f362cd61874a7353c891"
},
"downloads": -1,
"filename": "pandoc-imagine-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "c7325c81839f004c212ad29b7b9ba452",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17266,
"upload_time": "2017-05-05T20:57:59",
"url": "https://files.pythonhosted.org/packages/8e/bd/4f1808f04e0745b66a54e87f82a48c46778803e82366fa95f89f3d3a80ca/pandoc-imagine-0.1.4.tar.gz"
}
],
"0.1.5": [
{
"comment_text": "",
"digests": {
"md5": "0f745b6af79c2961cd165f73b0911d1e",
"sha256": "0e99fea5e2ee7ff756e482ba6bf04b37ff4366e4f4ed8d8d1b54c8a75cd5870d"
},
"downloads": -1,
"filename": "pandoc-imagine-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "0f745b6af79c2961cd165f73b0911d1e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17219,
"upload_time": "2017-05-14T22:09:29",
"url": "https://files.pythonhosted.org/packages/f5/f7/5df8af03bd1b533edd62915b0b6b81c74a247e5c5feb25a110ff8e3fc1d6/pandoc-imagine-0.1.5.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "0f745b6af79c2961cd165f73b0911d1e",
"sha256": "0e99fea5e2ee7ff756e482ba6bf04b37ff4366e4f4ed8d8d1b54c8a75cd5870d"
},
"downloads": -1,
"filename": "pandoc-imagine-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "0f745b6af79c2961cd165f73b0911d1e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17219,
"upload_time": "2017-05-14T22:09:29",
"url": "https://files.pythonhosted.org/packages/f5/f7/5df8af03bd1b533edd62915b0b6b81c74a247e5c5feb25a110ff8e3fc1d6/pandoc-imagine-0.1.5.tar.gz"
}
]
}