{"id":13478505,"url":"https://github.com/TheRenegadeCoder/SnakeMD","last_synced_at":"2025-03-27T07:31:15.608Z","repository":{"id":40396380,"uuid":"385706791","full_name":"TheRenegadeCoder/SnakeMD","owner":"TheRenegadeCoder","description":"A markdown generation library for Python. ","archived":false,"fork":false,"pushed_at":"2025-01-03T02:20:24.000Z","size":6635,"stargazers_count":42,"open_issues_count":11,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-03T02:36:10.685Z","etag":null,"topics":["markdown","python"],"latest_commit_sha":null,"homepage":"https://www.snakemd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheRenegadeCoder.png","metadata":{"files":{"readme":"README.md","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":"2021-07-13T18:57:34.000Z","updated_at":"2024-11-19T04:25:55.000Z","dependencies_parsed_at":"2023-11-22T02:08:15.582Z","dependency_job_id":"1d708b50-2ff7-43b7-958a-3caa6784d125","html_url":"https://github.com/TheRenegadeCoder/SnakeMD","commit_stats":{"total_commits":152,"total_committers":5,"mean_commits":30.4,"dds":0.09210526315789469,"last_synced_commit":"f3e339615fa67b4251facaa4cc9f6dadcf2a1ad8"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRenegadeCoder%2FSnakeMD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRenegadeCoder%2FSnakeMD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRenegadeCoder%2FSnakeMD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRenegadeCoder%2FSnakeMD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheRenegadeCoder","download_url":"https://codeload.github.com/TheRenegadeCoder/SnakeMD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245802479,"owners_count":20674676,"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":["markdown","python"],"created_at":"2024-07-31T16:01:57.986Z","updated_at":"2025-03-27T07:31:14.083Z","avatar_url":"https://github.com/TheRenegadeCoder.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Welcome to SnakeMD\n\nSnakeMD is your ticket to generating Markdown in Python. To prove it to you, we've generated this entire README using SnakeMD. See readme.py for how it was done. To get started, download and install SnakeMD:\n\n```shell\npip install snakemd\n```\n\nIn the remainder of this document, we'll show you all of the things this library can do. For more information, check out the official documentation [here](https://snakemd.io).\n\n## Table of Contents\n\nBelow you'll find the table of contents, but these can also be generated programatically for every Markdown document as follows:\n\n```py\ndef _table_of_contents(doc: Document):\n    doc.add_table_of_contents(range(2, 4))\n```\n\n1. [Table of Contents](#table-of-contents)\n2. [Paragraphs](#paragraphs)\n3. [Links](#links)\n4. [Images](#images)\n5. [Lists](#lists)\n   1. [Ordered List](#ordered-list)\n   2. [Unordered List](#unordered-list)\n   3. [Checklist](#checklist)\n   4. [Nested Lists](#nested-lists)\n6. [Tables](#tables)\n7. [Code Blocks](#code-blocks)\n8. [Quotes](#quotes)\n9. [Horizontal Rule](#horizontal-rule)\n10. [Raw](#raw)\n\n## Paragraphs\n\nParagraphs are the most basic feature of any Markdown file. As a result, they are very easy to create using SnakeMD.\n\n_SnakeMD Source_\n\n```py\ndef _paragraph(doc: Document):\n    doc.add_paragraph(\"I think. Therefore, I am.\")\n```\n\n_Markdown Source_\n\n```markdown\nI think. Therefore, I am.\n```\n\n_Rendered Result_\n\nI think. Therefore, I am.\n\n## Links\n\nLinks are targets to files or web pages and can be embedded in paragraphs in a variety of ways, such as with the insert_link() method.\n\n_SnakeMD Source_\n\n```py\ndef _insert_link(doc: Document):\n    doc.add_paragraph(\n        \"Learn to program with The Renegade Coder (@RenegadeCoder94).\"\n    ).insert_link(\"The Renegade Coder\", \"https://therenegadecoder.com\").insert_link(\n        \"@RenegadeCoder94\", \"https://twitter.com/RenegadeCoder94\"\n    )\n```\n\n_Markdown Source_\n\n```markdown\nLearn to program with [The Renegade Coder](https://therenegadecoder.com) ([@RenegadeCoder94](https://twitter.com/RenegadeCoder94)).\n```\n\n_Rendered Result_\n\nLearn to program with [The Renegade Coder](https://therenegadecoder.com) ([@RenegadeCoder94](https://twitter.com/RenegadeCoder94)).\n\n## Images\n\nImages can be added by embedding Inline elements in a paragraph.\n\n_SnakeMD Source_\n\n```py\ndef _image(doc: Document):\n    logo = \"https://therenegadecoder.com/wp-content/uploads/2020/05/header-logo-without-tag-300x75.png\"\n    doc.add_block(Paragraph([Inline(\"Logo\", image=logo)]))\n```\n\n_Markdown Source_\n\n```markdown\n![Logo](https://therenegadecoder.com/wp-content/uploads/2020/05/header-logo-without-tag-300x75.png)\n```\n\n_Rendered Result_\n\n![Logo](https://therenegadecoder.com/wp-content/uploads/2020/05/header-logo-without-tag-300x75.png)\n\n## Lists\n\nSnakeMD can make a variety of Markdown lists. The three main types of lists are ordered, unordered, and checked.\n\n### Ordered List\n\nOrdered lists are lists in which the order of the items matters. As a result, we number them.\n\n_SnakeMD Source_\n\n```py\ndef _ordered_list(doc: Document):\n    doc.add_ordered_list([\"Deku\", \"Bakugo\", \"Uraraka\", \"Tsuyu\"])\n```\n\n_Markdown Source_\n\n```markdown\n1. Deku\n2. Bakugo\n3. Uraraka\n4. Tsuyu\n```\n\n_Rendered Result_\n\n1. Deku\n2. Bakugo\n3. Uraraka\n4. Tsuyu\n\n### Unordered List\n\nUnordered lists are lists in which the order of the items does not matter. As a result, we bullet them.\n\n_SnakeMD Source_\n\n```py\ndef _unordered_list(doc: Document):\n    doc.add_unordered_list([\"Crosby\", \"Malkin\", \"Lemieux\"])\n```\n\n_Markdown Source_\n\n```markdown\n- Crosby\n- Malkin\n- Lemieux\n```\n\n_Rendered Result_\n\n- Crosby\n- Malkin\n- Lemieux\n\n### Checklist\n\nChecklists are lists in which the items themselves can be checked on and off. This feature is new as of v0.10.0.\n\n_SnakeMD Source_\n\n```py\ndef _checklist(doc: Document):\n    doc.add_checklist([\"Pass the puck\", \"Shoot the puck\", \"Score a goal\"])\n```\n\n_Markdown Source_\n\n```markdown\n- [ ] Pass the puck\n- [ ] Shoot the puck\n- [ ] Score a goal\n```\n\n_Rendered Result_\n\n- [ ] Pass the puck\n- [ ] Shoot the puck\n- [ ] Score a goal\n\n### Nested Lists\n\nNested lists are complex lists that contain lists. Currently, SnakeMD does not support any convenience methods to generate nested lists, but they can be created manually using the MDList object.\n\n_SnakeMD Source_\n\n```py\ndef _nested_list(doc: Document):\n    doc.add_block(\n        MDList(\n            [\n                \"Apples\",\n                Inline(\"Onions\", bold=True),\n                MDList([\"Sweet\", \"Red\"]),\n                Paragraph([\"This is the end of the list!\"]),\n            ]\n        )\n    )\n```\n\n_Markdown Source_\n\n```markdown\n- Apples\n- **Onions**\n  - Sweet\n  - Red\n- This is the end of the list!\n```\n\n_Rendered Result_\n\n- Apples\n- **Onions**\n  - Sweet\n  - Red\n- This is the end of the list!\n\n## Tables\n\nTables are sets of rows and columns which can display text in a grid. To style any of the contents of a table, consider using Paragraph or Inline.\n\n_SnakeMD Source_\n\n```py\ndef _table(doc: Document):\n    doc.add_table(\n        [\"Height (cm)\", \"Weight (kg)\", \"Age (y)\"],\n        [[\"150\", \"70\", \"21\"], [\"164\", \"75\", \"19\"], [\"181\", \"87\", \"40\"]],\n        [Table.Align.LEFT, Table.Align.CENTER, Table.Align.RIGHT],\n        0,\n    )\n```\n\n_Markdown Source_\n\n```markdown\n| Height (cm) | Weight (kg) | Age (y) |\n| :---------- | :---------: | ------: |\n| 150         | 70          | 21      |\n| 164         | 75          | 19      |\n| 181         | 87          | 40      |\n```\n\n_Rendered Result_\n\n| Height (cm) | Weight (kg) | Age (y) |\n| :---------- | :---------: | ------: |\n| 150         | 70          | 21      |\n| 164         | 75          | 19      |\n| 181         | 87          | 40      |\n\n## Code Blocks\n\nCode blocks are a form of structured text for sharing code snippets with syntax highlighting.\n\n_SnakeMD Source_\n\n```py\ndef _code(doc: Document):\n    doc.add_code(\"x = 5\", lang=\"py\")\n```\n\n_Markdown Source_\n\n````markdown\n```py\nx = 5\n```\n````\n\n_Rendered Result_\n\n```py\nx = 5\n```\n\n## Quotes\n\nQuotes are blocks of text that represent quotes from people.\n\n_SnakeMD Source_\n\n```py\ndef _quote(doc: Document):\n    doc.add_quote(\"How Now Brown Cow\")\n```\n\n_Markdown Source_\n\n```markdown\n\u003e How Now Brown Cow\n```\n\n_Rendered Result_\n\n\u003e How Now Brown Cow\n\n## Horizontal Rule\n\nHorizontal Rules are visible dividers in a document.\n\n_SnakeMD Source_\n\n```py\ndef _horizontal_rule(doc: Document):\n    doc.add_horizontal_rule()\n```\n\n_Markdown Source_\n\n```markdown\n***\n```\n\n_Rendered Result_\n\n***\n\n## Raw\n\nIf at any time SnakeMD doesn't meet your needs, you can always add your own text using a raw block. These can be used to insert any preformatted text you like, such as HTML tags, Jekyll frontmatter, and more.\n\n_SnakeMD Source_\n\n```py\ndef _raw(doc: Document):\n    doc.add_raw(\"4\u003csup\u003e2\u003c/sup\u003e = 16\u003cbr /\u003eHow cool is that?\")\n```\n\n_Markdown Source_\n\n```markdown\n4\u003csup\u003e2\u003c/sup\u003e = 16\u003cbr /\u003eHow cool is that?\n```\n\n_Rendered Result_\n\n4\u003csup\u003e2\u003c/sup\u003e = 16\u003cbr /\u003eHow cool is that?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheRenegadeCoder%2FSnakeMD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheRenegadeCoder%2FSnakeMD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheRenegadeCoder%2FSnakeMD/lists"}