to html for formats
Convert table into simple HTML.
Signature
> to html {flags}
Flags
--html-color, -c: change ansi colors to html colors--no-color, -n: remove all ansi colors in output--dark, -d: indicate your background color is a darker color--partial, -p: only output the html for the content itself--theme, -t {string}: the name of the theme to use (github, blulocolight, ...); case-insensitive--list, -l: produce a color table of all available themes--raw, -r: do not escape html tags
Input/output types:
| input | output |
|---|---|
| nothing | any |
| any | string |
Examples
Outputs an HTML string representing the contents of this table
> [[foo bar]; [1 2]] | to html
<html><style>body { background-color:white;color:black; }</style><body><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></body></html>Outputs an HTML string using a record of xml data
> {tag: a attributes: { style: "color: red" } content: ["hello!"] } | to xml | to html --raw
<html><style>body { background-color:white;color:black; }</style><body><a style="color: red">hello!</a></body></html>Optionally, only output the html for the content itself
> [[foo bar]; [1 2]] | to html --partial
<div style="background-color:white;color:black;"><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></div>Optionally, output the string with a dark background
> [[foo bar]; [1 2]] | to html --dark
<html><style>body { background-color:black;color:white; }</style><body><table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table></body></html>Notes
Screenshots of the themes can be browsed here: https://github.com/mbadolato/iTerm2-Color-Schemes.