smdg


Namesmdg JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummarySimple (pythonic) MarkDown Generator
upload_time2024-02-28 17:48:39
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Rainer Schwarzbach Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords markdown generator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple (pythonic) MarkDown Generator

_Modules to programmatically generate MarkDown source code in a pythonic way_

```
pip install smdg
```

Installation in a virtual environment is strongly recommended.


## Example usage

Use the classes in the **smdg.elements** module
to create MarkDown elements.

Some elements may be nested,
and the **smdg.elements.render()** function
can be used to return a MarkDown document
(consisting of the provided elements)
as a single string.


```
>>> from smdg import elements as me
>>>
>>> h1 = me.Header(1, "Main header")
>>> h2 = me.Header(2, "Printing colors:")
>>> p = me.Paragraph("Lorem ipsum dolor sit amet,\nconsectetuer adipiscing elit.")
>>> pre = me.CodeBlock('def main() -> int:\n    """main function"""\n    return 0')
>>> ul = me.UnorderedList("Cyan", "Magenta", "Yellow", "Key")
>>>
>>> print(h1)
# Main header
>>> print(h2)
## Printing colors:
>>> print(p)
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
>>>
>>> print(me.render(h1, p, pre, h2, ul))
# Main header

Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.

    def main() -> int:
        """main function"""
        return 0

## Printing colors:

*   Cyan
*   Magenta
*   Yellow
*   Key
>>>
>>> print(me.BlockQuote(h1, p, pre, h2, ul))
> # Main header
>
> Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit.
>
>     def main() -> int:
>         """main function"""
>         return 0
>
> ## Printing colors:
>
> *   Cyan
> *   Magenta
> *   Yellow
> *   Key
>>>
```


## Further reading

Please see the documentation at <https://blackstream-x.gitlab.io/smdg>
for detailed usage information.

If you found a bug or have a feature suggestion,
please open an issue [here](https://gitlab.com/blackstream-x/smdg/-/issues)


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "smdg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "markdown,generator",
    "author": "",
    "author_email": "Rainer Schwarzbach <rainer@blackstream.de>",
    "download_url": "https://files.pythonhosted.org/packages/99/80/7bb65d8506afa0ef84660bbf2e9d416b7092cdca62feccb9ea5bcc37d142/smdg-0.2.1.tar.gz",
    "platform": null,
    "description": "# Simple (pythonic) MarkDown Generator\n\n_Modules to programmatically generate MarkDown source code in a pythonic way_\n\n```\npip install smdg\n```\n\nInstallation in a virtual environment is strongly recommended.\n\n\n## Example usage\n\nUse the classes in the **smdg.elements** module\nto create MarkDown elements.\n\nSome elements may be nested,\nand the **smdg.elements.render()** function\ncan be used to return a MarkDown document\n(consisting of the provided elements)\nas a single string.\n\n\n```\n>>> from smdg import elements as me\n>>>\n>>> h1 = me.Header(1, \"Main header\")\n>>> h2 = me.Header(2, \"Printing colors:\")\n>>> p = me.Paragraph(\"Lorem ipsum dolor sit amet,\\nconsectetuer adipiscing elit.\")\n>>> pre = me.CodeBlock('def main() -> int:\\n    \"\"\"main function\"\"\"\\n    return 0')\n>>> ul = me.UnorderedList(\"Cyan\", \"Magenta\", \"Yellow\", \"Key\")\n>>>\n>>> print(h1)\n# Main header\n>>> print(h2)\n## Printing colors:\n>>> print(p)\nLorem ipsum dolor sit amet,\nconsectetuer adipiscing elit.\n>>>\n>>> print(me.render(h1, p, pre, h2, ul))\n# Main header\n\nLorem ipsum dolor sit amet,\nconsectetuer adipiscing elit.\n\n    def main() -> int:\n        \"\"\"main function\"\"\"\n        return 0\n\n## Printing colors:\n\n*   Cyan\n*   Magenta\n*   Yellow\n*   Key\n>>>\n>>> print(me.BlockQuote(h1, p, pre, h2, ul))\n> # Main header\n>\n> Lorem ipsum dolor sit amet,\n> consectetuer adipiscing elit.\n>\n>     def main() -> int:\n>         \"\"\"main function\"\"\"\n>         return 0\n>\n> ## Printing colors:\n>\n> *   Cyan\n> *   Magenta\n> *   Yellow\n> *   Key\n>>>\n```\n\n\n## Further reading\n\nPlease see the documentation at <https://blackstream-x.gitlab.io/smdg>\nfor detailed usage information.\n\nIf you found a bug or have a feature suggestion,\nplease open an issue [here](https://gitlab.com/blackstream-x/smdg/-/issues)\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Rainer Schwarzbach  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Simple (pythonic) MarkDown Generator",
    "version": "0.2.1",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/blackstream-x/smdg/-/issues",
        "CI": "https://gitlab.com/blackstream-x/smdg/-/pipelines",
        "Documentation": "https://blackstream-x.gitlab.io/smdg",
        "Homepage": "https://gitlab.com/blackstream-x/smdg",
        "Repository": "https://gitlab.com/blackstream-x/smdg.git"
    },
    "split_keywords": [
        "markdown",
        "generator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dce2383ea7d227288ae5b91f531301d2176f0443a243db5300c3a7a8da2f9dba",
                "md5": "5be64d07588948500cba47b309e12b3a",
                "sha256": "1dbb47ff13e92329f86e2a26b78adbc4efbcd107e2f5c1ccde960cca3799c5f6"
            },
            "downloads": -1,
            "filename": "smdg-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5be64d07588948500cba47b309e12b3a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14445,
            "upload_time": "2024-02-28T17:48:38",
            "upload_time_iso_8601": "2024-02-28T17:48:38.172470Z",
            "url": "https://files.pythonhosted.org/packages/dc/e2/383ea7d227288ae5b91f531301d2176f0443a243db5300c3a7a8da2f9dba/smdg-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99807bb65d8506afa0ef84660bbf2e9d416b7092cdca62feccb9ea5bcc37d142",
                "md5": "8a876ced8cc661ebe28a882fa95b489d",
                "sha256": "94a396803c86092f7a9a5adedf728c11e057335355b0707e7aaed55777398612"
            },
            "downloads": -1,
            "filename": "smdg-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8a876ced8cc661ebe28a882fa95b489d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 16890,
            "upload_time": "2024-02-28T17:48:39",
            "upload_time_iso_8601": "2024-02-28T17:48:39.126647Z",
            "url": "https://files.pythonhosted.org/packages/99/80/7bb65d8506afa0ef84660bbf2e9d416b7092cdca62feccb9ea5bcc37d142/smdg-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 17:48:39",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "blackstream-x",
    "gitlab_project": "smdg",
    "lcname": "smdg"
}
        
Elapsed time: 0.18550s