Provides tools for making html.
Project description
htmlmaster
Provides tools for making html.
Installation
$ pip install htmlmaster
Usage
Make an html table
>>> from repo.htmlmaster import src as hm
>>> table = hm.HTMLTableMaker(index=[1, 2], columns=["foo", "bar"])
>>> table[0, 0] = "this"
>>> table[0, 1] = "is"
>>> table[1, 0] = "a"
>>> table[1, 1] = "table"
>>> table.make()
'<table class="main">\n<thead>\n<tr>\n<th>foo</th>\n<th>bar</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>this</td>\n<td>is</td>\n</tr>\n<tr>\n<td>a</td>\n<td>table</td>\n</tr>\n</tbody>\n</table>'
If you are using a jupyter notebook, you can run a cell like this:
>>> table.show()
| foo | bar |
|---|---|
| this | is |
| a | table |
Make an html tree
>>> tree = hm.HTMLTreeMaker("this")
>>> tree.add("is")
>>> tree.add("a")
>>> tree.get(-1).add("tree")
>>> tree.make()
'<ul class="main">\n<li class="m"><details open><summary>this</summary>\n<ul class="m">\n<li class="m"><span>is</span></li>\n<li class="m"><details open><summary>a</summary>\n<ul class="m">\n<li class="m"><span>tree</span></li>\n</ul>\n</details></li>\n</ul>\n</details></li>\n</ul>'
If you are using a jupyter notebook, you can run a cell like this:
>>> tree.show()
this
- is
a
- tree
See Also
Github repository
PyPI project
License
This project falls under the BSD 3-Clause License.
History
v0.0.3
- New method for
HTMLTreeMaker:*.addspan(),*.addval(). - Removed methods from
HTMLTreeMaker:*.setstyle(),*.getstyle()
v0.0.2
- New methods for
HTMLMaker:*.setrootstyle(),*.getrootstyle(),*.setrootcls(),*.getrootcls(). - Removed methods from
HTMLMaker:*.set_maincls(),*.get_maincls().
v0.0.1
- Initial release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
htmlmaster-0.0.3.tar.gz
(7.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file htmlmaster-0.0.3.tar.gz.
File metadata
- Download URL: htmlmaster-0.0.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc0929d8b8cd2cf9f4d4b3612c7b37d7f9c795b9fd242418d5f2698e10874160
|
|
| MD5 |
3e7f5850014f8d9ceb40de7806edf946
|
|
| BLAKE2b-256 |
b094fc6c1eedc8e97665ba8b0b8ff5ad6c536f8e56abe56ff837ec9e33763bdd
|
File details
Details for the file htmlmaster-0.0.3-py3-none-any.whl.
File metadata
- Download URL: htmlmaster-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889c0f38d8c903bad886bd990dedef75598b529ff8d2ef526621fb4c3e8557b8
|
|
| MD5 |
49dcf9f2c64ec9eedf6306cc3e0501d6
|
|
| BLAKE2b-256 |
c03813ad98e0f1300d32a105abef9eae0803112aaffbfaca3632173b1893e9aa
|