{ "info": { "author": "Nat Pryce", "author_email": "sw@natpryce.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Software Development" ], "description": "Code Guide\n==========\n\nA tool that generates an interactive HTML explanation of how code\nworks from unobtrusive markup of comments in the code. The\nexplanation is readable in the source, as well as in the generated\ndocumentation.\n\n\nInstallation\n============\n\nInstall with pip:\n\n pip install code-guide\n\n\nRunning the Tool\n================\n\nTo convert a single file, _example.py_:\n\n # This is where we are going to save generated HTML\n mkdir outdir\n\t\n\t# Generate HTML from some example code \n code-guide example.py --extract-resources -o outdir/example.html\n\nRun `code-guide --help` for more help on the command-line options.\n\n\nConverting Multiple Files with Make\n===================================\n\nWhen converting multiple files, run the translation of source files\ninto HTML and the extraction of resources used by all the generated\nHTML as separate steps.\n\nIt's convenient to use Make to coordinate the translation of multiple\nfiles, as so:\n\n EXAMPLES = $(wildcard examples/*.java)\n\tEXAMPLE_DOCS = $(EXAMPLES:%.java=docs/%.html)\n\t\n\tdocs: $(EXAMPLE_DOCS) docs/examples/code-guide.css\n\t.PHONY: docs\n\n\tdocs/examples/%.html: examples/%.java\n\t\t@mkdir -p $(dir $@)\n\t\tcode-guide $< -o $@ -r . -l java -c // -t '(.+).java' '\\1.html'\n\t\n\tdocs/examples/code-guide.css:\n\t\t@mkdir -p $(dir $@)\n\t\tcode-guide --extract-resources --resource-dir=$(dir $@)\n\n\n\nHow to Mark Up Example Code\n===========================\n\nMark up regions of code to be explained by adding line comments that\nimmediately start with a \"|\" character at the start of the region, and\na line comment that starts with \"|.\" at the end of the region.\n\nE.g., in Python:\n\n #| This is the start\n some_code()\n #|.\n \n \nIn Java:\n\n //| This is the start\n SomeCodeFactoryFactoryImpl.getSomeCodeFactory().getSomeCode().run();\n //|.\n \nThe rest of this document describes using the tool with a language\nthat has line comments starting with \"#\", but the documentation\napplies to just as well languages with a different line-comment\nsyntax.\n\nAdjacent #| comments are treated as a single block of Markdown syntax.\nRegions can be nested but not overlap.\n\n #| This if statement compares two numbers.\n #|\n #| It copes with floating point _NaN_ values.\n if a > b:\n print \"larger\"\n elif a < b:\n print \"smaller\"\n elif a == b:\n print \"the same\"\n else:\n #| _NaN_ is never equal to another floating point value, not even to _NaN_.\n print \"NaN\"\n #|.\n #|.\n\n\nThe order in which explanations are presented to the reader can be\ncontrolled by adding indices in square brackets at the start of each\n#| comment block. Indices start at 1. Either all or none of the\nexplanations must have an index. If no explanations have an index,\nthey are shown in the order they appear in the source code.\n\n\n #| [2] This statement will be explained second.\n print \"goodbye, cruel world.\"\n #|.\n\n #| [1] This statement will be explained first.\n sys.exit(1)\n #|.\n\nThe generated document can be given an introduction and/or end-note in\nmarkdown format with a block of adjacent lines that start with #||.\nIf the introduction has a top-level heading, the text of the heading\nis used as the title of the generated HTML.\n\nOnly the first and last block of text will be used. Any others will\nbe silently ignored (and may cause an error in future versions of the\ntool).\n\n\n #|| Hello World\n #|| ===========\n #||\n #|| Hello world is traditionally used to illustrate to beginners \n #|| the most basic syntax of a programming language, or to verify \n #|| that a language or system is operating correctly.\n \n #| This is all that is required in Python\n print \"hello, world\"\n #|.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://natpryce.com", "keywords": null, "license": "Apache 2.0. Bootstro is used under the MIT license.", "maintainer": null, "maintainer_email": null, "name": "code-guide", "package_url": "https://pypi.org/project/code-guide/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/code-guide/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://natpryce.com" }, "release_url": "https://pypi.org/project/code-guide/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Turn example code into interactive HTML documentation", "version": "1.0.2" }, "last_serial": 715049, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3e4981fd5ecb01d82662e4d72fec9021", "sha256": "d52ec0edea7097badeb671dc15cded3403e01c44179ba5159645530523b2b033" }, "downloads": -1, "filename": "code-guide-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3e4981fd5ecb01d82662e4d72fec9021", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8400, "upload_time": "2013-05-29T22:41:20", "url": "https://files.pythonhosted.org/packages/a4/ee/14ab061217bfd34486f902b87ef56649a497cf80263706d2d5f2ca0988c1/code-guide-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f4a8b172d2ce64b8c1dde52a0c6a4390", "sha256": "0a500347966d7279e6aa67bf8a74bc26ffadb3226118aa0c57194dd93ba2feb5" }, "downloads": -1, "filename": "code-guide-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f4a8b172d2ce64b8c1dde52a0c6a4390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 126323, "upload_time": "2013-05-30T18:40:14", "url": "https://files.pythonhosted.org/packages/51/85/c14ac72e612c7d801c3ff182817146d3e6af376084052dabbf08f7f9c30e/code-guide-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "e539648217a4b5a6c1492b3c72ca2c38", "sha256": "14791eaba28b4bc51a22fdd44f88898de2881dd66015cfc1c6ca5a35de29f006" }, "downloads": -1, "filename": "code-guide-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e539648217a4b5a6c1492b3c72ca2c38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 126740, "upload_time": "2013-05-30T22:11:44", "url": "https://files.pythonhosted.org/packages/fe/44/9a77c46aa86fc3c96c606e62b94877a930d272bef938f378da61aceca6af/code-guide-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e539648217a4b5a6c1492b3c72ca2c38", "sha256": "14791eaba28b4bc51a22fdd44f88898de2881dd66015cfc1c6ca5a35de29f006" }, "downloads": -1, "filename": "code-guide-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e539648217a4b5a6c1492b3c72ca2c38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 126740, "upload_time": "2013-05-30T22:11:44", "url": "https://files.pythonhosted.org/packages/fe/44/9a77c46aa86fc3c96c606e62b94877a930d272bef938f378da61aceca6af/code-guide-1.0.2.tar.gz" } ] }