{ "info": { "author": "Matthias Lesch", "author_email": "ml@matthiaslesch.de", "bugtrack_url": null, "classifiers": [], "description": "PNW\n===\n\nLatest version see `Bitbucket`_.\n\npnw is a text processing tool with a wide range of applications. It can\nbe used to compile chunks of text from various sources into a new text\nfile. The advantage over cut-and-paste techniques is that changes in the\nsource file are automatically followed. Secondly, we provide a thin\nwrapper around the pandoc document converter. Therefore, chunks of text\ncan be converted from and to a wide range of lightweight markup\nlanguages as well as html and tex/latex. Although literate programming\nhas become a little out of fashion, pnw can be used as a literate\nprogramming tool, too. Not surprisingly, pnw itself and its\ndocumentation is written using pnw. pnw is remotely inspired by noweb\nand heavily inspired by (even borrowing part of the syntax from)\n`antiweb `_. An important\nfeature of pnw, which is not present in antiweb, is the support of\nnamespaces. This allows to create reusable *block libraries* which can\nbe imported and addressed in a *dot-notation syntax* similar to python\nmodules.\n\nA pnw file is a text file with tags defining named blocks of text. In a\nway this is similar to an xml file. Tags may be hidden behind comment\ncharacters, such that the file remains processable by another program.\nThe blocks of text from various pnw files can be processed and rendered\nby another pnw file.\n\n\nDocumentation\n-------------\n\nThe documentation is written in ``latex``. To compile the\npdf ``pnw-doc.pdf`` run::\n\n make doc\n\nfrom the command line. You can also find pnw on the \npython package index. There pnw-doc.pdf is provided. I don't\nput it under version control because it will unnecessarily \ninflate the repo.\n\nExample\n-------\n\nAssuming that pnw is installed, from the main directory of the pnw\npackage open an interactive python session, I recommend to use\n``ipython``, and write\n\n::\n\n import pnw\n pnw.pnwimport('pnw.pnw','')\n\nNow you can explore the pnw document tree of the ``pnw.pnw`` source file\nby inspecting the dictionary\n\n::\n\n pnw.chunks\n\nTo see the structure of a block, just print its repr\n\n::\n\n pnw.chunks['moduledoc']\n\nTo render it, try\n\n::\n\n print pnw.chunks['moduledoc'].render(indent=0,depth=2,toformat='rst')\n\n\n\nThe pnw source consists of one file ``pnw.pnw``. It is a working python\nfile containing pnw tags hidden behind the ``#`` comment character. To\nproduce a clean python file we invoke (compare the makefile in the main\ndirectory)\n\n::\n\n python ./pnw.pnw -F pnw.pnw > pnw.py\n\nThe ``-F`` directive means that the whole file is treated as one block\nnamed ``u''``. The previous command is used when installing pnw for the\nfirst time.\n\nThe main driver file for the documentation is ``pnw-doc.pnw`` in the\n``doc`` directory. Here is the head of this file\n\n::\n\n #@chunk(main,format=latex)\n #@path(../..)\n #@path(..)\n #@import(latex-blocks.tex)\n #@import(md-blocks)\n #@import(pnw.pnw)\n #@include(ltxheader)\n\nFirst the whole file is declared to be a block named *main* which is\n``latex`` formatted. Then we add the first two parent directories to the\nsearch path for imports. Then the files ``latex-blocks.tex``,\n``md-blocks``, ``pnw.pnw`` are included into the main namespace ``u''``.\nThe block ``ltxheader``, which contains what its name says, and which\ncan be found in ``latex-blocks.tex`` is included.\n\n``pnw-doc.pnw`` contains a little of the documentation written in\n``latex``. Mostly, it includes blocks from other files. The bulk of the\ndocumentation, written in ``markdown``, can be found in ``md-blocks``.\n\nFinally, an executable ``latex`` file is produced by invoking\n\n::\n\n pnw -Rmain pnw-doc.pnw > pnw-doc.tex\n\n\n\npnw is on `Bitbucket`_ and on `PyPi`_.\n\n.. _Bitbucket: http://www.bitbucket.org/MLBN/2013-pnw\n.. _PyPi: https://pypi.python.org/pypi/pnw", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "pnw", "package_url": "https://pypi.org/project/pnw/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pnw/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/pnw/0.0.5r1/", "requires_dist": null, "requires_python": null, "summary": "A text processing and literate programming tool inspired by antiweb, noweb", "version": "0.0.5r1" }, "last_serial": 898352, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "1bad39d5d74476095d1bcaf4aff1fea9", "sha256": "b098c117cce130f239934c0cf5a50eaabaf17279799dc4c4f511b875708a0222" }, "downloads": -1, "filename": "pnw-0.0.5.tar.gz", "has_sig": false, "md5_digest": "1bad39d5d74476095d1bcaf4aff1fea9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 681734, "upload_time": "2013-10-19T08:04:18", "url": "https://files.pythonhosted.org/packages/67/7e/7e9360a959421b87211d6ecba7e18e2432841294fe8b9348147f28e2cc93/pnw-0.0.5.tar.gz" } ], "0.0.5r1": [ { "comment_text": "", "digests": { "md5": "259d13ea9a7baf5ce7ddb34ebb555273", "sha256": "8c562409ab69b8523ac86d39b4faf2cf1a872131eba6b23cbb41d4765a9778d6" }, "downloads": -1, "filename": "pnw-0.0.5r1.tar.gz", "has_sig": false, "md5_digest": "259d13ea9a7baf5ce7ddb34ebb555273", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 688269, "upload_time": "2013-10-19T15:29:00", "url": "https://files.pythonhosted.org/packages/b3/40/c86417fbe4067e526d54f29d824bf8f25700a521fde76fbece368f4311c3/pnw-0.0.5r1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "259d13ea9a7baf5ce7ddb34ebb555273", "sha256": "8c562409ab69b8523ac86d39b4faf2cf1a872131eba6b23cbb41d4765a9778d6" }, "downloads": -1, "filename": "pnw-0.0.5r1.tar.gz", "has_sig": false, "md5_digest": "259d13ea9a7baf5ce7ddb34ebb555273", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 688269, "upload_time": "2013-10-19T15:29:00", "url": "https://files.pythonhosted.org/packages/b3/40/c86417fbe4067e526d54f29d824bf8f25700a521fde76fbece368f4311c3/pnw-0.0.5r1.tar.gz" } ] }