# Better-md
## Insallation
```bash
pip install better-md
# Extras
pip install better-md[tables] # For pandas support
```
## Usage
<details>
<summary><h3>HTML</h3></summary>
```python
import BetterMD as md
html = md.H1("Hello, world!").to_html()
md = md.H1("Hello, world!")..to_md()
rst = md.H1("Hello, world!").to_rst()
```
</details>
<details>
<summary><h3>Tables</h3></summary>
```python
import BetterMD as md
t = md.Table(
inner=[
md.THead(
inner=[
md.Tr(
inner=[
md.Th(inner=[md.Text("Header 1")], styles={"text-align":"left"}),
md.Th(inner=[md.Text("Header 2")], styles={"text-align":"center"}),
md.Th(inner=[md.Text("Header 3")], styles={"text-align":"right"}),
md.Th(inner=[md.Text("Header 4")])
],
),
]
),
md.TBody(
inner=[
md.Tr(
inner=[
md.Td(inner=[md.Text("Row 1 Cell 1")]),
md.Td(inner=[md.Text("Row 1 Cell 2")]),
md.Td(inner=[md.Text("Row 1 Cell 3")]),
md.Td(inner=[md.Text("Row 1 Cell 4")]),
],
),
md.Tr(
inner=[
md.Td(inner=[md.Text("Row 2 Cell 1")]),
md.Td(inner=[md.Text("Row 2 Cell 2")]),
md.Td(inner=[md.Text("Row 2 Cell 3")]),
md.Td(inner=[md.Text("Row 2 Cell 4")]),
]
)
]
)
]
)
t.to_md()
t.to_rst()
t.to_html()
t.to_pandas() # Requires `tables` extra
```
</details>
Raw data
{
"_id": null,
"home_page": "https://github.com/Betters-Markdown/better_md",
"name": "Better-MD",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, better markdown, markdown",
"author": "R5dan",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/dd/b4/7df5f379e393c0375f45c107172d900f34ea4753b45267c06d38c007cf07/better_md-0.2.3.tar.gz",
"platform": null,
"description": "# Better-md\n\n## Insallation\n\n```bash\npip install better-md\n\n# Extras\n\npip install better-md[tables] # For pandas support\n```\n\n## Usage\n\n<details>\n <summary><h3>HTML</h3></summary>\n\n```python\nimport BetterMD as md\n\nhtml = md.H1(\"Hello, world!\").to_html()\nmd = md.H1(\"Hello, world!\")..to_md()\nrst = md.H1(\"Hello, world!\").to_rst()\n```\n</details>\n\n<details>\n <summary><h3>Tables</h3></summary>\n\n```python\nimport BetterMD as md\n\nt = md.Table(\n inner=[\n md.THead(\n inner=[\n md.Tr(\n inner=[\n md.Th(inner=[md.Text(\"Header 1\")], styles={\"text-align\":\"left\"}),\n md.Th(inner=[md.Text(\"Header 2\")], styles={\"text-align\":\"center\"}),\n md.Th(inner=[md.Text(\"Header 3\")], styles={\"text-align\":\"right\"}),\n md.Th(inner=[md.Text(\"Header 4\")])\n ],\n ),\n ]\n ),\n md.TBody(\n inner=[\n md.Tr(\n inner=[\n md.Td(inner=[md.Text(\"Row 1 Cell 1\")]),\n md.Td(inner=[md.Text(\"Row 1 Cell 2\")]),\n md.Td(inner=[md.Text(\"Row 1 Cell 3\")]),\n md.Td(inner=[md.Text(\"Row 1 Cell 4\")]),\n ],\n ),\n md.Tr(\n inner=[\n md.Td(inner=[md.Text(\"Row 2 Cell 1\")]),\n md.Td(inner=[md.Text(\"Row 2 Cell 2\")]),\n md.Td(inner=[md.Text(\"Row 2 Cell 3\")]),\n md.Td(inner=[md.Text(\"Row 2 Cell 4\")]),\n ]\n )\n ]\n )\n ]\n)\n\nt.to_md()\nt.to_rst()\nt.to_html()\nt.to_pandas() # Requires `tables` extra\n```\n</details>\n",
"bugtrack_url": null,
"license": null,
"summary": "A better markdown library",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/Betters-Markdown/better_md"
},
"split_keywords": [
"python",
" better markdown",
" markdown"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a48e4bb660c044416db3ac4728fa0551bb3919d684b34d133317461fb8349e57",
"md5": "c6dd3791b648391e09b6fca90bc1187a",
"sha256": "de4ae78aab59d89b00f3c32008e5f4c08bc75d6d05e39c5535d03506e139f83f"
},
"downloads": -1,
"filename": "Better_MD-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c6dd3791b648391e09b6fca90bc1187a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17719,
"upload_time": "2024-12-30T00:53:39",
"upload_time_iso_8601": "2024-12-30T00:53:39.570784Z",
"url": "https://files.pythonhosted.org/packages/a4/8e/4bb660c044416db3ac4728fa0551bb3919d684b34d133317461fb8349e57/Better_MD-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ddb47df5f379e393c0375f45c107172d900f34ea4753b45267c06d38c007cf07",
"md5": "d0570cd4157e65ff7468490a88caf3a7",
"sha256": "c7bac727f56d19a625ccca3648b4055d10d61b2956376eac6c64d03b20fd71cf"
},
"downloads": -1,
"filename": "better_md-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "d0570cd4157e65ff7468490a88caf3a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10756,
"upload_time": "2024-12-30T00:53:41",
"upload_time_iso_8601": "2024-12-30T00:53:41.625593Z",
"url": "https://files.pythonhosted.org/packages/dd/b4/7df5f379e393c0375f45c107172d900f34ea4753b45267c06d38c007cf07/better_md-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-30 00:53:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Betters-Markdown",
"github_project": "better_md",
"github_not_found": true,
"lcname": "better-md"
}