Skip to main content

Split HTML into threads. Weave them back together.

Project description

๐Ÿงต htmlweaver

Split HTML into threads. Weave them back together.

A simple CLI tool that splits AI-generated HTML files into clean, separate HTML, CSS, and JavaScript files โ€” and exports them as Vue or React components.


โœจ Features

  • ๐Ÿ”ช Split โ€” Break a single HTML file into .html, .css, and .js
  • ๐Ÿงฉ Combine โ€” Merge separate files back into one HTML file
  • โšก Vue Export โ€” Convert HTML into a Vue Single File Component .vue
  • โš›๏ธ React Export โ€” Convert HTML into a React functional component .jsx

๐Ÿ“ฆ Installation

pip install htmlweaver

๐Ÿš€ Usage

Split

htmlweaver split --html mypage.html --output ./output

Output:

output/
โ”œโ”€โ”€ mypage.html
โ”œโ”€โ”€ mypage.css
โ””โ”€โ”€ mypage.js

Combine

htmlweaver combine --html ./output/mypage.html \
                   --css ./output/mypage.css \
                   --js ./output/mypage.js \
                   --output ./output/mypage_final.html

Export to Vue

htmlweaver export --html mypage.html --format vue --output ./output

Output:

output/
โ””โ”€โ”€ Mypage.vue

Export to React

htmlweaver export --html mypage.html --format react --output ./output

Output:

output/
โ”œโ”€โ”€ Mypage.jsx
โ””โ”€โ”€ Mypage.css

๐Ÿ—‚๏ธ Project Structure

htmlweaver/
โ”œโ”€โ”€ htmlweaver/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ cli.py
โ”‚   โ”œโ”€โ”€ splitter.py
โ”‚   โ”œโ”€โ”€ combiner.py
โ”‚   โ”œโ”€โ”€ utils.py
โ”‚   โ””โ”€โ”€ exporters/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ vue_exporter.py
โ”‚       โ””โ”€โ”€ react_exporter.py
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

๐Ÿ›ฃ๏ธ Roadmap

  • Split HTML into separate files
  • Combine files back into HTML
  • Export as Vue component
  • Export as React component
  • --watch mode for auto-split on save
  • TypeScript / TSX support
  • SCSS export
  • Angular component export
  • VS Code Extension
  • AI-powered smart component splitting
  • Web app at htmlweaver.io

๐Ÿค Contributing

Contributions are welcome!
Feel free to open an issue or submit a pull request.


๐Ÿ“„ License

MIT ยฉ abutlb

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

htmlweaver-1.0.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

htmlweaver-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file htmlweaver-1.0.0.tar.gz.

File metadata

  • Download URL: htmlweaver-1.0.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for htmlweaver-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b61e2a39a5393fe24a2c8b50eca2d970edc4970e5f8b999c931c61e26ace04db
MD5 7e778290125775d212a601f8c4dd77ce
BLAKE2b-256 ef65df4fbed5cefe1f98f7221067150f6e009b51a7c429f2e49b1220e2999a26

See more details on using hashes here.

File details

Details for the file htmlweaver-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: htmlweaver-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for htmlweaver-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36e583feb77d257fdbfc8a8ee6e77fd8cde940a8e822ce137f53dcfb23620078
MD5 7193a103580cb5e34359ce0fea8289eb
BLAKE2b-256 e31b569fd39c99440e0c7c16923371e4305c8a2723ac458ad6f651eff84b81b6

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