Skip to content

Commit d061bc4

Browse files
committed
Separate languages into their own data files.
1 parent b31f002 commit d061bc4

36 files changed

+2259
-2194
lines changed

Gruntfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const extensionManifest = require('./manifest.json');
2+
const getLanguages =
3+
require('./views/website/libraries/support/get-languages.js');
24

35
module.exports = grunt => {
46
grunt.loadNpmTasks('grunt-contrib-copy');
@@ -111,7 +113,7 @@ module.exports = grunt => {
111113
options: {
112114
//pretty: true,
113115
data: {
114-
languages: require('./views/website/libraries/data.json')
116+
languages: getLanguages()
115117
}
116118
},
117119
files: {

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
[![Build Status](https://travis-ci.org/jsonwebtoken/jsonwebtoken.github.io.png?branch=master)](https://travis-ci.org/jsonwebtoken/jsonwebtoken.github.io)
66

77
### How to add a library
8-
To add a library, simply edit the `data.json` file located at `views/website/libraries`.
8+
To add a library, simply edit the right JSON file located at `views/website/libraries`. Each language gets its own file. Multiple libraries share the same language file.
99

10-
If you add a new language, you will need to provide a proper icon for it and place it in the `img` folder.
10+
To add a new language, simply add a JSON file in the same folder as the others. It will get automatically recognized. If you add a new language, you will need to provide a proper icon for it and place it in the `img` folder.
1111

12-
Here's a commented example of a language + library definition. All fields must have valid values unless noted:
12+
Here's a commented example of the .NET language file (`0-.NET.json`). All fields must have valid values unless noted:
1313

1414
```javascript
15-
// Language name (unique)
16-
".NET": {
15+
{
16+
// Language name (unique)
17+
"name": ".NET",
1718

1819
// Unique identifier that will be used as a CSS class
1920
// for this language (only valid CSS class names).

views/website/libraries.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ section#libraries-io.libraries-jwt
2323
path(d='M16 10v28l22-14z')
2424

2525
.libraries-sv(data-accordion-group)
26-
each lang, langName in languages
26+
each lang in languages
2727
each lib in lang.libs
2828
include libraries/template.pug

views/website/libraries/0-.NET.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": ".NET",
3+
"uniqueClass": "net",
4+
"image": "/img/1.svg",
5+
"bgColor": "rgb(42, 168, 229)",
6+
"libs": [
7+
{
8+
"minimumVersion": null,
9+
"support": {
10+
"sign": true,
11+
"verify": true,
12+
"iss": true,
13+
"sub": true,
14+
"aud": true,
15+
"exp": true,
16+
"nbf": true,
17+
"iat": true,
18+
"jti": true,
19+
"hs256": true,
20+
"hs384": true,
21+
"hs512": true,
22+
"rs256": true,
23+
"rs384": true,
24+
"rs512": true,
25+
"es256": true,
26+
"es384": true,
27+
"es512": true
28+
},
29+
"authorUrl": "https://www.microsoft.com",
30+
"authorName": "Microsoft",
31+
"gitHubRepoPath": "AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet",
32+
"repoUrl": "https://github.com/MSOpenTech/azure-activedirectory-identitymodel-extensions-for-dotnet",
33+
"installCommandHtml": "Install-Package<br><a href=\"https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/\">System.IdentityModel.Tokens.Jwt</a>"
34+
},
35+
{
36+
"minimumVersion": null,
37+
"support": {
38+
"sign": true,
39+
"verify": true,
40+
"iss": false,
41+
"sub": false,
42+
"aud": false,
43+
"exp": false,
44+
"nbf": false,
45+
"iat": false,
46+
"jti": false,
47+
"hs256": true,
48+
"hs384": true,
49+
"hs512": true,
50+
"rs256": true,
51+
"rs384": true,
52+
"rs512": true,
53+
"es256": true,
54+
"es384": true,
55+
"es512": true
56+
},
57+
"authorUrl": "https://github.com/dvsekhvalnov/jose-jwt",
58+
"authorName": "DV",
59+
"gitHubRepoPath": "dvsekhvalnov/jose-jwt",
60+
"repoUrl": "https://github.com/dvsekhvalnov/jose-jwt",
61+
"installCommandHtml": "Install-Package<br><a href=\"http://www.nuget.org/packages/jose-jwt/\">jose-jwt</a>"
62+
},
63+
{
64+
"minimumVersion": null,
65+
"support": {
66+
"sign": true,
67+
"verify": true,
68+
"iss": false,
69+
"sub": false,
70+
"aud": false,
71+
"exp": false,
72+
"nbf": false,
73+
"iat": false,
74+
"jti": false,
75+
"hs256": true,
76+
"hs384": true,
77+
"hs512": true,
78+
"rs256": true,
79+
"rs384": true,
80+
"rs512": true,
81+
"es256": true,
82+
"es384": true,
83+
"es512": true
84+
},
85+
"authorUrl": "https://github.com/dvsekhvalnov/jose-rt",
86+
"authorName": "DV",
87+
"gitHubRepoPath": "dvsekhvalnov/jose-rt",
88+
"repoUrl": "https://github.com/dvsekhvalnov/jose-rt",
89+
"installCommandHtml": "Install-Package<br><a href=\"http://www.nuget.org/packages/jose-rt/\">jose-rt</a>"
90+
}
91+
]
92+
}

views/website/libraries/1-Python.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": "Python",
3+
"uniqueClass": "python",
4+
"image": "/img/4.svg",
5+
"bgColor": "rgb(55, 126, 240)",
6+
"libs": [
7+
{
8+
"minimumVersion": "1.0.1",
9+
"support": {
10+
"sign": true,
11+
"verify": true,
12+
"iss": true,
13+
"sub": false,
14+
"aud": true,
15+
"exp": true,
16+
"nbf": true,
17+
"iat": true,
18+
"jti": false,
19+
"hs256": true,
20+
"hs384": true,
21+
"hs512": true,
22+
"rs256": true,
23+
"rs384": true,
24+
"rs512": true,
25+
"es256": true,
26+
"es384": true,
27+
"es512": true
28+
},
29+
"authorUrl": "https://github.com/jpadilla",
30+
"authorName": "José Padilla",
31+
"gitHubRepoPath": "jpadilla/pyjwt",
32+
"repoUrl": "https://github.com/jpadilla/pyjwt/",
33+
"installCommandHtml": "pip install pyjwt"
34+
},
35+
{
36+
"minimumVersion": null,
37+
"support": {
38+
"sign": true,
39+
"verify": true,
40+
"iss": true,
41+
"sub": true,
42+
"aud": true,
43+
"exp": true,
44+
"nbf": true,
45+
"iat": true,
46+
"jti": true,
47+
"hs256": true,
48+
"hs384": true,
49+
"hs512": true,
50+
"rs256": true,
51+
"rs384": true,
52+
"rs512": true,
53+
"es256": true,
54+
"es384": true,
55+
"es512": true
56+
},
57+
"authorUrl": "https://github.com/mpdavis",
58+
"authorName": "Michael Davis",
59+
"gitHubRepoPath": "mpdavis/python-jose",
60+
"repoUrl": "https://github.com/mpdavis/python-jose/",
61+
"installCommandHtml": "pip install python-jose"
62+
},
63+
{
64+
"minimumVersion": null,
65+
"support": {
66+
"sign": true,
67+
"verify": true,
68+
"iss": true,
69+
"sub": true,
70+
"aud": true,
71+
"exp": true,
72+
"nbf": true,
73+
"iat": true,
74+
"jti": true,
75+
"hs256": true,
76+
"hs384": true,
77+
"hs512": true,
78+
"rs256": true,
79+
"rs384": true,
80+
"rs512": true,
81+
"es256": true,
82+
"es384": true,
83+
"es512": true
84+
},
85+
"authorUrl": "https://github.com/simo5",
86+
"authorName": "Simo Sorce",
87+
"gitHubRepoPath": "latchset/jwcrypto",
88+
"repoUrl": "https://github.com/latchset/jwcrypto/",
89+
"installCommandHtml": "pip install jwcrypto"
90+
}
91+
]
92+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Groovy",
3+
"uniqueClass": "groovy",
4+
"image": "/img/24.svg",
5+
"bgColor": "rgb(99, 152, 170)",
6+
"libs": [
7+
{
8+
"minimumVersion": null,
9+
"support": {
10+
"sign": true,
11+
"verify": true,
12+
"iss": false,
13+
"sub": false,
14+
"aud": false,
15+
"exp": false,
16+
"nbf": false,
17+
"iat": false,
18+
"jti": false,
19+
"hs256": true,
20+
"hs384": false,
21+
"hs512": false,
22+
"rs256": false,
23+
"rs384": false,
24+
"rs512": false,
25+
"es256": false,
26+
"es384": false,
27+
"es512": false
28+
},
29+
"authorUrl": "https://github.com/kaleidos",
30+
"authorName": "Kaleidos",
31+
"gitHubRepoPath": "kaleidos/grails-security-stateless",
32+
"repoUrl": "https://github.com/kaleidos/grails-security-stateless",
33+
"installCommandHtml": "compile \"org.grails.plugins:security-stateless:0.0.9\""
34+
}
35+
]
36+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "Haskell",
3+
"uniqueClass": "haskell",
4+
"image": "/img/9.svg",
5+
"bgColor": "rgb(102, 102, 102)",
6+
"libs": [
7+
{
8+
"minimumVersion": null,
9+
"support": {
10+
"sign": true,
11+
"verify": true,
12+
"iss": false,
13+
"sub": false,
14+
"aud": false,
15+
"exp": false,
16+
"nbf": false,
17+
"iat": false,
18+
"jti": false,
19+
"hs256": true,
20+
"hs384": false,
21+
"hs512": false,
22+
"rs256": false,
23+
"rs384": false,
24+
"rs512": false,
25+
"es256": false,
26+
"es384": false,
27+
"es512": false
28+
},
29+
"authorUrl": "https://bitbucket.org/ssaasen",
30+
"authorName": "Stefan Saasen",
31+
"gitHubRepoPath": null,
32+
"repoUrl": "https://bitbucket.org/ssaasen/haskell-jwt",
33+
"installCommandHtml": "cabal install jwt"
34+
},
35+
{
36+
"minimumVersion": null,
37+
"support": {
38+
"sign": true,
39+
"verify": true,
40+
"iss": true,
41+
"sub": false,
42+
"aud": true,
43+
"exp": true,
44+
"nbf": true,
45+
"iat": true,
46+
"jti": false,
47+
"hs256": true,
48+
"hs384": true,
49+
"hs512": true,
50+
"rs256": true,
51+
"rs384": true,
52+
"rs512": true,
53+
"es256": true,
54+
"es384": true,
55+
"es512": true
56+
},
57+
"authorUrl": "https://github.com/frasertweedale",
58+
"authorName": "Fraser Tweedale",
59+
"gitHubRepoPath": "frasertweedale/hs-jose",
60+
"repoUrl": "https://github.com/frasertweedale/hs-jose",
61+
"installCommandHtml": "cabal install jose"
62+
}
63+
]
64+
}

views/website/libraries/12-Haxe.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Haxe",
3+
"uniqueClass": "haxe",
4+
"image": "/img/23.svg",
5+
"bgColor": "rgb(234, 130, 32)",
6+
"libs": [
7+
{
8+
"minimumVersion": null,
9+
"support": {
10+
"sign": true,
11+
"verify": true,
12+
"iss": true,
13+
"sub": false,
14+
"aud": true,
15+
"exp": true,
16+
"nbf": false,
17+
"iat": false,
18+
"jti": false,
19+
"hs256": true,
20+
"hs384": false,
21+
"hs512": false,
22+
"rs256": false,
23+
"rs384": false,
24+
"rs512": false,
25+
"es256": false,
26+
"es384": false,
27+
"es512": false
28+
},
29+
"authorUrl": "https://github.com/kevinresol",
30+
"authorName": "Kevin Leung",
31+
"gitHubRepoPath": "kevinresol/jsonwebtoken",
32+
"repoUrl": "https://github.com/kevinresol/jsonwebtoken",
33+
"installCommandHtml": "haxelib install jsonwebtoken"
34+
}
35+
]
36+
}

0 commit comments

Comments
 (0)