mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-07 08:24:21 +01:00
Add HTTP Request/Response syntax as a git submodule
This commit is contained in:
parent
ffdf349a96
commit
6d5ff671e7
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -221,3 +221,6 @@
|
||||
[submodule "assets/syntaxes/02_Extra/Groff"]
|
||||
path = assets/syntaxes/02_Extra/Groff
|
||||
url = https://github.com/carsonoid/sublime_man_page_support
|
||||
[submodule "assets/syntaxes/02_Extra/http-request-response"]
|
||||
path = assets/syntaxes/02_Extra/http-request-response
|
||||
url = https://github.com/keith-hall/http-request-response-syntax.git
|
||||
|
@ -15,6 +15,7 @@
|
||||
## Syntaxes
|
||||
|
||||
- Groff, see #1685 (@scop)
|
||||
- HTTP Requests and Responses, see #1748 (@keith-hall)
|
||||
|
||||
## New themes
|
||||
|
||||
|
1
assets/syntaxes/02_Extra/http-request-response
vendored
Submodule
1
assets/syntaxes/02_Extra/http-request-response
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f58bffe48314f1ef350f555649e08445a23edf4c
|
@ -9,7 +9,9 @@ in the `.sublime-syntax` format.
|
||||
**Important:** Before proceeding, verify that the syntax you wish to add meets the [criteria for inclusion](#Criteria-for-inclusion-of-new-syntaxes).
|
||||
|
||||
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
|
||||
which can be included as a submodule (under `assets/syntaxes`).
|
||||
which can be included as a submodule (under `assets/syntaxes`) using
|
||||
`git submodule add <https github link> ./assets/syntaxes/02_Extra/<repo name>`, replacing
|
||||
the contents of the angle brackets as appropriate.
|
||||
|
||||
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
|
||||
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
||||
@ -26,7 +28,8 @@ in the `.sublime-syntax` format.
|
||||
6. Add a syntax test for the new language. See [below](#Syntax-tests) for details.
|
||||
|
||||
7. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
|
||||
file. A new binary cache file will be created once before every new release of `bat`.
|
||||
file. A new binary cache file will be created once before every new release of `bat`. This
|
||||
avoids bloating the repository size unnecessarily.
|
||||
|
||||
### Syntax tests
|
||||
|
||||
|
44
tests/syntax-tests/highlighted/http-request-response/example.http
vendored
Normal file
44
tests/syntax-tests/highlighted/http-request-response/example.http
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
[38;2;249;38;114mPOST[0m[38;2;248;248;242m [0m[38;2;248;248;242m/[0m[38;2;248;248;242mfoo[0m[38;2;248;248;242m/[0m[38;2;248;248;242mbar[0m[38;2;248;248;242m?[0m[3;38;2;253;151;31mid[0m[38;2;249;38;114m=[0m[38;2;230;219;116m4[0m[38;2;249;38;114m&[0m[3;38;2;253;151;31mx[0m[38;2;249;38;114m=[0m[38;2;230;219;116my[0m[38;2;190;132;255m%[0m[38;2;190;132;255m20[0m[38;2;230;219;116mz[0m[38;2;248;248;242m [0m[38;2;190;132;255mHTTP/1.1[0m
|
||||
[38;2;249;38;114mX-Forwarded-For[0m[38;2;230;219;116m:[0m[38;2;230;219;116m 127.0.0.1[0m
|
||||
[38;2;249;38;114mContent-Length[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m124[0m
|
||||
[38;2;249;38;114mCache-Control[0m[38;2;230;219;116m:[0m[38;2;230;219;116m no-cache[0m
|
||||
[38;2;249;38;114mX-Forwarded-Proto[0m[38;2;230;219;116m:[0m[38;2;230;219;116m https[0m
|
||||
[38;2;249;38;114mContent-Type[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mapplication/json[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mcharset[0m[38;2;249;38;114m=[0m[38;2;230;219;116mutf-8[0m
|
||||
[38;2;249;38;114mHost[0m[38;2;230;219;116m:[0m[38;2;230;219;116m example.com[0m
|
||||
[38;2;249;38;114mAccept[0m[38;2;230;219;116m:[0m[38;2;230;219;116m */*[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mq[0m[38;2;249;38;114m=[0m[38;2;230;219;116m0.5[0m[38;2;230;219;116m,[0m[38;2;230;219;116m application/xml[0m
|
||||
[38;2;249;38;114mAccept-Encoding[0m[38;2;230;219;116m:[0m[38;2;230;219;116m gzip[0m
|
||||
|
||||
[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mid[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mblahblahblahblah[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mobject[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mevent[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mapi_version[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m2020-03-02[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mcreated[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m1626790174[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mdata[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242m}[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
|
||||
[38;2;190;132;255mHTTP/1.1[0m[38;2;248;248;242m [0m[38;2;190;132;255m200[0m[38;2;248;248;242m [0m[38;2;230;219;116mOK[0m
|
||||
[38;2;249;38;114mServer[0m[38;2;230;219;116m:[0m[38;2;230;219;116m nginx[0m
|
||||
[38;2;249;38;114mDate[0m[38;2;230;219;116m:[0m[38;2;230;219;116m Fri[0m[38;2;230;219;116m,[0m[38;2;230;219;116m 23 Jul 2021 10:15:12 GMT[0m
|
||||
[38;2;249;38;114mContent-Type[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mtext/html[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mcharset[0m[38;2;249;38;114m=[0m[38;2;230;219;116mutf-8[0m
|
||||
[38;2;249;38;114mTransfer-Encoding[0m[38;2;230;219;116m:[0m[38;2;230;219;116m chunked[0m
|
||||
[38;2;249;38;114mConnection[0m[38;2;230;219;116m:[0m[38;2;230;219;116m keep-alive[0m
|
||||
[38;2;249;38;114mVary[0m[38;2;230;219;116m:[0m[38;2;230;219;116m Accept-Encoding[0m
|
||||
[38;2;249;38;114mCache-Control[0m[38;2;230;219;116m:[0m[38;2;230;219;116m private[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmax-age[0m[38;2;249;38;114m=[0m[38;2;190;132;255m0[0m
|
||||
[38;2;249;38;114mX-Frame-Options[0m[38;2;230;219;116m:[0m[38;2;230;219;116m DENY[0m
|
||||
[38;2;249;38;114mX-Content-Type-Options[0m[38;2;230;219;116m:[0m[38;2;230;219;116m nosniff[0m
|
||||
[38;2;249;38;114mX-XSS-Protection[0m[38;2;230;219;116m:[0m[38;2;230;219;116m 1[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmode[0m[38;2;249;38;114m=[0m[38;2;230;219;116mblock[0m
|
||||
[38;2;249;38;114mReferrer-Policy[0m[38;2;230;219;116m:[0m[38;2;230;219;116m origin[0m
|
||||
[38;2;249;38;114mStrict-Transport-Security[0m[38;2;230;219;116m:[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmax-age[0m[38;2;249;38;114m=[0m[38;2;190;132;255m31556900[0m
|
||||
|
||||
[38;2;255;255;255m<![0m[38;2;249;38;114mDOCTYPE[0m[38;2;248;248;242m [0m[38;2;190;132;255mhtml[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255m<[0m[38;2;249;38;114mmeta[0m[38;2;166;226;46m [0m[38;2;166;226;46mcharset[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mutf-8[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255m<[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m[38;2;248;248;242mHello World[0m[38;2;255;255;255m</[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m
|
44
tests/syntax-tests/source/http-request-response/example.http
vendored
Normal file
44
tests/syntax-tests/source/http-request-response/example.http
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
POST /foo/bar?id=4&x=y%20z HTTP/1.1
|
||||
X-Forwarded-For: 127.0.0.1
|
||||
Content-Length: 124
|
||||
Cache-Control: no-cache
|
||||
X-Forwarded-Proto: https
|
||||
Content-Type: application/json; charset=utf-8
|
||||
Host: example.com
|
||||
Accept: */*; q=0.5, application/xml
|
||||
Accept-Encoding: gzip
|
||||
|
||||
{
|
||||
"id": "blahblahblahblah",
|
||||
"object": "event",
|
||||
"api_version": "2020-03-02",
|
||||
"created": 1626790174,
|
||||
"data": {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Fri, 23 Jul 2021 10:15:12 GMT
|
||||
Content-Type: text/html; charset=utf-8
|
||||
Transfer-Encoding: chunked
|
||||
Connection: keep-alive
|
||||
Vary: Accept-Encoding
|
||||
Cache-Control: private; max-age=0
|
||||
X-Frame-Options: DENY
|
||||
X-Content-Type-Options: nosniff
|
||||
X-XSS-Protection: 1; mode=block
|
||||
Referrer-Policy: origin
|
||||
Strict-Transport-Security: max-age=31556900
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hello World</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user