Skip to main content

Provides tools for managing config files.

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.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.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htmlmaster-0.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file htmlmaster-0.0.2.tar.gz.

File metadata

  • Download URL: htmlmaster-0.0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for htmlmaster-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0a70712bccb55ebe2f1d02acc4ac49734b8e9ad7a3c4e89938251089b9003cd6
MD5 254e017b39201d9f72fa14ede0b73293
BLAKE2b-256 3133dfec8bdbbfec14aaf0980f10b3cb9530fbedd16a4d5c99385c1aff2b0ddb

See more details on using hashes here.

File details

Details for the file htmlmaster-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: htmlmaster-0.0.2-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

Hashes for htmlmaster-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 540eb2043eb7d251dda72f3baafa4452e513b41241beb7b46b43b4e41f10f40c
MD5 76e2df789db040308ee0ef142aa4c479
BLAKE2b-256 43c5bb90f501806432ad10822ae3b29e7c2923d0a895be6b8efeefd42b3569b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page