Skip to content

Commit a3fab5b

Browse files
committed
Merge pull request jsonwebtoken#119 from diegopoza/updated-intro
Added fixes in the markdown rendering
2 parents b6c554e + 96b570d commit a3fab5b

File tree

11 files changed

+359
-119
lines changed

11 files changed

+359
-119
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (grunt) {
1010
options: {
1111
livereload: true
1212
},
13-
files: ['Gruntfile.js', 'js/**/*.js', 'stylus/**/*.styl', 'views/**/*.jade'],
13+
files: ['Gruntfile.js', 'js/**/*.js', 'stylus/**/*.styl', 'views/**/*.jade', 'views/**/*.md'],
1414
tasks: ['build']
1515
}
1616
},

css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

introduction/index.html

Lines changed: 53 additions & 85 deletions
Large diffs are not rendered by default.

js/app.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ if (location.href.indexOf("#libraries") != -1) {
3838
scrollTo($('#libraries-io'));
3939
}
4040

41+
/*
42+
* hljs
43+
*/
44+
hljs.configure({
45+
classPrefix: ''
46+
});
47+
48+
$('.plain-text pre code').each(function(i, block) {
49+
var $snippet = $(this);
50+
51+
if(!$snippet.hasClass('hljs')) {
52+
hljs.highlightBlock(block);
53+
hljs.lineNumbersBlock(block);
54+
$snippet.addClass('hljs');
55+
}
56+
});
57+
4158
/*
4259
* Show icon
4360
*/

js/highlight.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"name": "jwt.io",
33
"version": "0.0.1",
44
"dependencies": {
5-
"serve": "*",
65
"bower": "^1.4.1",
7-
"grunt": "^0.4.5"
6+
"grunt": "^0.4.5",
7+
"marked": "^0.3.5",
8+
"serve": "*"
89
},
910
"devDependencies": {
1011
"expect.js": "^0.3.1",
@@ -20,8 +21,7 @@
2021
"grunt-contrib-watch": "^0.6.1",
2122
"grunt-mocha-phantomjs": "0.7.0",
2223
"grunt-usemin": "^2.0.2",
23-
"matchdep": "~0.3.0",
24-
"markdown": "^0.5.0"
24+
"matchdep": "~0.3.0"
2525
},
2626
"scripts": {
2727
"test": "grunt test --verbose",

stylus/app.styl

Lines changed: 116 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import 'mixins'
22
@import 'codemirror'
33
@import 'flip-clock'
4+
@import 'highlight'
45

56
/*
67
* Webfont
@@ -934,25 +935,130 @@ body
934935
.container
935936
max-width 630px
936937

937-
h2
938-
margin-top 50px
938+
h1
939939
font-size 25px
940+
font-weight 300
941+
color #333
942+
margin-top 10px
943+
line-height 1.3
944+
+breakpoint("mobile-landscape")
945+
font-size 40px
940946

941-
h3
947+
& > h1, & > hr
948+
display none
949+
950+
h2, h3, h4, h5, h6
951+
&.anchor-heading
952+
position relative
953+
954+
.anchor
955+
display none
956+
+breakpoint("tablet")
957+
position absolute
958+
top 0
959+
left -25px
960+
visibility hidden
961+
&:hover
962+
+breakpoint("tablet")
963+
.anchor
964+
visibility visible
965+
966+
h2, h3, h4
967+
font-weight 700
968+
color #333
969+
line-height 1.3
970+
971+
h2
942972
font-size 20px
973+
margin-top 40px
974+
&:first-child
975+
margin-top 0
943976

944-
p
945-
line-height 1.8
946-
font-size 18px
977+
h3
978+
font-size 16px
947979

980+
h4, h5, h6
981+
font-size 13px
982+
text-transform uppercase
983+
letter-spacing 1px
984+
985+
p, ul li
986+
color #5c666f
987+
font-size 16px
988+
line-height 2
989+
strong
990+
color #333
948991
code
949-
background-color rgba(#D8D8D8,.35)
950-
font-size 75%
951-
border-radius 3px
952-
padding 2px 4px
992+
border-radius 4px
993+
font-size 90%
994+
padding 3px 8px
995+
background-color #F7F7F7
996+
997+
blockquote
998+
background-color lighten(#F7F7F7, 55%)
999+
padding 60px 30px
1000+
border-radius 3px
1001+
margin 30px 0
1002+
text-align center
1003+
border none
1004+
1005+
p
1006+
margin 0
1007+
font-size 12px
1008+
+breakpoint("tablet")
1009+
font-size 16px
1010+
1011+
em
1012+
font-size 18px
1013+
line-height 1.5
1014+
+breakpoint("tablet")
1015+
font-size 25px
1016+
1017+
strong
1018+
display block
1019+
margin-top 15px
1020+
color rgba(#333,.5)
1021+
text-transform uppercase
1022+
1023+
sup
1024+
font-size 90%
9531025

9541026
img
1027+
max-width 100%
1028+
1029+
table
1030+
border-collapse collapse
9551031
width 100%
1032+
margin 20px 0 30px
1033+
1034+
thead tr th
1035+
font-family Helvetica, Arial, sans-serif
1036+
font-weight bold
1037+
text-align center
1038+
font-size 13px
1039+
1040+
td, th
1041+
border 1px solid #E0E0E0
1042+
padding 0.5rem
1043+
text-align left
1044+
1045+
tbody tr:nth-child(odd)
1046+
background rgba(#eee,.5)
1047+
1048+
pre
1049+
display block
1050+
font-size 13px
1051+
line-height 1.42857143
1052+
color #333
1053+
word-break break-all
1054+
background-color #f5f5f5
1055+
border-radius 4px
1056+
margin-bottom 30px
1057+
1058+
pre code
1059+
font-size inherit
1060+
border none
1061+
border-radius 0
9561062

9571063

9581064
// go-tool

stylus/highlight.styl

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#f0f0f0;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:black}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rule .hljs-value,.hljs-preprocessor,.hljs-pragma,.hljs-name,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute,.tp .hljs-variable{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88f}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.css .hljs-tag,.hljs-doctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.hljs-type,.hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status,.tp .hljs-data,.tp .hljs-io{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis,.tp .hljs-units{font-style:italic}.nginx .hljs-built_in{font-weight:normal}
2+
3+
.main-content
4+
pre
5+
padding 0
6+
word-wrap normal
7+
8+
pre
9+
word-wrap normal
10+
position relative
11+
12+
code.hljs
13+
background-color #2F383D
14+
white-space pre
15+
padding 15px
16+
color white
17+
18+
code.hljs-line-numbers.hljs-line-numbers
19+
background-color darken(#2F383D, 10%)
20+
border-right 1px solid rgba(#5C666F,.1)
21+
text-align right
22+
color rgba(255, 255, 255, 0.4)
23+
-webkit-touch-callout none
24+
-webkit-user-select none
25+
-khtml-user-select none
26+
-moz-user-select none
27+
-ms-user-select none
28+
user-select none
29+
30+
.hljs
31+
.subst,
32+
.lisp .title,
33+
.clojure .built_in,
34+
.nginx .title
35+
color color_oil
36+
37+
.string,
38+
.title,
39+
.constant,
40+
.parent,
41+
.tag .value,
42+
.rules .value,
43+
.rules .value .number,
44+
.preprocessor,
45+
.ruby .symbol,
46+
.ruby .symbol .string,
47+
.aggregate,
48+
.template_tag,
49+
.django .variable,
50+
.smalltalk .class,
51+
.addition,
52+
.flow,
53+
.stream,
54+
.bash .variable,
55+
.apache .tag,
56+
.apache .cbracket,
57+
.tex .command,
58+
.tex .special,
59+
.erlang_repl .function_or_atom,
60+
.markdown .header
61+
color #00FBCA // green
62+
63+
.comment,
64+
.annotation,
65+
.template_comment,
66+
.diff .header,
67+
.chunk,
68+
.markdown .blockquote
69+
color #899FAB // oil light
70+
71+
.number,
72+
.title,
73+
.date,
74+
.regexp,
75+
.literal,
76+
.smalltalk .symbol,
77+
.smalltalk .char,
78+
.go .constant,
79+
.change,
80+
.markdown .bullet,
81+
.markdown .link_url
82+
color #42C7F4 // blue light
83+
84+
.label,
85+
.tag,
86+
.javadoc,
87+
.ruby .string,
88+
.decorator,
89+
.filter .argument,
90+
.localvars,
91+
.array,
92+
.attr_selector,
93+
.important,
94+
.pseudo,
95+
.pi,
96+
.doctype,
97+
.deletion,
98+
.envvar,
99+
.shebang,
100+
.apache .sqbracket,
101+
.nginx .built_in,
102+
.tex .formula,
103+
.erlang_repl .reserved,
104+
.prompt,
105+
.markdown .link_label,
106+
.vhdl .attribute,
107+
.clojure .attribute,
108+
.coffeescript .property
109+
color #FFA0E7 // pink
110+
111+
112+
.id,
113+
.phpdoc,
114+
.built_in,
115+
.aggregate,
116+
.css .tag,
117+
.javadoctag,
118+
.phpdoc,
119+
.yardoctag,
120+
.smalltalk .class,
121+
.winutils,
122+
.bash .variable,
123+
.apache .tag,
124+
.go .typename,
125+
.tex .command,
126+
.markdown .strong,
127+
.request,
128+
.status,
129+
.tag .title,
130+
.keyword
131+
color #FF9A56 // orange
132+
133+
.coffeescript .javascript,
134+
.javascript .xml,
135+
.tex .formula,
136+
.xml .javascript,
137+
.xml .vbscript,
138+
.xml .css,
139+
.xml .cdata
140+
opacity: 1;
141+
142+

views/layout.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ html(lang='en')
123123
script(src='/js/isotope.pkgd.min.js')
124124
script(src='/js/flipclock.js')
125125
script(src='/js/accordion.js')
126+
script(src='/js/highlight.min.js')
126127

127128
script(src='/js/app.js')
128129
// endbuild

0 commit comments

Comments
 (0)