{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/terminal-to-html/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/terminal-to-html/", "feed_url": "https://matoken.org/blog/tag/terminal-to-html/feed/json/", "language": "ja", "title": "terminal-to-html – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "https://matoken.org/blog/?p=4170", "url": "https://matoken.org/blog/2024/10/22/convert-terminal-results-to-html-with-terminal-to-html-command/", "title": "terminal-to-html\u30b3\u30de\u30f3\u30c9\u3067\u7aef\u672b\u306e\u7d50\u679c\u3092HTML\u306b\u5909\u63db\u3059\u308b", "content_html": "
\n\u5148\u65e5 aha \u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u3092\u8a66\u3057\u307e\u3057\u305f\u304c\uff0c\u4eca\u56de terminal-to-html \u3068\u3044\u3046\u4f3c\u305f\u30b3\u30de\u30f3\u30c9\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
\n
$ go install github.com/buildkite/terminal-to-html/v3/cmd/terminal-to-html@latest\n$ which terminal-to-html\n/home/matoken/go/bin/terminal-to-html\n$ terminal-to-html --help\nterminal-to-html - turn ANSI in to HTML\n\nSTDIN/STDOUT USAGE:\n cat input.raw | terminal-to-html [arguments...] > out.html\n\nWEBSERVICE USAGE:\n terminal-to-html --http :6060 &\n curl --data-binary \"@input.raw\" http://localhost:6060/terminal > out.html\n\nOPTIONS:\n --http value HTTP service mode (eg --http :6060), endpoint is /terminal\n --preview wrap output in HTML & CSS so it can be easily viewed directly in a browser (default: false)\n --log-stats-to-stderr Logs a JSON object to stderr containing resource and processing statistics after successfully processing (default: false)\n --buffer-max-lines value Sets a limit on the number of lines to hold in the screen buffer (and also limits the possible window height), allowing the renderer to operate in a streaming fashion and enabling the processing of large inputs. Setting to 0 disables the limit, causing the renderer to buffer the entire screen before producing any output (default: 300)\n --window-max-cols value Sets an upper bound on the window width (which may change based on input). Window size mainly affects cursor movement sequences (default: 400)\n --window-cols value Sets the initial window width. Window size mainly affects cursor movement sequences (default: 160)\n --window-lines value Sets the initial window height. Window size mainly affects cursor movement sequences (default: 100)\n --help, -h show help\n --version, -v print the version\n
\u65e9\u901f\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\uff0e\u65e2\u5b9a\u5024\u3067\u306f\u30d8\u30c3\u30c0\u30fc\u3084\u30d5\u30c3\u30bf\u30fc\u306f\u4ed8\u304b\u306a\u3044\u3088\u3046\u3067\u3059\uff0e
\n$ cowsay hello terminal | terminal-to-html\n ________________\n< hello terminal >\n ----------------\n \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n
\u6b21\u306b --preview option \u3092\u8a66\u3057\u307e\u3059\uff0eHTML \u3068 CSS \u3067\u30e9\u30c3\u30d7\u3057\u3066\u304f\u308c\u307e\u3059\uff0eaha \u30b3\u30de\u30f3\u30c9\u3067\u306f\u8868\u73fe\u3055\u308c\u306a\u304b\u3063\u305f cow \u306e\u3057\u3063\u307d\u306e\u70b9\u6ec5\u3082\u518d\u73fe\u3067\u304d\u3066\u3044\u307e\u3059\uff0e
\n\u3057\u304b\u3057\u3053\u3053\u306b HTML \u3092\u8cbc\u308a\u4ed8\u3051\u305f\u3089 WprdPress \u3068\u5e72\u6e09\u3057\u3066\u8272\u30b3\u30fc\u30c9\u304c\u4e0b\u90e8\u306e\u30bf\u30b0\u306b\u306a\u3063\u305f\u308a\u6539\u884c\u304c\u5165\u3063\u3066\u3057\u307e\u3063\u305f\u308a\u3068\u3072\u3069\u3044\u3053\u3068\u306b\u306a\u3063\u305f\u306e\u3067\u3068\u308a\u3042\u3048\u305a\u9759\u6b62\u753b\u3067\u3059\uff0e\u3061\u306a\u307f\u306b Asciidoctor Reveal.js \u3078\u306f\u7dba\u9e97\u306b\u8cbc\u308a\u4ed8\u3051\u3067\u304d\u307e\u3057\u305f\uff0e
$ unbuffer apt moo moo | terminal-to-html --preview | xsel\n
\u6b21\u306b\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\uff0ehttp \u7d4c\u7531\u3067\u5909\u63db\u304c\u3067\u304d\u307e\u3059\uff0e
\n$ terminal-to-html --http :6060 &\n$ cowsay hello > input.raw\n$ curl --data-binary \"@input.raw\" http://localhost:6060/terminal\n _______\n< hello >\n -------\n \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n$ kill %1\n$ terminal-to-html --preview --http :6060 &\n$ curl --data-binary \"@input.raw\" http://localhost:6060/terminal | head\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\n1<!DOCTYPE html>\n0<html>\n1 <head>\n5 <meta charset=\"UTF-8\">\n6 <title>terminal-to-html Preview</title>\n <style>.term-container {\n background: #171717;\n1 border-radius: 5px;\n0 color: white;\n0 10005 100 151 6211k 95994 --:--:-- --:--:-- --:--:-- 9917k\ncurl: Failed writing body\naha \u306e\u65b9\u304c HTML \u5909\u63db\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u591a\u3044\u3051\u3069\uff0cterminal-to-html \u306f http server \u6628\u65e5\u304c\u5408\u3063\u305f\u308a\u3068\u30e6\u30cb\u30fc\u30af\u306a\u90e8\u5206\u3082\uff0e\u597d\u307f\u3067\u4f7f\u3044\u5206\u3051\u308b\u3068\u826f\u3055\u305d\u3046\u3067\u3059\uff0e
\n$ terminal-to-html --version\nterminal-to-html version 3.16.3\n$ dpkg-query -W golang curl\ncurl 8.10.1-2\ngolang:amd64 2:1.23~2\n$ lsb_release -dr\nDescription: Debian GNU/Linux trixie/sid\nRelease: n/a\n$ arch\nx86_64\n