mirror of
https://github.com/ducaale/xh.git
synced 2025-05-05 15:32:50 +00:00
External changes: - We now print the actual reason phrase sent by the server instead of guessing it from the status code. That is, if servers reply with "200 Wonderful" instead of "200 OK" then we show that. This is especially useful for status codes that xh doesn't recognize. - Header values are now decoded as latin1, with the UTF-8 decoding also shown if applicable. - A new FAQ file with an entry that explains header value encoding. Header output now hyperlinks to this entry when relevant and if supported by the terminal. Under the hood we now color headers manually. It's still hooked up to the `.tmTheme` files but not to the `.sublime-syntax` file. This lets us highlight the latin1 header values differently. In the future we could use the same approach to optimize JSON highlighting. I'm unsure about the position of the hyperlink. Currently it's the text "UTF-8" in `<latin1 value> (UTF-8: <utf-8 value>)`. But that means it's only shown if the value can be decoded as UTF-8. An alternative is to turn the latin1 value itself into a hyperlink, but that's confusing if the value itself is already a URL (which is a common case for the `Location` header). I also don't feel that our text is quite distinct enough from the header value in the default `ansi` theme. Though the hyperlink does help to set it apart.
Syntaxes and themes used
- Sublime-HTTP
- json-kv
- Sublime Packages
- ansi-dark theme
- Solarized and Monokai are based on ansi-dark with color values taken from the pygments library
Tools used to create xh-demo.gif
- asciinema for the initial recording.
- asciinema-edit to speed up the recording.
- asciicast2gif to produce the final GIF. The default font didn't look great so I modified it to use Cascadia Mono.