HTML to Django Converter
Project description
HTML To Django
Converts HTML files with special attributes to Django templates.
Installation
TODO: pip install instructions
Usage
html_to_django [-h] [-r] path
path
can either be a path to a file or a folder. When a file is passed only the file itself will be converted. When a folder is passed, all files ending in .html will be replaced. This searches through the folder recursivley.
Use -r
to replace the original files, instead of creating new ones.
By default, new ones are created in place next to the existing files, with the extension .n.html
.
You can also use the html_to_django_r
command if you are unable to pass the -r
parameter
(e.g. with the Bootstrap Studio "Export Script" setting).
Attributes
To add Django template tags to your HTML files, you need to add special attributes to your HTML tags like this:
<div dj-for="user in users">
<p>{{ user.name }}</p>
</div>
This will be converted to:
{% for user in users %}
<p>{{ user.name }}</p>
{% endfor %}
A complete list of supported attributes can be found here.
Contributing
To learn how to contribute to this project, please see CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file html_to_django-0.0.1.tar.gz
.
File metadata
- Download URL: html_to_django-0.0.1.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1fb8168fe97bb73f2894707906e2ede0cb092920a79fec50af346ec7563045 |
|
MD5 | 463817f5a3c3c62b02608d913a1ae4d4 |
|
BLAKE2b-256 | d1943035024aa7031416b8706141c72b2d84f351a6f205862bb35e01f8aa4562 |
File details
Details for the file html_to_django-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: html_to_django-0.0.1-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59d72abbc4fe9a1dfa1af26a9d50c3c0b637154d011f47220f75e8310b405abf |
|
MD5 | 8291a76af115ae6bdd53e8baf6ab7113 |
|
BLAKE2b-256 | 9a813ddd600f61838e6b4c640779a3e436dc2bee41191d36ff903c454d8a92d0 |