# pyhtmlify
pyhtmlify is a Python package that allows you to write HTML code with Pure Python. This package was mainly made for the [osd Project](https://github.com/Peggun/osd) for simplicity. Heres how to do it. This package isn't completely finished, as we are still adding heaps of stuff and more HTML tags to this project.
## 1. Installation
You can install pyhtml using pip
```py
pip install pyhtmlify
```
This will install the latest version of pyhtmlify.
## 2. How to use
pyhtmlify is quite easy to use. It is similar to html, but without all of the <> and other things involved. To do so, make a python file starting with html- and pyhtml will pick it up.
For pyhtml to pick up the file to generate the html code for you, you need to have a index function inside of your script. Like this for example:
```py
import pyhtmlify as ph
def index():
return ph.div(
ph.h1("Welcome to My Website"),
ph.input(type="text", placeholder="Enter your name"),
)
# Render the HTML
html_content = str(index())
```
That is all you need for the script side. Now onto the html conversion
## 3. PY to HTML Conversion
To convert python index functions into html documents, pyhtml comes with a pyhtml command to use. In the terminal, to generate html code for all the html- files, run
```py
pyhtmlify generate -o folder
```
The -o flag specifies the output folder, and there are some other flags and commands that are coming up.
However, you you dont use the -o flag, the program automatically defaults to /html. All file names of the html files are the same name as the python script.
## 4. Contribution
If you would like to contribute to this project, please check out the issues and contact me at peggundev@gmail.com, or come check out osd and join the discord community!
Raw data
{
"_id": null,
"home_page": "https://github.com/Peggun/pyhtml",
"name": "pyhtmlify-0.1.1",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Peggun",
"author_email": "peggundev@gmail.com",
"download_url": null,
"platform": null,
"description": "# pyhtmlify\r\n\r\npyhtmlify is a Python package that allows you to write HTML code with Pure Python. This package was mainly made for the [osd Project](https://github.com/Peggun/osd) for simplicity. Heres how to do it. This package isn't completely finished, as we are still adding heaps of stuff and more HTML tags to this project.\r\n\r\n## 1. Installation\r\nYou can install pyhtml using pip\r\n```py\r\npip install pyhtmlify\r\n```\r\nThis will install the latest version of pyhtmlify.\r\n\r\n## 2. How to use\r\npyhtmlify is quite easy to use. It is similar to html, but without all of the <> and other things involved. To do so, make a python file starting with html- and pyhtml will pick it up.\r\n\r\nFor pyhtml to pick up the file to generate the html code for you, you need to have a index function inside of your script. Like this for example:\r\n```py\r\nimport pyhtmlify as ph\r\n\r\ndef index():\r\n return ph.div(\r\n ph.h1(\"Welcome to My Website\"),\r\n ph.input(type=\"text\", placeholder=\"Enter your name\"),\r\n )\r\n\r\n# Render the HTML\r\nhtml_content = str(index())\r\n```\r\n\r\nThat is all you need for the script side. Now onto the html conversion\r\n\r\n## 3. PY to HTML Conversion\r\nTo convert python index functions into html documents, pyhtml comes with a pyhtml command to use. In the terminal, to generate html code for all the html- files, run \r\n```py\r\npyhtmlify generate -o folder\r\n```\r\nThe -o flag specifies the output folder, and there are some other flags and commands that are coming up. \r\nHowever, you you dont use the -o flag, the program automatically defaults to /html. All file names of the html files are the same name as the python script.\r\n\r\n## 4. Contribution\r\nIf you would like to contribute to this project, please check out the issues and contact me at peggundev@gmail.com, or come check out osd and join the discord community!\r\n",
"bugtrack_url": null,
"license": null,
"summary": "HTML in Pure Python",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/Peggun/pyhtml"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0eb13ac0b3d0cdbc331e76553bce78aff0131c523255e5eaacb065ce86ea22a",
"md5": "5a03da45248b8524d726004bc05c7e9e",
"sha256": "8256f3361387702002624108cc50d7b79967883b575a0bd027cf42c7f7c0c872"
},
"downloads": -1,
"filename": "pyhtmlify_0.1.1-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5a03da45248b8524d726004bc05c7e9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 18113,
"upload_time": "2024-08-23T15:31:39",
"upload_time_iso_8601": "2024-08-23T15:31:39.399404Z",
"url": "https://files.pythonhosted.org/packages/b0/eb/13ac0b3d0cdbc331e76553bce78aff0131c523255e5eaacb065ce86ea22a/pyhtmlify_0.1.1-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-23 15:31:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Peggun",
"github_project": "pyhtml",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pyhtmlify-0.1.1"
}