{"id":17247593,"url":"https://github.com/joshdata/commonmark-py-plaintext","last_synced_at":"2025-03-26T05:41:19.960Z","repository":{"id":66126376,"uuid":"58466411","full_name":"JoshData/commonmark-py-plaintext","owner":"JoshData","description":"REPLACED BY https://github.com/GovReady/CommonMark-py-Extensions","archived":false,"fork":false,"pushed_at":"2020-06-07T21:45:14.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"primary","last_synced_at":"2025-01-31T07:16:46.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/GovReady/CommonMark-py-Extensions","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoshData.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-10T14:04:39.000Z","updated_at":"2020-04-26T06:22:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5fa8210-c2d0-403f-a76d-6172faf02293","html_url":"https://github.com/JoshData/commonmark-py-plaintext","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fcommonmark-py-plaintext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fcommonmark-py-plaintext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fcommonmark-py-plaintext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Fcommonmark-py-plaintext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshData","download_url":"https://codeload.github.com/JoshData/commonmark-py-plaintext/tar.gz/refs/heads/primary","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598294,"owners_count":20641882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:38:25.219Z","updated_at":"2025-03-26T05:41:19.942Z","avatar_url":"https://github.com/JoshData.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"A `CommonMark-py`_\u003chttps://github.com/rtfd/CommonMark-py\u003e renderer that outputs pretty plain text (not the original Markdown but something nicer for end users to see) or round-trips to compliant CommonMark.\n\nThe library was built against `CommonMark 0.25`_\u003chttp://spec.commonmark.org/0.25/\u003e and `CommonMark-py 0.6.4`_\u003chttps://github.com/rtfd/CommonMark-py\u003e.\n\nExample::\n\n    import CommonMark\n    import CommonMarkPlainText\n\n    markdown_string = \"\"\"# Hello!\\n\\nThis is [a link](https://github.com/JoshData/commonmark-py-plaintext).\"\"\"\n\n    ast = CommonMark.Parser().parse(markdown_string)\n    text = CommonMarkPlainText.CommonMarkPlainTextRenderer().render(ast)\n\n    print(text)\n\nWhich outputs::\n\n\tHello!\n\t######\n\n\tThis is a link \u003chttps://github.com/JoshData/commonmark-py-plaintext\u003e.\n\nOr using the CommonMarkToCommonMarkRenderer instead of the CommonMarkPlainTextRenderer, you get::\n\n\tHello\\!\n\t=======\n\n\tThis is [a link](https://github.com/JoshData/commonmark-py-plaintext)\\.\n\nWhy have a special renderer for plain text?\n\n* Links appear more friendly than in the []() notation.\n* Indentation is normalized.\n* There are many ways to specify a heading in CommonMark, so heading styles are normalized in the output.\n* Entity references like \"\u0026#1234;\" are turned into Unicode characters.\n\nLimitations:\n\n* The html_inline and html_block nodes are not supported and will raise a ValueError exception.\n* Images are rendered as \"[image]\" plus their alt text.\n* The CommonMarkToCommonMarkRenderer is pretty good but is not complete. It also has some additional limitations: it over-zealously backslash-escapes punctuation characters because it can't tell when it would be safe to not do so, lists next to each other may be combined, the loose/tight distinction of lists is not captured in output.\n\nTesting:\n\nThere is no reference output for what the plain text renderer should produce. But I've saved the output of all of the CommonMark spec examples into reference_output.txt so that as this library evolves we can see changes. To check for consistency with previous output of this library, run::\n\n    python3 test.py \u003e reference_output.txt\n    git diff\n\nThe CommonMarkPlainTextRenderer is tested by round-tripping CommonMark (parsing, then outputing it as CommonMark), and then parsing that and outputting to HTML. The final HTML should match the HTML that you'd get from just rendering to HTML in one step. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdata%2Fcommonmark-py-plaintext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdata%2Fcommonmark-py-plaintext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdata%2Fcommonmark-py-plaintext/lists"}