You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe you already have a bunch of HTML, or templates that you would like to migrate to htpy.
4
-
We got you covered. The utility command `html2htpy` ships with `htpy`, and can be used to transform existing
5
-
html into Python code (htpy!).
3
+
Maybe you already have a bunch of HTML, or templates that you would like to migrate to htpy. We got you covered. This page describes how you can convert existing HTML to htpy code.
If you prefer the explicit `id="id", class_="class"` kwargs syntax over the default htpy shorthand `#id.class` syntax, you can get it by passing the `--no-shorthand` flag.
Note that other typical template syntax, such as loops `{% for x in y %}`, can not be transformed this way,
106
+
Other typical template syntax, such as loops `{% for x in y %}`, can not be transformed this way,
169
107
so you will often have to clean up a bit after `html2htpy` is done with its thing.
170
108
171
109
See the example below:
@@ -202,4 +140,4 @@ body[
202
140
203
141
## VSCode Extension
204
142
205
-
If you are using VSCode, you can install the [html2htpy](https://marketplace.visualstudio.com/items?itemName=dunderrrrrr.html2htpy) extension to quickly convert HTML to htpy code.
143
+
If you are using VSCode, you can install the [html2htpy](https://marketplace.visualstudio.com/items?itemName=dunderrrrrr.html2htpy) extension to quickly convert HTML to htpy code.
0 commit comments