Skip to content

Commit 4ded2cf

Browse files
committed
add: Notes about the new flag
1 parent 3051b48 commit 4ded2cf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ Converting existing HTML source
249249
-------------------------------
250250

251251
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]```
252253

253254
It can be used with standard input or with a list of files as arguments:
254255

@@ -260,11 +261,19 @@ By default the generated python files are formatted with black.
260261
Python code which has been generated from very large files, e.g. complete websites, might take multiple minutes to be formated.
261262
In order to get unformatted but still valid python code add the flag ```--no-formatting```.
262263
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```.
264265
This will generate the most compact python code and works with and without ```--no-formatting```.
265266
In order to get human readable code the flag ```--compact``` is recommended.
266267
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.
268277

269278

270279
Django integration

0 commit comments

Comments
 (0)