{ "info": { "author": "Zope Corporation and Contributors", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [], "description": "Using Structured Text\n\n WARNING! The 'StructuredText' package has been deprecated and will\n be removed in Zope 2.12. Use 'zope.structuredtext' instead.\n\n The goal of StructuredText is to make it possible to express\n structured text using a relatively simple plain text format. Simple\n structures, like bullets or headings are indicated through\n conventions that are natural, for some definition of\n \"natural\". Hierarchical structures are indicated through\n indentation. The use of indentation to express hierarchical\n structure is inspired by the Python programming language.\n\n Use of StructuredText consists of one to three logical steps. In the\n first step, a text string is converted to a network of objects using\n the 'StructuredText.Basic' facility, as in the following\n example::\n\n raw=open(\"mydocument.txt\").read()\n import StructuredText\n st=StructuredText.Basic(raw)\n\n The output of 'StructuredText.Basic' is simply a\n StructuredTextDocument object containing StructuredTextParagraph\n objects arranged in a hierarchy. Paragraphs are delimited by strings\n of two or more whitespace characters beginning and ending with\n newline characters. Hierarchy is indicated by indentation. The\n indentation of a paragraph is the minimum number of leading spaces\n in a line containing non-white-space characters after converting tab\n characters to spaces (assuming a tab stop every eight characters).\n\n StructuredTextNode objects support the read-only subset of the\n Document Object Model (DOM) API. It should be possible to process\n 'StructuredTextNode' hierarchies using XML tools such as XSLT.\n\n The second step in using StructuredText is to apply additional\n structuring rules based on text content. A variety of differentText\n rules can be used. Typically, these are used to implement a\n structured text language for producing documents, but any sort of\n structured text language could be implemented in the second\n step. For example, it is possible to use StructuredText to implement\n structured text formats for representing structured data. The second\n step, which could consist of multiple processing steps, is\n performed by processing, or \"coloring\", the hierarchy of generic\n StructuredTextParagraph objects into a network of more specialized\n objects. Typically, the objects produced should also implement the DOM\n API to allow processing with XML tools.\n\n A document processor is provided to convert a StructuredTextDocument\n object containing only StructuredStructuredTextParagraph objects\n into a StructuredTextDocument object containing a richer collection\n of objects such as bullets, headings, emphasis, and so on using\n hints in the text. Hints are selected based on conventions of the\n sort typically seen in electronic mail or news-group postings. It\n should be noted, however, that these conventions are somewhat\n culturally dependent, fortunately, the document processor is easily\n customized to implement alternative rules. Here's an example of\n using the DOC processor to convert the output of the previous example::\n\n doc=StructuredText.Document(st)\n\n The final step is to process the colored networks produced from the\n second step to produce additional outputs. The final step could be\n performed by Python programs, or by XML tools. A Python outputter is\n provided for the document processor output that produces Hypertext Markup\n Language (HTML) text::\n\n html=StructuredText.HTML(doc)\n\nCustomizing the document processor\n\n The document processor is driven by two tables. The first table,\n named 'paragraph_types', is a sequence of callable objects or method\n names for coloring paragraphs. If a table entry is a string, then it\n is the name of a method of the document processor to be used. For\n each input paragraph, the objects in the table are called until one\n returns a value (not 'None'). The value returned replaces the\n original input paragraph in the output. If none of the objects in\n the paragraph types table return a value, then a copy of the\n original paragraph is used. The new object returned by calling a\n paragraph type should implement the ReadOnlyDOM,\n StructuredTextColorizable, and StructuredTextSubparagraphContainer\n interfaces. See the 'Document.py' source file for examples.\n\n A paragraph type may return a list or tuple of replacement\n paragraphs, this allowing a paragraph to be split into multiple\n paragraphs. \n\n The second table, 'text_types', is a sequence of callable objects or\n method names for coloring text. The callable objects in this table\n are used in sequence to transform the input text into new text or\n objects. The callable objects are passed a string and return\n nothing ('None') or a three-element tuple consisting of:\n\n - a replacement object,\n\n - a starting position, and\n\n - an ending position\n\n The text from the starting position is (logically) replaced with the\n replacement object. The replacement object is typically an object\n that implements that implements the ReadOnlyDOM, and\n StructuredTextColorizable interfaces. The replacement object can\n also be a string or a list of strings or objects. Replacement is\n done from beginning to end and text after the replacement ending\n position will be passed to the character type objects for processing.\n\nExample: adding wiki links\n\n We want to add support for Wiki links. A Wiki link is a string of\n text containing mixed-case letters, such that at least two of the\n letters are upper case and such that the first letter is upper case.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://cheeseshop.python.org/pypi/StructuredText", "keywords": null, "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "StructuredText", "package_url": "https://pypi.org/project/StructuredText/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/StructuredText/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://cheeseshop.python.org/pypi/StructuredText" }, "release_url": "https://pypi.org/project/StructuredText/2.11.1/", "requires_dist": null, "requires_python": null, "summary": "This package provides the StructuredText package, as known from Zope 2.\nUnless you need to communicate with Zope 2 APIs, you're probably\nbetter off using the newer zope.structuredtext module.", "version": "2.11.1" }, "last_serial": 785739, "releases": { "2.11.1": [ { "comment_text": "", "digests": { "md5": "dc0162186c37c6ba3402cc7aaca23861", "sha256": "cdec67690d1987879aa53708c1692524b79d496bd054a8cd21e7d966f464cd91" }, "downloads": -1, "filename": "StructuredText-2.11.1.tar.gz", "has_sig": false, "md5_digest": "dc0162186c37c6ba3402cc7aaca23861", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51065, "upload_time": "2008-08-05T14:18:56", "url": "https://files.pythonhosted.org/packages/23/88/d01888de00c3120c1d880c021afe70eaf17390ebe84856680670a8fe6779/StructuredText-2.11.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dc0162186c37c6ba3402cc7aaca23861", "sha256": "cdec67690d1987879aa53708c1692524b79d496bd054a8cd21e7d966f464cd91" }, "downloads": -1, "filename": "StructuredText-2.11.1.tar.gz", "has_sig": false, "md5_digest": "dc0162186c37c6ba3402cc7aaca23861", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51065, "upload_time": "2008-08-05T14:18:56", "url": "https://files.pythonhosted.org/packages/23/88/d01888de00c3120c1d880c021afe70eaf17390ebe84856680670a8fe6779/StructuredText-2.11.1.tar.gz" } ] }