Skip to content

Commit e5217b5

Browse files
committed
use curl for beter code show
1 parent ddfc52b commit e5217b5

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

docs/addons/jwt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class LoginController extends BaseController
234234

235235
You could send a request with the existing user's credentials by curl like this:
236236

237-
```console
237+
```curl
238238
curl --location 'http://localhost:8080/auth/jwt' \
239239
--header 'Content-Type: application/json' \
240240
--data-raw '{"email" : "admin@example.jp" , "password" : "passw0rd!"}'
@@ -245,7 +245,7 @@ the `Authorization` header as a `Bearer` token.
245245

246246
You could send a request with the `Authorization` header by curl like this:
247247

248-
```console
248+
```curl
249249
curl --location --request GET 'http://localhost:8080/api/users' \
250250
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTaGllbGQgVGVzdCBBcHAiLCJzdWIiOiIxIiwiaWF0IjoxNjgxODA1OTMwLCJleHAiOjE2ODE4MDk1MzB9.DGpOmRPOBe45whVtEOSt53qJTw_CpH0V8oMoI_gm2XI'
251251
```

docs/assets/js/curl.min.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*! `curl` grammar compiled for Highlight.js 11.3.1 */
2+
(()=>{var e=(()=>{"use strict";return e=>{const n={className:"string",begin:/"/,
3+
end:/"/,contains:[e.BACKSLASH_ESCAPE,{className:"variable",begin:/\$\(/,
4+
end:/\)/,contains:[e.BACKSLASH_ESCAPE]}],relevance:0},a={className:"number",
5+
variants:[{begin:e.C_NUMBER_RE}],relevance:0};return{name:"curl",
6+
aliases:["curl"],keywords:"curl",case_insensitive:!0,contains:[{
7+
className:"literal",begin:/(--request|-X)\s/,contains:[{className:"symbol",
8+
begin:/(get|post|delete|options|head|put|patch|trace|connect)/,end:/\s/,
9+
returnEnd:!0}],returnEnd:!0,relevance:10},{className:"literal",begin:/--/,
10+
end:/[\s"]/,returnEnd:!0,relevance:0},{className:"literal",begin:/-\w/,
11+
end:/[\s"]/,returnEnd:!0,relevance:0},n,{className:"string",begin:/\\"/,
12+
relevance:0},{className:"string",begin:/'/,end:/'/,relevance:0
13+
},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,{match:/(\/[a-z._-]+)+/}]}}})()
14+
;hljs.registerLanguage("curl",e)})();

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extra_css:
7474
extra_javascript:
7575
- https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.6.0/build/highlight.min.js
7676
- assets/js/hljs.js
77+
- assets/js/curl.min.js
7778

7879
nav:
7980
- Home: index.md

0 commit comments

Comments
 (0)