Command line

The turbohtml console script (also python -m turbohtml) is a thin front end over the public API: every subcommand reads one input and writes one output, delegating to the matching function. The reference below is generated from the argparse parser, so it lists every subcommand and flag exactly as the command exposes them and cannot drift from the code. For the subcommand-to-API mapping and pipeline examples, see Run turbohtml from a shell.

turbohtml

Command-line front end for turbohtml.

turbohtml [-h] {minify,minify-css,minify-js,detect,to-markdown,to-text,sanitize} ...

turbohtml options

  • -h, --help - show this help message and exit

turbohtml minify

minify an HTML document

turbohtml minify [-h] [-o FILE] [--minify-css] [file]

turbohtml minify positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml minify options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

  • --minify-css - also minify <style> bodies and style attributes

turbohtml minify-css

minify a CSS stylesheet

turbohtml minify-css [-h] [-o FILE] [file]

turbohtml minify-css positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml minify-css options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

turbohtml minify-js

minify a JavaScript source

turbohtml minify-js [-h] [-o FILE] [file]

turbohtml minify-js positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml minify-js options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

turbohtml detect

report the character encoding of bytes

turbohtml detect [-h] [-o FILE] [file]

turbohtml detect positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml detect options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

turbohtml to-markdown

render HTML as Markdown

turbohtml to-markdown [-h] [-o FILE] [file]

turbohtml to-markdown positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml to-markdown options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

turbohtml to-text

render HTML as layout-aware plain text

turbohtml to-text [-h] [-o FILE] [file]

turbohtml to-text positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml to-text options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout

turbohtml sanitize

sanitize HTML against the default policy

turbohtml sanitize [-h] [-o FILE] [file]

turbohtml sanitize positional arguments

  • file - input file; omit or pass - to read stdin

turbohtml sanitize options

  • -h, --help - show this help message and exit

  • -o FILE, --output FILE - write to this file instead of stdout