Skip to content

Commit 6d5ff67

Browse files
keith-hallsharkdp
authored andcommitted
Add HTTP Request/Response syntax as a git submodule
1 parent ffdf349 commit 6d5ff67

File tree

6 files changed

+98
-2
lines changed

6 files changed

+98
-2
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,6 @@
221221
[submodule "assets/syntaxes/02_Extra/Groff"]
222222
path = assets/syntaxes/02_Extra/Groff
223223
url = https://github.com/carsonoid/sublime_man_page_support
224+
[submodule "assets/syntaxes/02_Extra/http-request-response"]
225+
path = assets/syntaxes/02_Extra/http-request-response
226+
url = https://github.com/keith-hall/http-request-response-syntax.git

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
## Syntaxes
1616

1717
- Groff, see #1685 (@scop)
18+
- HTTP Requests and Responses, see #1748 (@keith-hall)
1819

1920
## New themes
2021

Submodule http-request-response added at f58bffe

doc/assets.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ in the `.sublime-syntax` format.
99
**Important:** Before proceeding, verify that the syntax you wish to add meets the [criteria for inclusion](#Criteria-for-inclusion-of-new-syntaxes).
1010

1111
1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
12-
which can be included as a submodule (under `assets/syntaxes`).
12+
which can be included as a submodule (under `assets/syntaxes`) using
13+
`git submodule add <https github link> ./assets/syntaxes/02_Extra/<repo name>`, replacing
14+
the contents of the angle brackets as appropriate.
1315

1416
2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
1517
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
@@ -26,7 +28,8 @@ in the `.sublime-syntax` format.
2628
6. Add a syntax test for the new language. See [below](#Syntax-tests) for details.
2729

2830
7. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
29-
file. A new binary cache file will be created once before every new release of `bat`.
31+
file. A new binary cache file will be created once before every new release of `bat`. This
32+
avoids bloating the repository size unnecessarily.
3033

3134
### Syntax tests
3235

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
POST /foo/bar?id=4&x=y%20z HTTP/1.1
2+
X-Forwarded-For: 127.0.0.1
3+
Content-Length: 124
4+
Cache-Control: no-cache
5+
X-Forwarded-Proto: https
6+
Content-Type: application/json; charset=utf-8
7+
Host: example.com
8+
Accept: */*; q=0.5, application/xml
9+
Accept-Encoding: gzip
10+
11+
{
12+
 "id": "blahblahblahblah",
13+
 "object": "event",
14+
 "api_version": "2020-03-02",
15+
 "created": 1626790174,
16+
 "data": {
17+
 }
18+
}
19+
20+
21+
HTTP/1.1 200 OK
22+
Server: nginx
23+
Date: Fri, 23 Jul 2021 10:15:12 GMT
24+
Content-Type: text/html; charset=utf-8
25+
Transfer-Encoding: chunked
26+
Connection: keep-alive
27+
Vary: Accept-Encoding
28+
Cache-Control: private; max-age=0
29+
X-Frame-Options: DENY
30+
X-Content-Type-Options: nosniff
31+
X-XSS-Protection: 1; mode=block
32+
Referrer-Policy: origin
33+
Strict-Transport-Security: max-age=31556900
34+
35+
<!DOCTYPE html>
36+
<html>
37+
<head>
38+
 <meta charset="utf-8">
39+
 <title>Hello World</title>
40+
</head>
41+
<body>
42+
43+
</body>
44+
</html>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
POST /foo/bar?id=4&x=y%20z HTTP/1.1
2+
X-Forwarded-For: 127.0.0.1
3+
Content-Length: 124
4+
Cache-Control: no-cache
5+
X-Forwarded-Proto: https
6+
Content-Type: application/json; charset=utf-8
7+
Host: example.com
8+
Accept: */*; q=0.5, application/xml
9+
Accept-Encoding: gzip
10+
11+
{
12+
"id": "blahblahblahblah",
13+
"object": "event",
14+
"api_version": "2020-03-02",
15+
"created": 1626790174,
16+
"data": {
17+
}
18+
}
19+
20+
21+
HTTP/1.1 200 OK
22+
Server: nginx
23+
Date: Fri, 23 Jul 2021 10:15:12 GMT
24+
Content-Type: text/html; charset=utf-8
25+
Transfer-Encoding: chunked
26+
Connection: keep-alive
27+
Vary: Accept-Encoding
28+
Cache-Control: private; max-age=0
29+
X-Frame-Options: DENY
30+
X-Content-Type-Options: nosniff
31+
X-XSS-Protection: 1; mode=block
32+
Referrer-Policy: origin
33+
Strict-Transport-Security: max-age=31556900
34+
35+
<!DOCTYPE html>
36+
<html>
37+
<head>
38+
<meta charset="utf-8">
39+
<title>Hello World</title>
40+
</head>
41+
<body>
42+
43+
</body>
44+
</html>

0 commit comments

Comments
 (0)