35 Commits

Author SHA1 Message Date
Jan Verbeek
00bc6f2238 Decode headers as latin1/UTF-8, show real reason phrase
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.
2024-07-04 21:34:52 +02:00
John Vandenberg
cd08c47fdf Bump dependencies 2023-10-22 20:04:02 +08:00
ducaale
69d1cd590d update demo & asciicast link 2022-03-08 21:31:16 +00:00
ducaale
267f8ff275 revert back to highlighting escape chars 2021-12-02 15:14:36 +02:00
ducaale
fadc07030b don't highlight escape char with a different color 2021-12-01 19:45:20 +02:00
ducaale
f212bb2627 Add fruity theme 2021-12-01 19:43:54 +02:00
ducaale
66399f2883 seperators should be separators 2021-09-10 23:25:50 +03:00
ducaale
d807b3d3d0 add symlinked man-page for xhs 2021-09-06 23:40:57 +03:00
ducaale
a56fccc24c remove the dummy xh file 2021-09-06 23:25:34 +03:00
ducaale
f8e14a6c9b create xhs symlink in advance 2021-09-06 19:45:12 +03:00
ducaale
432715c936 link to the origin of Monokai and Solarized themes 2021-06-20 00:52:34 +03:00
ducaale
64f366663f Add monokai theme 2021-06-19 20:58:37 +03:00
ducaale
c6c6832c13 document how the demo.gif was created
Unfortunately, I don't remember the exact commands but this should
suffice
2021-05-14 00:23:59 +01:00
Shun Sakai
6b9c4ca35e Add the timeout flag 2021-04-23 19:16:00 +09:00
Jan Verbeek
28097a7798 Escape backslash in JSON highlighting definition 2021-03-17 16:38:34 +01:00
Jan Verbeek
0d784bd6ea Split small syntax definitions into separate file 2021-03-09 19:11:33 +01:00
Jan Verbeek
3c7cfa0f1b Remove unused HTTP highlighting rules
We know things like comments, curl, and JSON and XML won't occur.
2021-03-09 18:08:18 +01:00
Jan Verbeek
e5b5d4d2bc Highlight empty-valued HTTP headers correctly
The whole next header would be highlighted as if it were this header's value.
2021-03-09 18:07:20 +01:00
ducaale
09f4496d18 move syntaxes and themes credit to assets folder 2021-03-04 23:02:20 +00:00
Jan Verbeek
e9ce704305 Support non-standard HTTP methods 2021-03-04 21:33:38 +01:00
ducaale
47de789db2 update demo & asciicast link 2021-02-12 08:01:29 +00:00
ducaale
535959c75e rename project to ht 2020-12-31 22:32:07 +03:00
ducaale
9f8bc72523 combine demo gifs 2020-12-29 23:40:32 +03:00
ducaale
5a100d3784 add a second gif 2020-12-26 19:22:02 +03:00
ducaale
e247f19a0c replace svg demo with gif 2020-12-25 00:21:33 +03:00
ducaale
0e87db68ff turn screencast demo into svg 2020-12-19 09:48:48 +00:00
ducaale
16aaa99e93 fix json keys coloring 2020-11-22 21:03:18 +00:00
ducaale
cb5f215b70 add solarized colorscheme 2020-09-30 23:21:20 +01:00
ducaale
19e7b8b44e style doctype with different color 2020-09-28 21:38:04 +01:00
ducaale
2c22952a53 simplify theme file
this way, it will be easier to import more themes
2020-09-27 21:26:22 +01:00
ducaale
804d75adf5 correct comments 2020-09-25 23:28:40 +01:00
ducaale
eb71b25f39 match httpie color for numbers, bool and null 2020-09-25 23:27:24 +01:00
ducaale
5ab66694c4 conditional coloring for headers and underline for http url 2020-09-25 23:14:33 +01:00
ducaale
9b40d3114d copy httpie theme 2020-09-23 20:28:56 +01:00
ducaale
c5a92a78c9 highlight syntax using syntect 2020-09-21 22:14:13 +01:00