@@ -249,6 +249,7 @@ Converting existing HTML source
249
249
-------------------------------
250
250
251
251
htmlgenerator comes with a handy commandline tool to convert existing HTML-code into htmlgenerator python objects.
252
+ In order to get all the dependencies for the tool, install it with ``` pip install htmlgenerator[all] ```
252
253
253
254
It can be used with standard input or with a list of files as arguments:
254
255
@@ -260,11 +261,19 @@ By default the generated python files are formatted with black.
260
261
Python code which has been generated from very large files, e.g. complete websites, might take multiple minutes to be formated.
261
262
In order to get unformatted but still valid python code add the flag ``` --no-formatting ``` .
262
263
This will not run black on the generated python code and therefore be very fast.
263
- In order to generate more compact code the flag ``` --compact ``` can be passed to convertfromhtml.
264
+ In order to generate more compact code the flag ``` --compact ``` can be passed to ``` convertfromhtml ``` .
264
265
This will generate the most compact python code and works with and without ``` --no-formatting ``` .
265
266
In order to get human readable code the flag ``` --compact ``` is recommended.
266
267
In order to get code fast (especially for big pages) the flag ``` --no-formatting ``` is recommended.
267
- In order to get a one-liner us ``` --compact ``` and ``` --no-formatting ``` .
268
+ In order to get a one-liner use ``` --compact ``` and ``` --no-formatting ``` .
269
+
270
+ * Notes regarding the encoding of the input file:*
271
+
272
+ In case the encoding of the input HTML source file differs from the default
273
+ encoding of the operating system, there is the flag ``` --encoding <encoding> ```
274
+ which allows to enforce the given encoding when reading the file. This is
275
+ likely the case on Windows systems. It is therefore recommended to use
276
+ ``` --encoding utf8 ``` when using ``` convertfromhtml ``` on windows.
268
277
269
278
270
279
Django integration
0 commit comments