{ "info": { "author": "CFPB", "author_email": "tech@cfpb.gov", "bugtrack_url": null, "classifiers": [ "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "License :: Public Domain", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Regdown\n\n[![Build Status](https://travis-ci.org/cfpb/regdown.svg?branch=master)](https://travis-ci.org/cfpb/regdown)\n[![Coverage Status](https://coveralls.io/repos/github/cfpb/regdown/badge.svg?branch=master)](https://coveralls.io/github/cfpb/regdown?branch=master)\n\nRegdown is a [Python-Markdown](https://python-markdown.github.io) extension for interactive regulation text.\n\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Getting help](#getting-help)\n- [Getting involved](#getting-involved)\n- [Licensing](#licensing)\n- [Credits and references](#credits-and-references)\n\n## Dependencies\n\n- Python 2.7+, 3.6+\n- [Python-Markdown](https://python-markdown.github.io) 3.0+\n\n## Installation\n\nFirst, install Regdown:\n\n```shell\npip install regdown\n```\n\nThen you can either:\n\n\n- Specify Regdown as an extension in calls to `markdown`:\n\n ```python\n import markdown\n from regdown import RegulationsExtension\n\n markdown.markdown(text, extensions=[RegulationsExtension()],)\n ```\n\n- Use convenience `regdown` function to render Markdown with the `RegulationsExtension`:\n\n ```python\n from regdown import regdown\n\n regdown(text)\n ```\n\n## Documentation\n\n\nRegdown adds three major features to Markdown to support making federal regulations easier to navigate and read.\n\n### Labeled Paragraphs\n\n`{label} Paragraph text`\n\nEach paragraph can have a defined label, using `{label}` syntax at the start of the paragraph. This is translated into an `id` attribute on the resulting HTML paragraph element. If no label is given, the contents of the paragraph are hashed to generate a unique `id` for that paragraph. This makes any paragraph in the text directly linkable.\n\n### Pseudo Forms\n\n- `Form field: __`\n- `__Form Field`\n- `inline__fields__`\n\nExample print forms, where the `\\_\\_` indicate a space for hand-written input. Can be any number of underscores between 2 and 50.\n\n### Section symbols\n\n`\u00a7 1024.5(d)`\n`\u00a71024.5(d)`\n\nSection symbols will always have a non-breaking space ( ) inserted between them and whatever follows to avoid hanging a symbol at the end of a line.\n\n### Block references\n\n`see(label)`\n\nInsert the contents of labeled paragraphs in other Regdown documents inline into the current document. \n\nReferences can be placed before or after paragraphs. These references are to labeled paragraphs in other Markdown documents. When a `contents_resolver` callback and `url_resolver` callback are provided, the text of those other paragraphs can be looked up and inserted inline into the document making the reference. If `render_block_reference` callback is provided, custom rendering of the referenced text to HTML can be performed.\n\nCallbacks:\n\n- `contents_resolver(label)`: resolve the paragraph label and return the Markdown contents of that paragraph if the paragraph exists.\n- `url_resolver(label)`: resolve the paragraph label and return a URL to that paragraph if the paragraph exists.\n- `render_block_reference(contents, url=None)`: render the contents of a block reference to HTML. The url to the reference may be give as a keyword argument if `url_resolver` is provided.\n\n```python\nfrom regdown import regdown\n\ndef my_contents_resolver(label):\n # Lookup the document that contains the given label \u2026\n return corresponding_markdown_text\n\ndef my_block_renderer(block_markdown_contents, url=None):\n # Render the block to HTML\n return block_html\n\nregdown(\n text,\n contents_resolver=my_contents_resolver,\n render_block_reference=my_block_renderer\n)\n```\n\n## Getting help\n\nPlease add issues to the [issue tracker](https://github.com/cfpb/regdown/issues).\n\n## Getting involved\n\nGeneral instructions on _how_ to contribute can be found in [CONTRIBUTING](CONTRIBUTING.md).\n\n## Licensing\n1. [TERMS](TERMS.md)\n2. [LICENSE](LICENSE)\n3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)\n\n## Credits and references\n\nregdown was forked from [Wagtail-Flags](https://github.com/cfpb/wagtail-flags), which was itself forked from [cfgov-refresh](https://github.com/cfpb/cfgov-refresh).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cfpb/regdown", "keywords": "", "license": "CC0", "maintainer": "", "maintainer_email": "", "name": "regdown", "package_url": "https://pypi.org/project/regdown/", "platform": "", "project_url": "https://pypi.org/project/regdown/", "project_urls": { "Homepage": "https://github.com/cfpb/regdown" }, "release_url": "https://pypi.org/project/regdown/1.0.1/", "requires_dist": [ "Markdown (<4.0,>=3.0)", "sha3 (==0.2.1)", "coverage (>=3.7.0) ; extra == 'testing'" ], "requires_python": "", "summary": "Markdown extension for interactive regulations", "version": "1.0.1" }, "last_serial": 5292056, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "69cc285d24b6f5ba93c648d2c478e017", "sha256": "3ab8d08cbde3ee7f0079496ae6436bee7a9bf54f6fa0d38f71e1e1b81add8e76" }, "downloads": -1, "filename": "regdown-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69cc285d24b6f5ba93c648d2c478e017", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11482, "upload_time": "2019-05-17T13:53:08", "url": "https://files.pythonhosted.org/packages/0b/38/2d464ab7d6e90ff94101616e39af565bec715d70371fde963e386c9ba1d1/regdown-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56ee65be276064b6dc88b2de9ee18df8", "sha256": "6484535da680045292dabee19dd61694085c008e49328ed117246f6993d3c118" }, "downloads": -1, "filename": "regdown-1.0.0.tar.gz", "has_sig": false, "md5_digest": "56ee65be276064b6dc88b2de9ee18df8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11474, "upload_time": "2019-05-17T13:53:10", "url": "https://files.pythonhosted.org/packages/e6/e8/30ff93a1409642dd09c5a2ce794cf40ab07a2d930e9460f81fb41d59c45a/regdown-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2f44ca747f7a74e3294fa6c3e7805703", "sha256": "90a59718a35c795e59834f9b37305cf09104b984332362c4e700292450c8426c" }, "downloads": -1, "filename": "regdown-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2f44ca747f7a74e3294fa6c3e7805703", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11479, "upload_time": "2019-05-20T12:27:02", "url": "https://files.pythonhosted.org/packages/1a/04/bb40a410d0a8fa9b78d02968e81bee10445f925e5b30158445af1ecf9a09/regdown-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e07e7c73e42b9e1ff2079097dc2187d", "sha256": "1e32ca9251b79088a30d22601f61be2bffd56342854691402e72b73095a846fc" }, "downloads": -1, "filename": "regdown-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7e07e7c73e42b9e1ff2079097dc2187d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11469, "upload_time": "2019-05-20T12:27:03", "url": "https://files.pythonhosted.org/packages/70/b4/722d65aa121186c1144dc8f59adb10ba476679d3793545f570d9d9c4f10a/regdown-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f44ca747f7a74e3294fa6c3e7805703", "sha256": "90a59718a35c795e59834f9b37305cf09104b984332362c4e700292450c8426c" }, "downloads": -1, "filename": "regdown-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2f44ca747f7a74e3294fa6c3e7805703", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11479, "upload_time": "2019-05-20T12:27:02", "url": "https://files.pythonhosted.org/packages/1a/04/bb40a410d0a8fa9b78d02968e81bee10445f925e5b30158445af1ecf9a09/regdown-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e07e7c73e42b9e1ff2079097dc2187d", "sha256": "1e32ca9251b79088a30d22601f61be2bffd56342854691402e72b73095a846fc" }, "downloads": -1, "filename": "regdown-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7e07e7c73e42b9e1ff2079097dc2187d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11469, "upload_time": "2019-05-20T12:27:03", "url": "https://files.pythonhosted.org/packages/70/b4/722d65aa121186c1144dc8f59adb10ba476679d3793545f570d9d9c4f10a/regdown-1.0.1.tar.gz" } ] }