on master help sign in
Add HTTP Request/Response syntax as a git submodule
commit6d5ff671e7ae97c664a406217431cfac22e8d7a5 authorKeith Hall <kingkeith+github@gmail.com> dateWed 28 Jul 2021, 23:03 (5 years ago) parentffdf349
6 files changed+98−2
.gitmodules+3 CHANGELOG.md+1 assets/syntaxes/02_Extra/http-request-response+1 doc/assets.md+5−2 tests/syntax-tests/highlighted/http-request-response/example.http+44 tests/syntax-tests/source/http-request-response/example.http+44
.gitmodules+3
@@ -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+1
@@ -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
assets/syntaxes/02_Extra/http-request-responsenew file+1

Submodule changed.

doc/assets.md+5−2
@@ -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
11111. 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
14162. 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.
26286. Add a syntax test for the new language. See [below](#Syntax-tests) for details.
2729
28307. 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
tests/syntax-tests/highlighted/http-request-response/example.httpnew file+44
@@ -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>
tests/syntax-tests/source/http-request-response/example.httpnew file+44
@@ -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>