tianzhendong
3 years ago
commit
79c3bbaf66
62 changed files with 3983 additions and 0 deletions
After Width: | Height: | Size: 10 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
!function(e,t,a){function r(e){var a=t.createElement("div");a.className="heart",n.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}),t.body.appendChild(a)}var n=[];e.requestAnimationFrame=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},function(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),function(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),r(e)}}(),function e(){for(var a=0;a<n.length;a++)n[a].alpha<=0?(t.body.removeChild(n[a].el),n.splice(a,1)):(n[a].y--,n[a].scale+=.004,n[a].alpha-=.013,n[a].el.style.cssText="left:"+n[a].x+"px;top:"+n[a].y+"px;opacity:"+n[a].alpha+";transform:scale("+n[a].scale+","+n[a].scale+") rotate(45deg);background:"+n[a].color+";z-index:99999");requestAnimationFrame(e)}()}(window,document); |
@ -0,0 +1,35 @@ |
|||||
|
.friends { |
||||
|
display: flex; |
||||
|
flex-wrap: wrap; |
||||
|
} |
||||
|
.friends .a-friend { |
||||
|
display: flex; |
||||
|
margin: 10px 10px 0 0; |
||||
|
text-decoration: none; |
||||
|
font-weight: 300; |
||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); |
||||
|
padding: 10px; |
||||
|
transition: box-shadow 0.2s, transform 0.2s; |
||||
|
} |
||||
|
.friends .a-friend:hover { |
||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); |
||||
|
} |
||||
|
.friends .a-friend:active { |
||||
|
transform: scale(0.95); |
||||
|
} |
||||
|
.friends .a-friend .blog-avatar { |
||||
|
background-color: white; |
||||
|
border-radius: 50%; |
||||
|
width: 50px; |
||||
|
height: 50px; |
||||
|
} |
||||
|
.friends .a-friend .text-container { |
||||
|
margin-left: 10px; |
||||
|
} |
||||
|
.friends .a-friend .text-container .name { |
||||
|
font-size: 14px; |
||||
|
} |
||||
|
.friends .a-friend .text-container .description { |
||||
|
font-size: 12px; |
||||
|
margin-top: 5px; |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
/*结束文章符号*/ |
||||
|
.over { |
||||
|
width: 40px; |
||||
|
height: 40px; |
||||
|
border: 1px solid #000001; |
||||
|
border-radius: 50%; |
||||
|
text-align: center; |
||||
|
line-height: 40px; |
||||
|
margin: 20px auto 5px; |
||||
|
text-shadow: 0 0 black; |
||||
|
} |
@ -0,0 +1,828 @@ |
|||||
|
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600"); |
||||
|
* { |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-webkit-overflow-scrolling: touch; |
||||
|
-webkit-tap-highlight-color: rgba(0,0,0,0); |
||||
|
-webkit-text-size-adjust: none; |
||||
|
-webkit-touch-callout: none; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
body:not(.ready) { |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
body:not(.ready) [data-cloak], |
||||
|
body:not(.ready) .app-nav, |
||||
|
body:not(.ready) > nav { |
||||
|
display: none; |
||||
|
} |
||||
|
div#app { |
||||
|
font-size: 30px; |
||||
|
font-weight: lighter; |
||||
|
margin: 40vh auto; |
||||
|
text-align: center; |
||||
|
} |
||||
|
div#app:empty::before { |
||||
|
content: 'Loading...'; |
||||
|
} |
||||
|
.emoji { |
||||
|
height: 1.2rem; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.progress { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
height: 2px; |
||||
|
left: 0px; |
||||
|
position: fixed; |
||||
|
right: 0px; |
||||
|
top: 0px; |
||||
|
transition: width 0.2s, opacity 0.4s; |
||||
|
width: 0%; |
||||
|
z-index: 999999; |
||||
|
} |
||||
|
.search a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.search .search-keyword { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-style: normal; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
html, |
||||
|
body { |
||||
|
height: 100%; |
||||
|
} |
||||
|
body { |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
color: #34495e; |
||||
|
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; |
||||
|
font-size: 15px; |
||||
|
letter-spacing: 0; |
||||
|
margin: 0; |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
img { |
||||
|
max-width: 100%; |
||||
|
} |
||||
|
a[disabled] { |
||||
|
cursor: not-allowed; |
||||
|
opacity: 0.6; |
||||
|
} |
||||
|
kbd { |
||||
|
border: solid 1px #ccc; |
||||
|
border-radius: 3px; |
||||
|
display: inline-block; |
||||
|
font-size: 12px !important; |
||||
|
line-height: 12px; |
||||
|
margin-bottom: 3px; |
||||
|
padding: 3px 5px; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
li input[type='checkbox'] { |
||||
|
margin: 0 0.2em 0.25em 0; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.app-nav { |
||||
|
margin: 25px 60px 0 0; |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
text-align: right; |
||||
|
z-index: 10; |
||||
|
/* navbar dropdown */ |
||||
|
} |
||||
|
.app-nav.no-badge { |
||||
|
margin-right: 25px; |
||||
|
} |
||||
|
.app-nav p { |
||||
|
margin: 0; |
||||
|
} |
||||
|
.app-nav > a { |
||||
|
margin: 0 1rem; |
||||
|
padding: 5px 0; |
||||
|
} |
||||
|
.app-nav ul, |
||||
|
.app-nav li { |
||||
|
display: inline-block; |
||||
|
list-style: none; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.app-nav a { |
||||
|
color: inherit; |
||||
|
font-size: 16px; |
||||
|
text-decoration: none; |
||||
|
transition: color 0.3s; |
||||
|
} |
||||
|
.app-nav a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.app-nav a.active { |
||||
|
border-bottom: 2px solid var(--theme-color, #42b983); |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.app-nav li { |
||||
|
display: inline-block; |
||||
|
margin: 0 1rem; |
||||
|
padding: 5px 0; |
||||
|
position: relative; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.app-nav li ul { |
||||
|
background-color: #fff; |
||||
|
border: 1px solid #ddd; |
||||
|
border-bottom-color: #ccc; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
display: none; |
||||
|
max-height: calc(100vh - 61px); |
||||
|
overflow-y: auto; |
||||
|
padding: 10px 0; |
||||
|
position: absolute; |
||||
|
right: -15px; |
||||
|
text-align: left; |
||||
|
top: 100%; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.app-nav li ul li { |
||||
|
display: block; |
||||
|
font-size: 14px; |
||||
|
line-height: 1rem; |
||||
|
margin: 0; |
||||
|
margin: 8px 14px; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.app-nav li ul a { |
||||
|
display: block; |
||||
|
font-size: inherit; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
} |
||||
|
.app-nav li ul a.active { |
||||
|
border-bottom: 0; |
||||
|
} |
||||
|
.app-nav li:hover ul { |
||||
|
display: block; |
||||
|
} |
||||
|
.github-corner { |
||||
|
border-bottom: 0; |
||||
|
position: fixed; |
||||
|
right: 0; |
||||
|
text-decoration: none; |
||||
|
top: 0; |
||||
|
z-index: 1; |
||||
|
} |
||||
|
.github-corner:hover .octo-arm { |
||||
|
-webkit-animation: octocat-wave 560ms ease-in-out; |
||||
|
animation: octocat-wave 560ms ease-in-out; |
||||
|
} |
||||
|
.github-corner svg { |
||||
|
color: #fff; |
||||
|
fill: var(--theme-color, #42b983); |
||||
|
height: 80px; |
||||
|
width: 80px; |
||||
|
} |
||||
|
main { |
||||
|
display: block; |
||||
|
position: relative; |
||||
|
width: 100vw; |
||||
|
height: 100%; |
||||
|
z-index: 0; |
||||
|
} |
||||
|
main.hidden { |
||||
|
display: none; |
||||
|
} |
||||
|
.anchor { |
||||
|
display: inline-block; |
||||
|
text-decoration: none; |
||||
|
transition: all 0.3s; |
||||
|
} |
||||
|
.anchor span { |
||||
|
color: #34495e; |
||||
|
} |
||||
|
.anchor:hover { |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
.sidebar { |
||||
|
border-right: 1px solid rgba(0,0,0,0.07); |
||||
|
overflow-y: auto; |
||||
|
padding: 40px 0 0; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
transition: transform 250ms ease-out; |
||||
|
width: 300px; |
||||
|
z-index: 20; |
||||
|
} |
||||
|
.sidebar > h1 { |
||||
|
margin: 0 auto 1rem; |
||||
|
font-size: 1.5rem; |
||||
|
font-weight: 300; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.sidebar > h1 a { |
||||
|
color: inherit; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.sidebar > h1 .app-nav { |
||||
|
display: block; |
||||
|
position: static; |
||||
|
} |
||||
|
.sidebar .sidebar-nav { |
||||
|
line-height: 2em; |
||||
|
padding-bottom: 40px; |
||||
|
} |
||||
|
.sidebar li.collapse .app-sub-sidebar { |
||||
|
display: none; |
||||
|
} |
||||
|
.sidebar ul { |
||||
|
margin: 0 0 0 15px; |
||||
|
padding: 0; |
||||
|
} |
||||
|
.sidebar li > p { |
||||
|
font-weight: 700; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.sidebar ul, |
||||
|
.sidebar ul li { |
||||
|
list-style: none; |
||||
|
} |
||||
|
.sidebar ul li a { |
||||
|
border-bottom: none; |
||||
|
display: block; |
||||
|
} |
||||
|
.sidebar ul li ul { |
||||
|
padding-left: 20px; |
||||
|
} |
||||
|
.sidebar::-webkit-scrollbar { |
||||
|
width: 4px; |
||||
|
} |
||||
|
.sidebar::-webkit-scrollbar-thumb { |
||||
|
background: transparent; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.sidebar:hover::-webkit-scrollbar-thumb { |
||||
|
background: rgba(136,136,136,0.4); |
||||
|
} |
||||
|
.sidebar:hover::-webkit-scrollbar-track { |
||||
|
background: rgba(136,136,136,0.1); |
||||
|
} |
||||
|
.sidebar-toggle { |
||||
|
background-color: transparent; |
||||
|
background-color: rgba(255,255,255,0.8); |
||||
|
border: 0; |
||||
|
outline: none; |
||||
|
padding: 10px; |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
text-align: center; |
||||
|
transition: opacity 0.3s; |
||||
|
width: 284px; |
||||
|
z-index: 30; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.sidebar-toggle:hover .sidebar-toggle-button { |
||||
|
opacity: 0.4; |
||||
|
} |
||||
|
.sidebar-toggle span { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
display: block; |
||||
|
margin-bottom: 4px; |
||||
|
width: 16px; |
||||
|
height: 2px; |
||||
|
} |
||||
|
body.sticky .sidebar, |
||||
|
body.sticky .sidebar-toggle { |
||||
|
position: fixed; |
||||
|
} |
||||
|
.content { |
||||
|
padding-top: 60px; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
bottom: 0; |
||||
|
left: 300px; |
||||
|
transition: left 250ms ease; |
||||
|
} |
||||
|
.markdown-section { |
||||
|
margin: 0 auto; |
||||
|
max-width: 80%; |
||||
|
padding: 30px 15px 40px 15px; |
||||
|
position: relative; |
||||
|
} |
||||
|
.markdown-section > * { |
||||
|
box-sizing: border-box; |
||||
|
font-size: inherit; |
||||
|
} |
||||
|
.markdown-section > :first-child { |
||||
|
margin-top: 0 !important; |
||||
|
} |
||||
|
.markdown-section hr { |
||||
|
border: none; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
margin: 2em 0; |
||||
|
} |
||||
|
.markdown-section iframe { |
||||
|
border: 1px solid #eee; |
||||
|
/* fix horizontal overflow on iOS Safari */ |
||||
|
width: 1px; |
||||
|
min-width: 100%; |
||||
|
} |
||||
|
.markdown-section table { |
||||
|
border-collapse: collapse; |
||||
|
border-spacing: 0; |
||||
|
display: block; |
||||
|
margin-bottom: 1rem; |
||||
|
overflow: auto; |
||||
|
width: 100%; |
||||
|
} |
||||
|
.markdown-section th { |
||||
|
border: 1px solid #ddd; |
||||
|
font-weight: bold; |
||||
|
padding: 6px 13px; |
||||
|
} |
||||
|
.markdown-section td { |
||||
|
border: 1px solid #ddd; |
||||
|
padding: 6px 13px; |
||||
|
} |
||||
|
.markdown-section tr { |
||||
|
border-top: 1px solid #ccc; |
||||
|
} |
||||
|
.markdown-section tr:nth-child(2n) { |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
.markdown-section p.tip { |
||||
|
background-color: #f8f8f8; |
||||
|
border-bottom-right-radius: 2px; |
||||
|
border-left: 4px solid #f66; |
||||
|
border-top-right-radius: 2px; |
||||
|
margin: 2em 0; |
||||
|
padding: 12px 24px 12px 30px; |
||||
|
position: relative; |
||||
|
} |
||||
|
.markdown-section p.tip:before { |
||||
|
background-color: #f66; |
||||
|
border-radius: 100%; |
||||
|
color: #fff; |
||||
|
content: '!'; |
||||
|
font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; |
||||
|
font-size: 14px; |
||||
|
font-weight: bold; |
||||
|
left: -12px; |
||||
|
line-height: 20px; |
||||
|
position: absolute; |
||||
|
height: 20px; |
||||
|
width: 20px; |
||||
|
text-align: center; |
||||
|
top: 14px; |
||||
|
} |
||||
|
.markdown-section p.tip code { |
||||
|
background-color: #efefef; |
||||
|
} |
||||
|
.markdown-section p.tip em { |
||||
|
color: #34495e; |
||||
|
} |
||||
|
.markdown-section p.warn { |
||||
|
background: rgba(66,185,131,0.1); |
||||
|
border-radius: 2px; |
||||
|
padding: 1rem; |
||||
|
} |
||||
|
.markdown-section ul.task-list > li { |
||||
|
list-style-type: none; |
||||
|
} |
||||
|
body.close .sidebar { |
||||
|
transform: translateX(-300px); |
||||
|
} |
||||
|
body.close .sidebar-toggle { |
||||
|
width: auto; |
||||
|
} |
||||
|
body.close .content { |
||||
|
left: 0; |
||||
|
} |
||||
|
@media print { |
||||
|
.github-corner, |
||||
|
.sidebar-toggle, |
||||
|
.sidebar, |
||||
|
.app-nav { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
@media screen and (max-width: 768px) { |
||||
|
.github-corner, |
||||
|
.sidebar-toggle, |
||||
|
.sidebar { |
||||
|
position: fixed; |
||||
|
} |
||||
|
.app-nav { |
||||
|
margin-top: 16px; |
||||
|
} |
||||
|
.app-nav li ul { |
||||
|
top: 30px; |
||||
|
} |
||||
|
main { |
||||
|
height: auto; |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
.sidebar { |
||||
|
left: -300px; |
||||
|
transition: transform 250ms ease-out; |
||||
|
} |
||||
|
.content { |
||||
|
left: 0; |
||||
|
max-width: 100vw; |
||||
|
position: static; |
||||
|
padding-top: 20px; |
||||
|
transition: transform 250ms ease; |
||||
|
} |
||||
|
.app-nav, |
||||
|
.github-corner { |
||||
|
transition: transform 250ms ease-out; |
||||
|
} |
||||
|
.sidebar-toggle { |
||||
|
background-color: transparent; |
||||
|
width: auto; |
||||
|
padding: 30px 30px 10px 10px; |
||||
|
} |
||||
|
body.close .sidebar { |
||||
|
transform: translateX(300px); |
||||
|
} |
||||
|
body.close .sidebar-toggle { |
||||
|
background-color: rgba(255,255,255,0.8); |
||||
|
transition: 1s background-color; |
||||
|
width: 284px; |
||||
|
padding: 10px; |
||||
|
} |
||||
|
body.close .content { |
||||
|
transform: translateX(300px); |
||||
|
} |
||||
|
body.close .app-nav, |
||||
|
body.close .github-corner { |
||||
|
display: none; |
||||
|
} |
||||
|
.github-corner:hover .octo-arm { |
||||
|
-webkit-animation: none; |
||||
|
animation: none; |
||||
|
} |
||||
|
.github-corner .octo-arm { |
||||
|
-webkit-animation: octocat-wave 560ms ease-in-out; |
||||
|
animation: octocat-wave 560ms ease-in-out; |
||||
|
} |
||||
|
} |
||||
|
@-webkit-keyframes octocat-wave { |
||||
|
0%, 100% { |
||||
|
transform: rotate(0); |
||||
|
} |
||||
|
20%, 60% { |
||||
|
transform: rotate(-25deg); |
||||
|
} |
||||
|
40%, 80% { |
||||
|
transform: rotate(10deg); |
||||
|
} |
||||
|
} |
||||
|
@keyframes octocat-wave { |
||||
|
0%, 100% { |
||||
|
transform: rotate(0); |
||||
|
} |
||||
|
20%, 60% { |
||||
|
transform: rotate(-25deg); |
||||
|
} |
||||
|
40%, 80% { |
||||
|
transform: rotate(10deg); |
||||
|
} |
||||
|
} |
||||
|
section.cover { |
||||
|
align-items: center; |
||||
|
background-position: center center; |
||||
|
background-repeat: no-repeat; |
||||
|
background-size: cover; |
||||
|
height: 100vh; |
||||
|
width: 100vw; |
||||
|
display: none; |
||||
|
} |
||||
|
section.cover.show { |
||||
|
display: flex; |
||||
|
} |
||||
|
section.cover.has-mask .mask { |
||||
|
background-color: #fff; |
||||
|
opacity: 0.8; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
height: 100%; |
||||
|
width: 100%; |
||||
|
} |
||||
|
section.cover .cover-main { |
||||
|
flex: 1; |
||||
|
margin: -20px 16px 0; |
||||
|
text-align: center; |
||||
|
} |
||||
|
section.cover a { |
||||
|
color: inherit; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
section.cover a:hover { |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
section.cover p { |
||||
|
line-height: 1.5rem; |
||||
|
margin: 1em 0; |
||||
|
} |
||||
|
section.cover h1 { |
||||
|
color: inherit; |
||||
|
font-size: 2.5rem; |
||||
|
font-weight: 300; |
||||
|
margin: 0.625rem 0 2.5rem; |
||||
|
position: relative; |
||||
|
text-align: center; |
||||
|
} |
||||
|
section.cover h1 a { |
||||
|
display: block; |
||||
|
} |
||||
|
section.cover h1 small { |
||||
|
bottom: -0.4375rem; |
||||
|
font-size: 1rem; |
||||
|
position: absolute; |
||||
|
} |
||||
|
section.cover blockquote { |
||||
|
font-size: 1.5rem; |
||||
|
text-align: center; |
||||
|
} |
||||
|
section.cover ul { |
||||
|
line-height: 1.8; |
||||
|
list-style-type: none; |
||||
|
margin: 1em auto; |
||||
|
max-width: 500px; |
||||
|
padding: 0; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a { |
||||
|
border-color: var(--theme-color, #42b983); |
||||
|
border-radius: 2rem; |
||||
|
border-style: solid; |
||||
|
border-width: 1px; |
||||
|
box-sizing: border-box; |
||||
|
color: var(--theme-color, #42b983); |
||||
|
display: inline-block; |
||||
|
font-size: 1.05rem; |
||||
|
letter-spacing: 0.1rem; |
||||
|
margin: 0.5rem 1rem; |
||||
|
padding: 0.75em 2rem; |
||||
|
text-decoration: none; |
||||
|
transition: all 0.15s ease; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:last-child { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
color: #fff; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:last-child:hover { |
||||
|
color: inherit; |
||||
|
opacity: 0.8; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:hover { |
||||
|
color: inherit; |
||||
|
} |
||||
|
section.cover blockquote > p > a { |
||||
|
border-bottom: 2px solid var(--theme-color, #42b983); |
||||
|
transition: color 0.3s; |
||||
|
} |
||||
|
section.cover blockquote > p > a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
body { |
||||
|
background-color: #fff; |
||||
|
} |
||||
|
/* sidebar */ |
||||
|
.sidebar { |
||||
|
background-color: #fff; |
||||
|
color: #364149; |
||||
|
} |
||||
|
.sidebar li { |
||||
|
margin: 6px 0 6px 0; |
||||
|
} |
||||
|
.sidebar ul li a { |
||||
|
color: #505d6b; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
overflow: hidden; |
||||
|
text-decoration: none; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.sidebar ul li a:hover { |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
.sidebar ul li ul { |
||||
|
padding: 0; |
||||
|
} |
||||
|
.sidebar ul li.active > a { |
||||
|
border-right: 2px solid; |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.app-sub-sidebar li::before { |
||||
|
content: '-'; |
||||
|
padding-right: 4px; |
||||
|
float: left; |
||||
|
} |
||||
|
/* markdown content found on pages */ |
||||
|
.markdown-section h1, |
||||
|
.markdown-section h2, |
||||
|
.markdown-section h3, |
||||
|
.markdown-section h4, |
||||
|
.markdown-section strong { |
||||
|
color: #2c3e50; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.markdown-section a { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.markdown-section h1 { |
||||
|
font-size: 2rem; |
||||
|
margin: 0 0 1rem; |
||||
|
} |
||||
|
.markdown-section h2 { |
||||
|
font-size: 1.75rem; |
||||
|
margin: 45px 0 0.8rem; |
||||
|
} |
||||
|
.markdown-section h3 { |
||||
|
font-size: 1.5rem; |
||||
|
margin: 40px 0 0.6rem; |
||||
|
} |
||||
|
.markdown-section h4 { |
||||
|
font-size: 1.25rem; |
||||
|
} |
||||
|
.markdown-section h5 { |
||||
|
font-size: 1rem; |
||||
|
} |
||||
|
.markdown-section h6 { |
||||
|
color: #777; |
||||
|
font-size: 1rem; |
||||
|
} |
||||
|
.markdown-section figure, |
||||
|
.markdown-section p { |
||||
|
margin: 1.2em 0; |
||||
|
} |
||||
|
.markdown-section p, |
||||
|
.markdown-section ul, |
||||
|
.markdown-section ol { |
||||
|
line-height: 1.6rem; |
||||
|
word-spacing: 0.05rem; |
||||
|
} |
||||
|
.markdown-section ul, |
||||
|
.markdown-section ol { |
||||
|
padding-left: 1.5rem; |
||||
|
} |
||||
|
.markdown-section blockquote { |
||||
|
border-left: 4px solid var(--theme-color, #42b983); |
||||
|
color: #858585; |
||||
|
margin: 2em 0; |
||||
|
padding-left: 20px; |
||||
|
} |
||||
|
.markdown-section blockquote p { |
||||
|
font-weight: 600; |
||||
|
margin-left: 0; |
||||
|
} |
||||
|
.markdown-section iframe { |
||||
|
margin: 1em 0; |
||||
|
} |
||||
|
.markdown-section em { |
||||
|
color: #7f8c8d; |
||||
|
} |
||||
|
.markdown-section code { |
||||
|
background-color: #f8f8f8; |
||||
|
border-radius: 2px; |
||||
|
color: #e96900; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
font-size: 0.8rem; |
||||
|
margin: 0 2px; |
||||
|
padding: 3px 5px; |
||||
|
white-space: pre-wrap; |
||||
|
} |
||||
|
.markdown-section pre { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
background-color: #f8f8f8; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
line-height: 1.5rem; |
||||
|
margin: 1.2em 0; |
||||
|
overflow: auto; |
||||
|
padding: 0 1.4rem; |
||||
|
position: relative; |
||||
|
word-wrap: normal; |
||||
|
} |
||||
|
/* code highlight */ |
||||
|
.token.comment, |
||||
|
.token.prolog, |
||||
|
.token.doctype, |
||||
|
.token.cdata { |
||||
|
color: #8e908c; |
||||
|
} |
||||
|
.token.namespace { |
||||
|
opacity: 0.7; |
||||
|
} |
||||
|
.token.boolean, |
||||
|
.token.number { |
||||
|
color: #c76b29; |
||||
|
} |
||||
|
.token.punctuation { |
||||
|
color: #525252; |
||||
|
} |
||||
|
.token.property { |
||||
|
color: #c08b30; |
||||
|
} |
||||
|
.token.tag { |
||||
|
color: #2973b7; |
||||
|
} |
||||
|
.token.string { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.token.selector { |
||||
|
color: #6679cc; |
||||
|
} |
||||
|
.token.attr-name { |
||||
|
color: #2973b7; |
||||
|
} |
||||
|
.token.entity, |
||||
|
.token.url, |
||||
|
.language-css .token.string, |
||||
|
.style .token.string { |
||||
|
color: #22a2c9; |
||||
|
} |
||||
|
.token.attr-value, |
||||
|
.token.control, |
||||
|
.token.directive, |
||||
|
.token.unit { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.token.keyword, |
||||
|
.token.function { |
||||
|
color: #e96900; |
||||
|
} |
||||
|
.token.statement, |
||||
|
.token.regex, |
||||
|
.token.atrule { |
||||
|
color: #22a2c9; |
||||
|
} |
||||
|
.token.placeholder, |
||||
|
.token.variable { |
||||
|
color: #3d8fd1; |
||||
|
} |
||||
|
.token.deleted { |
||||
|
text-decoration: line-through; |
||||
|
} |
||||
|
.token.inserted { |
||||
|
border-bottom: 1px dotted #202746; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.token.italic { |
||||
|
font-style: italic; |
||||
|
} |
||||
|
.token.important, |
||||
|
.token.bold { |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.token.important { |
||||
|
color: #c94922; |
||||
|
} |
||||
|
.token.entity { |
||||
|
cursor: help; |
||||
|
} |
||||
|
.markdown-section pre > code { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
background-color: #f8f8f8; |
||||
|
border-radius: 2px; |
||||
|
color: #525252; |
||||
|
display: block; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
font-size: 0.8rem; |
||||
|
line-height: inherit; |
||||
|
margin: 0 2px; |
||||
|
max-width: inherit; |
||||
|
overflow: inherit; |
||||
|
padding: 2.2em 5px; |
||||
|
white-space: inherit; |
||||
|
} |
||||
|
.markdown-section code::after, |
||||
|
.markdown-section code::before { |
||||
|
letter-spacing: 0.05rem; |
||||
|
} |
||||
|
code .token { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
min-height: 1.5rem; |
||||
|
position: relative; |
||||
|
left: auto; |
||||
|
} |
||||
|
pre::after { |
||||
|
color: #ccc; |
||||
|
content: attr(data-lang); |
||||
|
font-size: 0.6rem; |
||||
|
font-weight: 600; |
||||
|
height: 15px; |
||||
|
line-height: 15px; |
||||
|
padding: 5px 10px 0; |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
text-align: right; |
||||
|
top: 0; |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
section.cover.has-mask .mask { |
||||
|
background-image: linear-gradient(hsla(0, 0%, 100%, 0.25),hsla(0, 0%, 100%, 0.75)); |
||||
|
background-color: transparent; |
||||
|
opacity: 1; |
||||
|
} |
||||
|
|
||||
|
section.cover h1 .anchor span{ |
||||
|
font-family: 'Lobster', cursive; |
||||
|
color: var(--theme-color); |
||||
|
} |
||||
|
|
||||
|
section.cover .cover-main>p:last-child a .iconfont { |
||||
|
font-size: 1em; |
||||
|
} |
||||
|
|
@ -0,0 +1 @@ |
|||||
|
!function(){var i=location.href.replace("/-/","/#/");i!==location.href&&(location.href=i),$docsify.plugins=[].concat(function(i,o){var n=Docsify.dom,e=o.config.disqus;if(!e)throw Error("$docsify.disqus is required");i.init(function(i){var t=n.create("script");t.async=!0,t.src="https://"+e+".disqus.com/embed.js",t.setAttribute("data-timestamp",Number(new Date)),n.appendTo(n.body,t)}),i.mounted(function(i){var t=n.create("div");t.id="disqus_thread";var e=n.getNode("#main");t.style="width: "+e.clientWidth+"px; margin: 0 auto 20px;",n.appendTo(n.find(".content"),t),window.disqus_config=function(){this.page.url=location.origin+"/-"+o.route.path,this.page.identifier=o.route.path,this.page.title=document.title}}),i.doneEach(function(i){void 0!==window.DISQUS&&window.DISQUS.reset({reload:!0,config:function(){this.page.url=location.origin+"/-"+o.route.path,this.page.identifier=o.route.path,this.page.title=document.title}})})},$docsify.plugins)}(); |
@ -0,0 +1,9 @@ |
|||||
|
/*! |
||||
|
* docsify-copy-code |
||||
|
* v2.1.0 |
||||
|
* https://github.com/jperasmus/docsify-copy-code
|
||||
|
* (c) 2017-2019 JP Erasmus <jperasmus11@gmail.com> |
||||
|
* MIT license |
||||
|
*/ |
||||
|
!function(){"use strict";function r(o){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}!function(o,e){void 0===e&&(e={});var t=e.insertAt;if(o&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css","top"===t&&n.firstChild?n.insertBefore(c,n.firstChild):n.appendChild(c),c.styleSheet?c.styleSheet.cssText=o:c.appendChild(document.createTextNode(o))}}(".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer;transition:all .25s ease}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:.3em;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:0}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:-100;top:50%;left:0;padding:.5em .65em;font-size:.825em;opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{opacity:1;-webkit-transform:translate(-115%,-50%);transform:translate(-115%,-50%)}.docsify-copy-code-button:focus,pre:hover .docsify-copy-code-button{opacity:1}"),document.querySelector('link[href*="docsify-copy-code"]')&&console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."),window.DocsifyCopyCodePlugin={init:function(){return function(o,e){o.ready(function(){console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")})}}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(o,s){o.doneEach(function(){var o=Array.apply(null,document.querySelectorAll("pre[data-lang]")),c={buttonText:"复制请点击",errorText:"Error",successText:"复制成功"};s.config.copyCode&&Object.keys(c).forEach(function(t){var n=s.config.copyCode[t];"string"==typeof n?c[t]=n:"object"===r(n)&&Object.keys(n).some(function(o){var e=-1<location.href.indexOf(o);return c[t]=e?n[o]:c[t],e})});var e=['<button class="docsify-copy-code-button">','<span class="label">'.concat(c.buttonText,"</span>"),'<span class="error">'.concat(c.errorText,"</span>"),'<span class="success">'.concat(c.successText,"</span>"),"</button>"].join("");o.forEach(function(o){o.insertAdjacentHTML("beforeend",e)})}),o.mounted(function(){document.querySelector(".content").addEventListener("click",function(o){if(o.target.classList.contains("docsify-copy-code-button")){var e="BUTTON"===o.target.tagName?o.target:o.target.parentNode,t=document.createRange(),n=e.parentNode.querySelector("code"),c=window.getSelection();t.selectNode(n),c.removeAllRanges(),c.addRange(t);try{document.execCommand("copy")&&(e.classList.add("success"),setTimeout(function(){e.classList.remove("success")},1e3))}catch(o){console.error("docsify-copy-code: ".concat(o)),e.classList.add("error"),setTimeout(function(){e.classList.remove("error")},1e3)}"function"==typeof(c=window.getSelection()).removeRange?c.removeRange(t):"function"==typeof c.removeAllRanges&&c.removeAllRanges()}})})}].concat(window.$docsify.plugins||[])}(); |
||||
|
//# sourceMappingURL=docsify-copy-code.min.js.map
|
@ -0,0 +1 @@ |
|||||
|
!function(o){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return o[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=o,t.c=e,t.d=function(o,e,n){t.o(o,e)||Object.defineProperty(o,e,{enumerable:!0,get:n})},t.r=function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},t.t=function(o,e){if(1&e&&(o=t(o)),8&e)return o;if(4&e&&"object"==typeof o&&o&&o.__esModule)return o;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:o}),2&e&&"string"!=typeof o)for(var r in o)t.d(n,r,function(e){return o[e]}.bind(null,r));return n},t.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return t.d(e,"a",e),e},t.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},t.p="",t(t.s=0)}([function(o,e,t){"use strict";t.r(e),window.$docsify=window.$docsify||{},window.$docsify.plugins=(window.$docsify.plugins||[]).concat((function(o,e){e.config.footer;let t=e.config.footer&&e.config.footer.copy?e.config.footer.copy:"<span>© 2019.</span>",n=e.config.footer&&e.config.footer.auth?e.config.footer.auth:'<span>Published with <a href="https://github.com/docsifyjs/docsify" target="_blank" rel="noreferrer" rel="noopener">docsify</a>.</span>',r=e.config.footer&&e.config.footer.style?`style="${e.config.footer.style}"`:"",f=e.config.footer&&e.config.footer.class?`class="${e.config.footer.class}"`:"";var i=`${e.config.footer&&e.config.footer.pre?`${e.config.footer.pre}`:""}<footer ${r} ${f}>${t} ${n}</footer>`;o.afterEach((function(o){return o+i}))}))}]); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,132 @@ |
|||||
|
const DEBUG = 0; |
||||
|
const PDF_VIEWER_WIDTH = '100%'; |
||||
|
const PDF_VIEWER_HEIGHT = '50rem'; |
||||
|
const PDF_MARGIN_TOP = '2rem'; |
||||
|
const PDF_MARGIN_BOTTOM = '5rem'; |
||||
|
|
||||
|
! function() { |
||||
|
var verbose_log = function(log){ |
||||
|
if (DEBUG) { |
||||
|
console.log(log); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var mobile_check = function() { |
||||
|
var check = false; |
||||
|
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); |
||||
|
return check; |
||||
|
}; |
||||
|
|
||||
|
var url_check = function(url_str) { |
||||
|
var expression = /^(http|https):\/\/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi; |
||||
|
return url_str.match(expression); |
||||
|
} |
||||
|
|
||||
|
var build_absolute_path = function(path_str) { |
||||
|
return window.location.protocol + "//" + window.location.hostname + "/" + path_str; |
||||
|
} |
||||
|
|
||||
|
var renderer_func = function(code, lang, base=null) { |
||||
|
var pdf_renderer = function(code, lang, verify) { |
||||
|
function unique_id_generator(){ |
||||
|
function rand_gen(){ |
||||
|
return Math.floor((Math.random()+1) * 65536).toString(16).substring(1); |
||||
|
} |
||||
|
return rand_gen() + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + rand_gen() + rand_gen(); |
||||
|
} |
||||
|
if(lang && !lang.localeCompare('pdf', 'en', {sensitivity: 'base'})){ |
||||
|
if(verify){ |
||||
|
return true; |
||||
|
}else{ |
||||
|
var divId = "markdown_code_pdf_container_" + unique_id_generator().toString(); |
||||
|
var container_list = new Array(); |
||||
|
if(localStorage.getItem('pdf_container_list')){ |
||||
|
container_list = JSON.parse(localStorage.getItem('pdf_container_list')); |
||||
|
} |
||||
|
container_list.push({"pdf_location": code, "div_id": divId}); |
||||
|
localStorage.setItem('pdf_container_list', JSON.stringify(container_list)); |
||||
|
return ( |
||||
|
'<div style="margin-top:'+ PDF_MARGIN_TOP +'; margin-bottom:'+ PDF_MARGIN_BOTTOM +';" id="'+ divId +'">' |
||||
|
+ '<a href="'+ code + '"> Link </a> to ' + code + |
||||
|
'</div>' |
||||
|
); |
||||
|
} |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
if(pdf_renderer(code, lang, true)){ |
||||
|
return pdf_renderer(code, lang, false); |
||||
|
} |
||||
|
/* SECTION START: Put other custom code rendering functions here |
||||
|
i.e. If the language of the code block is LaTex, |
||||
|
put the code below to replace original code block with the text: |
||||
|
'Using LaTex is much better than handwriting!' inside a div container. |
||||
|
|
||||
|
if (lang == "latex") { |
||||
|
return ('<div class="container">Using LaTex is much better than handwriting!</div>'); |
||||
|
} |
||||
|
|
||||
|
SECTION END */ |
||||
|
return (base ? base : this.origin.code.apply(this, arguments)); |
||||
|
} |
||||
|
|
||||
|
var pdf_renderer = {code: renderer_func}; |
||||
|
var doc_md = window.$docsify.markdown = (window.$docsify.markdown || {}); |
||||
|
var doc_md_rend = doc_md.renderer = (window.$docsify.markdown.renderer || {}); |
||||
|
doc_md_rend.code = (doc_md_rend.code ? doc_md_rend.code : renderer_func); |
||||
|
|
||||
|
var mobile_view = mobile_check(); |
||||
|
|
||||
|
// Allowing Docsify to execute the script to embed PDF
|
||||
|
window.$docsify.executeScript = true; |
||||
|
|
||||
|
// Linking Docsify to the PDF plugin
|
||||
|
window.$docsify.plugins = [ |
||||
|
function(hook, vm) { |
||||
|
hook.init(function() { |
||||
|
verbose_log('PDF Code Block Loader Plugin Initialized'); |
||||
|
verbose_log('This is a '.concat(mobile_view ? 'Mobile' : 'Non-mobile').concat(' Viewer.')); |
||||
|
}); |
||||
|
hook.afterEach(function(html, next) { |
||||
|
verbose_log('PDF Code Block Loader Plugin After Hook Initialized'); |
||||
|
container_list = JSON.parse(localStorage.getItem('pdf_container_list')); |
||||
|
verbose_log(container_list); |
||||
|
if(container_list){ |
||||
|
// Handling mobile pdf rendering
|
||||
|
if(mobile_view){ |
||||
|
html += '<script>'; |
||||
|
container_list.forEach(function(container){ |
||||
|
var absolute_pdf_location = url_check(container['pdf_location']) ? container['pdf_location'] : build_absolute_path(container['pdf_location']); |
||||
|
var view_location = "https://mozilla.github.io/pdf.js/web/viewer.html?file=" + absolute_pdf_location; |
||||
|
var iframe_id = container['div_id'].concat('-iframe'); |
||||
|
html += '\ |
||||
|
document.getElementById("'+ container['div_id'] +'").innerHTML = \ |
||||
|
\'<iframe \ |
||||
|
style="overflow: auto; width: '+ PDF_VIEWER_WIDTH +'; height: '+ PDF_VIEWER_HEIGHT +';"\ |
||||
|
id="'+ iframe_id +'"\ |
||||
|
src="'+ view_location +'"\ |
||||
|
style="border: none;" \ |
||||
|
\/>\'\ |
||||
|
;'; |
||||
|
}); |
||||
|
html += '<\/script>'; |
||||
|
}else{ |
||||
|
// Handling desktop pdf rendering
|
||||
|
html += '<script>'; |
||||
|
container_list.forEach(function(container){ |
||||
|
html += '\ |
||||
|
var options = {\ |
||||
|
height: "'+ PDF_VIEWER_HEIGHT +'",\ |
||||
|
width: "'+ PDF_VIEWER_WIDTH +'"\ |
||||
|
};\ |
||||
|
PDFObject.embed("'+ container['pdf_location'] +'", "#'+ container['div_id'] +'", options);'; |
||||
|
}); |
||||
|
html += '<\/script>'; |
||||
|
} |
||||
|
} |
||||
|
localStorage.removeItem('pdf_container_list'); |
||||
|
next(html); |
||||
|
}); |
||||
|
} |
||||
|
].concat(window.$docsify.plugins || []) |
||||
|
}(); |
@ -0,0 +1,9 @@ |
|||||
|
/*! |
||||
|
* docsify-plugin-flexible-alerts |
||||
|
* v1.0.4 |
||||
|
* https://github.com/zanfab/docsify-plugin-flexible-alerts#readme
|
||||
|
* (c) 2019 Fabian Zankl |
||||
|
* MIT license |
||||
|
*/ |
||||
|
!function(){"use strict";function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var e;!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===o&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}}('@import url("https://use.fontawesome.com/releases/v5.6.3/css/solid.css");@import url("https://use.fontawesome.com/releases/v5.6.3/css/fontawesome.css");.alert{display:block;position:relative;word-wrap:break-word;word-break:break-word;padding:.75rem 1.25rem!important;margin-bottom:1rem!important}.alert>*{max-width:100%}.alert+.alert{margin-top:-.25rem!important}.alert:before{content:unset!important}.alert p{margin-top:.5rem;margin-bottom:.5rem}.alert i{margin-right:.5rem}.alert .title{font-weight:600;margin:0}.alert>:first-child{margin-top:0}.alert>:last-child{margin-bottom:0}.alert.callout{border:1px solid #eee;border-left-width:.25rem;border-radius:.25rem;background:#fff}.alert.callout.warning{border-left-color:#f0ad4e!important}.alert.callout.warning .title{color:#f0ad4e}.alert.callout.tip{border-left-color:#28a745!important}.alert.callout.tip .title{color:#28a745}.alert.callout.info{border-left-color:#17a2b8!important}.alert.callout.info .title{color:#17a2b8}.alert.callout.danger{border-left-color:#dc3545!important}.alert.callout.danger .title{color:#dc3545}.alert.flat{border-radius:.125rem;color:#383d41;background-color:#e2e3e5;border:1px solid #d6d8db}.alert.flat.info{color:#02587f;background-color:#cdeefd;border-color:#b8e7fc}.alert.flat.info .title{color:#01354d}.alert.flat.tip{color:#285b2a;background-color:#dbefdc;border-color:#cde9ce}.alert.flat.tip .title{color:#18381a}.alert.flat.warning{color:#852d12;background-color:#ffddd3;border-color:#ffd0c1}.alert.flat.warning .title{color:#581e0c}.alert.flat.danger{color:#7f231c;background-color:#fdd9d7;border-color:#fccac7}.alert.flat.danger .title{color:#551713}'),e={style:"callout",note:{label:"Note",icon:"fas fa-info-circle",className:"info"},tip:{label:"Tip",icon:"fas fa-lightbulb",className:"tip"},warning:{label:"Warning",icon:"fas fa-exclamation-triangle",className:"warning"},danger:{label:"Attention",icon:"fas fa-ban",className:"danger"}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[].concat(function(t,b){function m(t,e,o,r){var a=(t||"").match(new RegExp("".concat(e,":(([\\s\\w\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF-]*))")));return a?r?r(a[1]):a[1]:r?r(o):o}var p=function t(e,o,r){var a=2<arguments.length&&void 0!==r?r:0;for(var l in o)try{o[l].constructor===Object&&a<1?e[l]=t(e[l],o[l],a+1):e[l]=o[l]}catch(t){e[l]=o[l]}return e}(e,b.config["flexible-alerts"]||b.config.flexibleAlerts);t.afterEach(function(t,e){e(t.replace(/<\s*blockquote[^>]*>(?:<p>|[\S\n]*)?\[!(\w*)((?:\|[\w*:[\s\w\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF-]*)*?)\]([\s\S]*?)(?:<\/p>)?<\s*\/\s*blockquote>/g,function(t,e,o,r){var a=p[e.toLowerCase()];if(!a)return t;var l=m(o,"style",p.style),n=m(o,"iconVisibility","visible",function(t){return"hidden"!==t}),c=m(o,"labelVisibility","visible",function(t){return"hidden"!==t}),i=m(o,"label",a.label),d=m(o,"icon",a.icon),s=m(o,"className",a.className);if("object"===g(i)){var f=Object.keys(i).filter(function(t){return-1<b.route.path.indexOf(t)});f&&0<f.length?i=i[f[0]]:n=c=!1}var u='<i class="'.concat(d,'"></i>');return'<div class="alert '.concat(l," ").concat(s,'">\n <p class="title">\n ').concat(n?u:"","\n ").concat(c?i:"","\n </p>\n <p>").concat(r,"</p>\n </div>")}))})},window.$docsify.plugins)}(); |
||||
|
//# sourceMappingURL=docsify-plugin-flexible-alerts.min.js.map
|
@ -0,0 +1 @@ |
|||||
|
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),window.$docsify||(window.$docsify={}),window.$docsify.plugins=(window.$docsify.plugins||[]).concat(function(e,t){const n=Object.assign({},{tag:"remoteMarkdownUrl"},t.config.remoteMarkdown);e.beforeEach(function(e,t){const r=new RegExp(`\\[${n.tag}\\]\\((http|https://.+)\\)`),o=e.match(r);if(o&&o[1]){const n=o[1];(i=n,Promise.resolve().then(()=>fetch(i)).then(e=>{if(!e.ok)throw new Error("HTTP error, status = "+e.status);return e.text()})).then(n=>t(e.replace(r,`\n ${n} \n`))).catch(e=>console.error(e))}else t(e);var i})})}]); |
@ -0,0 +1,9 @@ |
|||||
|
/*! |
||||
|
* docsify-valine |
||||
|
* v1.0.2 |
||||
|
* https://github.com/daidi/docsify-valine#readme
|
||||
|
* (c) 2019-2020 daidi |
||||
|
* MIT license |
||||
|
*/ |
||||
|
"use strict";window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(n,i){n.ready((function(){window.Valine||console.warn("please include `<script src='//unpkg.com/valine/dist/Valine.min.js'><\/script>` before init $docsify")})),n.mounted((function(){var n=Docsify.dom,i=n.create("div");i.id="vcomments";var e=n.getNode("#main");i.style="width: "+e.clientWidth+"px !important; margin: 0 3.2%;",n.appendTo(n.find(".content"),i)})),n.doneEach((function(){i.config.Valine=i.config.Valine||{};var n=Object.assign({el:"#vcomments",path:location.hash.replace(/\?.+/,"")},i.config.Valine);n.appId&&n.appKey?new Valine(n):console.warn("sorry , appId and appKey must be required .")}))}].concat(window.$docsify.plugins||[]); |
||||
|
//# sourceMappingURL=docsify-valine.min.js.map
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
!function(){function e(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(o){o.doneEach(e)},window.$docsify.plugins)}(); |
@ -0,0 +1,141 @@ |
|||||
|
window.human = false; |
||||
|
|
||||
|
var canvasEl = document.querySelector('.fireworks'); |
||||
|
var ctx = canvasEl.getContext('2d'); |
||||
|
var numberOfParticules = Number(location.href.split('?')[1]) || 40; |
||||
|
var pointerX = 0; |
||||
|
var pointerY = 0; |
||||
|
var tap = ('ontouchstart' in window || navigator.msMaxTouchPoints) ? 'touchstart' : 'contextmenu'; |
||||
|
var colors = ['#FF1461', '#18FF92', '#5A87FF', '#FBF38C']; |
||||
|
|
||||
|
function setCanvasSize() { |
||||
|
canvasEl.width = window.innerWidth * 2; |
||||
|
canvasEl.height = window.innerHeight * 2; |
||||
|
canvasEl.style.width = window.innerWidth + 'px'; |
||||
|
canvasEl.style.height = window.innerHeight + 'px'; |
||||
|
canvasEl.getContext('2d').scale(2, 2); |
||||
|
} |
||||
|
|
||||
|
function updateCoords(e) { |
||||
|
pointerX = e.clientX || e.touches[0].clientX; |
||||
|
pointerY = e.clientY || e.touches[0].clientY; |
||||
|
} |
||||
|
|
||||
|
function setParticuleDirection(p) { |
||||
|
var angle = anime.random(0, 360) * Math.PI / 180; |
||||
|
var value = anime.random(50, 180); |
||||
|
var radius = [-1, 1][anime.random(0, 1)] * value; |
||||
|
return { |
||||
|
x: p.x + radius * Math.cos(angle), |
||||
|
y: p.y + radius * Math.sin(angle) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function createParticule(x, y) { |
||||
|
var p = {}; |
||||
|
p.x = x; |
||||
|
p.y = y; |
||||
|
p.color = colors[anime.random(0, colors.length - 1)]; |
||||
|
p.radius = anime.random(16, 32); |
||||
|
p.endPos = setParticuleDirection(p); |
||||
|
p.draw = function() { |
||||
|
ctx.beginPath(); |
||||
|
ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true); |
||||
|
ctx.fillStyle = p.color; |
||||
|
ctx.fill(); |
||||
|
} |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
function createCircle(x, y) { |
||||
|
var p = {}; |
||||
|
p.x = x; |
||||
|
p.y = y; |
||||
|
p.color = '#FFF'; |
||||
|
p.radius = 0.1; |
||||
|
p.alpha = .5; |
||||
|
p.lineWidth = 6; |
||||
|
p.draw = function() { |
||||
|
ctx.globalAlpha = p.alpha; |
||||
|
ctx.beginPath(); |
||||
|
ctx.arc(p.x, p.y, p.radius, 0, 2 * Math.PI, true); |
||||
|
ctx.lineWidth = p.lineWidth; |
||||
|
ctx.strokeStyle = p.color; |
||||
|
ctx.stroke(); |
||||
|
ctx.globalAlpha = 1; |
||||
|
} |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
function renderParticule(anim) { |
||||
|
for (var i = 0; i < anim.animatables.length; i++) { |
||||
|
anim.animatables[i].target.draw(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function animateParticules(x, y) { |
||||
|
var circle = createCircle(x, y); |
||||
|
var particules = []; |
||||
|
for (var i = 0; i < numberOfParticules; i++) { |
||||
|
particules.push(createParticule(x, y)); |
||||
|
} |
||||
|
anime.timeline().add({ |
||||
|
targets: particules, |
||||
|
x: function(p) { |
||||
|
return p.endPos.x; |
||||
|
}, |
||||
|
y: function(p) { |
||||
|
return p.endPos.y; |
||||
|
}, |
||||
|
radius: 0.1, |
||||
|
duration: anime.random(1200, 1800), |
||||
|
easing: 'easeOutExpo', |
||||
|
update: renderParticule |
||||
|
}) |
||||
|
.add({ |
||||
|
targets: circle, |
||||
|
radius: anime.random(80, 160), |
||||
|
lineWidth: 0, |
||||
|
alpha: { |
||||
|
value: 0, |
||||
|
easing: 'linear', |
||||
|
duration: anime.random(600, 800), |
||||
|
}, |
||||
|
duration: anime.random(1200, 1800), |
||||
|
easing: 'easeOutExpo', |
||||
|
update: renderParticule, |
||||
|
offset: 0 |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
var render = anime({ |
||||
|
duration: Infinity, |
||||
|
update: function() { |
||||
|
ctx.clearRect(0, 0, canvasEl.width, canvasEl.height); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
document.addEventListener(tap, function(e) { |
||||
|
window.human = true; |
||||
|
render.play(); |
||||
|
updateCoords(e); |
||||
|
animateParticules(pointerX, pointerY); |
||||
|
}, false); |
||||
|
|
||||
|
var centerX = window.innerWidth / 2; |
||||
|
var centerY = window.innerHeight / 2; |
||||
|
|
||||
|
function autoClick() { |
||||
|
if (window.human) return; |
||||
|
animateParticules( |
||||
|
anime.random(centerX - 50, centerX + 50), |
||||
|
anime.random(centerY - 50, centerY + 50) |
||||
|
); |
||||
|
anime({ |
||||
|
duration: 200 |
||||
|
}).finished.then(autoClick); |
||||
|
} |
||||
|
|
||||
|
// autoClick();
|
||||
|
setCanvasSize(); |
||||
|
window.addEventListener('resize', setCanvasSize, false); |
@ -0,0 +1,56 @@ |
|||||
|
;(function(window) { |
||||
|
window.DocsifyCodefund = { |
||||
|
scriptEl: null, |
||||
|
create: function(codefundId) { |
||||
|
return function(hook, vm) { |
||||
|
hook.ready(function() { |
||||
|
window.DocsifyCodefund.injectCodeFundStyle(); |
||||
|
}) |
||||
|
|
||||
|
hook.doneEach(function () { |
||||
|
window.DocsifyCodefund.injectCodeFundScript(codefundId); |
||||
|
window.DocsifyCodefund.injectCodeFundContainer(); |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
injectCodeFundContainer() { |
||||
|
if (document.getElementById("codefund") === null) { |
||||
|
let nav = document.getElementsByClassName('sidebar-nav'); |
||||
|
let codefundContainer = document.createElement('div'); |
||||
|
codefundContainer.id = 'codefund'; |
||||
|
nav[0].insertBefore(codefundContainer, nav[0].firstChild); |
||||
|
} |
||||
|
|
||||
|
if (document.getElementsByClassName('cf-wrapper').length === 0) { |
||||
|
window._codefund && window._codefund.serve(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
injectCodeFundScript(codefundId) { |
||||
|
if (window.DocsifyCodefund.scriptEl) { |
||||
|
window.DocsifyCodefund.scriptEl.remove() |
||||
|
} |
||||
|
|
||||
|
var script = document.createElement('script') |
||||
|
script.src = "https://codefund.io/properties/" + codefundId + "/funder.js?template=docsify" |
||||
|
script.async = "async" |
||||
|
document.body.appendChild(script) |
||||
|
window.DocsifyCodefund.scriptEl = script |
||||
|
}, |
||||
|
|
||||
|
injectCodeFundStyle() { |
||||
|
var style = document.createElement('style'); |
||||
|
window.DocsifyCodefund.injectCodeFundContainer(); |
||||
|
var css = '#cf span.cf-wrapper { background-color: transparent!important } #cf a.cf-text { color: #444!important; font-weight: 400!important; font-size: 10px!important }'; |
||||
|
|
||||
|
style.type = 'text/css'; |
||||
|
if (style.styleSheet){ |
||||
|
style.styleSheet.cssText = css; |
||||
|
} else { |
||||
|
style.appendChild(document.createTextNode(css)); |
||||
|
} |
||||
|
document.head.appendChild(style); |
||||
|
} |
||||
|
} |
||||
|
})(window) |
@ -0,0 +1,262 @@ |
|||||
|
/* |
||||
|
* |
||||
|
* Copyright (c) 2014-2018 Daniele Lenares (https://github.com/dnlnrs)
|
||||
|
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
|
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
|
* |
||||
|
* Version 1.1.3 |
||||
|
* |
||||
|
*/ |
||||
|
(function ($) { |
||||
|
|
||||
|
'use strict'; |
||||
|
|
||||
|
/** |
||||
|
* Animate the input object |
||||
|
* |
||||
|
* @param $obj |
||||
|
* @param type |
||||
|
* @param animation |
||||
|
*/ |
||||
|
function do_animation($obj, type, animation) { |
||||
|
if (type === 'show') { |
||||
|
switch (animation) { |
||||
|
case 'fade': |
||||
|
$obj.fadeIn(); |
||||
|
break; |
||||
|
|
||||
|
case 'slide': |
||||
|
$obj.slideDown(); |
||||
|
break; |
||||
|
|
||||
|
default: |
||||
|
$obj.fadeIn(); |
||||
|
} |
||||
|
} else { |
||||
|
switch (animation) { |
||||
|
case 'fade': |
||||
|
$obj.fadeOut(); |
||||
|
break; |
||||
|
|
||||
|
case 'slide': |
||||
|
$obj.slideUp(); |
||||
|
break; |
||||
|
|
||||
|
default: |
||||
|
$obj.fadeOut(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Bind click event |
||||
|
* |
||||
|
* @param $obj |
||||
|
* @param speed |
||||
|
*/ |
||||
|
function click_event($obj, speed) { |
||||
|
var not_clicked = true; |
||||
|
$obj.on('click', function () { |
||||
|
if (not_clicked === true) { |
||||
|
not_clicked = false; |
||||
|
$('html, body').animate({scrollTop: 0}, speed, function () { |
||||
|
not_clicked = true; |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$.goup = function (user_params) { |
||||
|
|
||||
|
/* Default Params */ |
||||
|
var params = $.extend({ |
||||
|
location: 'right', |
||||
|
locationOffset: 20, |
||||
|
bottomOffset: 10, |
||||
|
containerSize: 40, |
||||
|
containerRadius: 10, |
||||
|
containerClass: 'goup-container', |
||||
|
arrowClass: 'goup-arrow', |
||||
|
alwaysVisible: false, |
||||
|
trigger: 500, |
||||
|
entryAnimation: 'fade', |
||||
|
goupSpeed: 'slow', |
||||
|
hideUnderWidth: 500, |
||||
|
containerColor: '#42B983', |
||||
|
arrowColor: '#fff', |
||||
|
title: '', |
||||
|
titleAsText: false, |
||||
|
titleAsTextClass: 'goup-text', |
||||
|
zIndex: 1 |
||||
|
}, user_params); |
||||
|
/* */ |
||||
|
|
||||
|
/* Parameters check */ |
||||
|
if (params.location !== 'right' && params.location !== 'left') { |
||||
|
params.location = 'right'; |
||||
|
} |
||||
|
|
||||
|
if (params.locationOffset < 0) { |
||||
|
params.locationOffset = 0; |
||||
|
} |
||||
|
|
||||
|
if (params.bottomOffset < 0) { |
||||
|
params.bottomOffset = 0; |
||||
|
} |
||||
|
|
||||
|
if (params.containerSize < 20) { |
||||
|
params.containerSize = 20; |
||||
|
} |
||||
|
|
||||
|
if (params.containerRadius < 0) { |
||||
|
params.containerRadius = 0; |
||||
|
} |
||||
|
|
||||
|
if (params.trigger < 0) { |
||||
|
params.trigger = 0; |
||||
|
} |
||||
|
|
||||
|
if (params.hideUnderWidth < 0) { |
||||
|
params.hideUnderWidth = 0; |
||||
|
} |
||||
|
|
||||
|
var checkColor = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i; |
||||
|
if (!checkColor.test(params.containerColor)) { |
||||
|
params.containerColor = '#000'; |
||||
|
} |
||||
|
if (!checkColor.test(params.arrowColor)) { |
||||
|
params.arrowColor = '#fff'; |
||||
|
} |
||||
|
|
||||
|
if (params.title === '') { |
||||
|
params.titleAsText = false; |
||||
|
} |
||||
|
|
||||
|
if (isNaN(params.zIndex)) { |
||||
|
params.zIndex = 1; |
||||
|
} |
||||
|
/* */ |
||||
|
|
||||
|
/* Create required elements */ |
||||
|
var $body = $('body'); |
||||
|
var $window = $(window); |
||||
|
|
||||
|
var $container = $('<div>'); |
||||
|
$container.addClass(params.containerClass); |
||||
|
var $arrow = $('<div>'); |
||||
|
$arrow.addClass(params.arrowClass); |
||||
|
|
||||
|
$container.html($arrow); |
||||
|
|
||||
|
$body.append($container); |
||||
|
|
||||
|
|
||||
|
/* Container Style */ |
||||
|
var containerStyle = { |
||||
|
position: 'fixed', |
||||
|
width: params.containerSize, |
||||
|
height: params.containerSize, |
||||
|
background: params.containerColor, |
||||
|
cursor: 'pointer', |
||||
|
display: 'none', |
||||
|
'z-index': params.zIndex |
||||
|
}; |
||||
|
containerStyle['bottom'] = params.bottomOffset; |
||||
|
containerStyle[params.location] = params.locationOffset; |
||||
|
containerStyle['border-radius'] = params.containerRadius; |
||||
|
|
||||
|
$container.css(containerStyle); |
||||
|
|
||||
|
if (!params.titleAsText) { |
||||
|
$container.attr('title', params.title); |
||||
|
} else { |
||||
|
var $textContainer = $('<div>'); |
||||
|
$body.append($textContainer); |
||||
|
$textContainer.addClass(params.titleAsTextClass).text(params.title); |
||||
|
$textContainer.attr('style', $container.attr('style')); |
||||
|
$textContainer.css('background', 'transparent') |
||||
|
.css('width', params.containerSize + 40) |
||||
|
.css('height', 'auto') |
||||
|
.css('text-align', 'center') |
||||
|
.css(params.location, params.locationOffset - 20); |
||||
|
var textContainerHeight = parseInt($textContainer.height()) + 10; |
||||
|
var containerBottom = parseInt($container.css('bottom')); |
||||
|
var containerNewBottom = textContainerHeight + containerBottom; |
||||
|
$container.css('bottom', containerNewBottom); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Arrow Style */ |
||||
|
var borderSize = 0.25 * params.containerSize; |
||||
|
var arrowStyle = { |
||||
|
width: 0, |
||||
|
height: 0, |
||||
|
margin: '0 auto', |
||||
|
'padding-top': Math.ceil(0.325 * params.containerSize), |
||||
|
'border-style': 'solid', |
||||
|
'border-width': '0 ' + borderSize + 'px ' + borderSize + 'px ' + borderSize + 'px', |
||||
|
'border-color': 'transparent transparent ' + params.arrowColor + ' transparent' |
||||
|
}; |
||||
|
$arrow.css(arrowStyle); |
||||
|
/* */ |
||||
|
|
||||
|
|
||||
|
/* params.trigger Hide under a certain width */ |
||||
|
var isHidden = false; |
||||
|
$window.resize(function () { |
||||
|
if ($window.outerWidth() <= params.hideUnderWidth) { |
||||
|
isHidden = true; |
||||
|
do_animation($container, 'hide', params.entryAnimation); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
do_animation($textContainer, 'hide', params.entryAnimation); |
||||
|
} |
||||
|
} else { |
||||
|
isHidden = false; |
||||
|
$window.trigger('scroll'); |
||||
|
} |
||||
|
}); |
||||
|
/* If i load the page under a certain width, i don't have the event 'resize' */ |
||||
|
if ($window.outerWidth() <= params.hideUnderWidth) { |
||||
|
isHidden = true; |
||||
|
$container.hide(); |
||||
|
if (typeof($textContainer) !== 'undefined') |
||||
|
$textContainer.hide(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* params.trigger show event */ |
||||
|
if (!params.alwaysVisible) { |
||||
|
$window.scroll(function () { |
||||
|
if ($window.scrollTop() >= params.trigger && !isHidden) { |
||||
|
do_animation($container, 'show', params.entryAnimation); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
do_animation($textContainer, 'show', params.entryAnimation); |
||||
|
} |
||||
|
} else { |
||||
|
do_animation($container, 'hide', params.entryAnimation); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
do_animation($textContainer, 'hide', params.entryAnimation); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
do_animation($container, 'show', params.entryAnimation); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
do_animation($textContainer, 'show', params.entryAnimation); |
||||
|
} |
||||
|
} |
||||
|
/* If i load the page and the scroll is over the trigger, i don't have immediately the event 'scroll' */ |
||||
|
if ($window.scrollTop() >= params.trigger && !isHidden) { |
||||
|
do_animation($container, 'show', params.entryAnimation); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
do_animation($textContainer, 'show', params.entryAnimation); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
click_event($container, params.goupSpeed); |
||||
|
if (typeof($textContainer) !== 'undefined') { |
||||
|
click_event($textContainer, params.goupSpeed); |
||||
|
} |
||||
|
}; |
||||
|
}(jQuery)); |
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
var bszCaller,bszTag;!function(){var c,d,e,a=!1,b=[];ready=function(c){return a||"interactive"===document.readyState||"complete"===document.readyState?c.call(document):b.push(function(){return c.call(this)}),this},d=function(){for(var a=0,c=b.length;c>a;a++)b[a].apply(document);b=[]},e=function(){a||(a=!0,d.call(window),document.removeEventListener?document.removeEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.detachEvent("onreadystatechange",e),window==window.top&&(clearInterval(c),c=null)))},document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){/loaded|complete/.test(document.readyState)&&e()}),window==window.top&&(c=setInterval(function(){try{a||document.documentElement.doScroll("left")}catch(b){return}e()},5)))}(),bszCaller={fetch:function(a,b){var c="BusuanziCallback_"+Math.floor(1099511627776*Math.random());window[c]=this.evalCall(b),a=a.replace("=BusuanziCallback","="+c),scriptTag=document.createElement("SCRIPT"),scriptTag.type="text/javascript",scriptTag.defer=!0,scriptTag.src=a,document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)},evalCall:function(a){return function(b){ready(function(){try{a(b),scriptTag.parentElement.removeChild(scriptTag)}catch(c){bszTag.hides()}})}}},bszCaller.fetch("//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback",function(a){bszTag.texts(a),bszTag.shows()}),bszTag={bszs:["site_pv","page_pv","site_uv"],texts:function(a){this.bszs.map(function(b){var c=document.getElementById("busuanzi_value_"+b);c&&(c.innerHTML=a[b])})},hides:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="none")})},shows:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="inline")})}}; |
@ -0,0 +1,60 @@ |
|||||
|
//default values
|
||||
|
var defaultOptions = { |
||||
|
countable: true, |
||||
|
position: "top", |
||||
|
margin: "10px", |
||||
|
float: "right", |
||||
|
fontsize: "0.9em", |
||||
|
color: "rgb(90,90,90)", |
||||
|
language: "english", |
||||
|
isExpected: true, |
||||
|
} |
||||
|
|
||||
|
// Docsify plugin functions
|
||||
|
function plugin(hook, vm) { |
||||
|
if (!defaultOptions.countable) { |
||||
|
return |
||||
|
} |
||||
|
let wordsCount |
||||
|
hook.beforeEach(function (content) { |
||||
|
// Match regex every time you start parsing .md
|
||||
|
wordsCount = content.match(/([\u4e00-\u9fa5]+?|[a-zA-Z0-9]+)/g).length |
||||
|
return content |
||||
|
}) |
||||
|
hook.afterEach(function (html, next) { |
||||
|
let str = wordsCount + " words" |
||||
|
let readTime = Math.ceil(wordsCount / 400) + " min" |
||||
|
//Determine whether to use the Chinese style according to the attribute "language"
|
||||
|
if (defaultOptions.language === "chinese") { |
||||
|
str = wordsCount + " 字" |
||||
|
readTime = Math.ceil(wordsCount / 400) + " 分钟" |
||||
|
} |
||||
|
|
||||
|
//add html string
|
||||
|
next( |
||||
|
` |
||||
|
${defaultOptions.position === "bottom" ? html : ""} |
||||
|
<div style="margin-${defaultOptions.position ? "bottom" : "top"}: ${ |
||||
|
defaultOptions.margin |
||||
|
};"> |
||||
|
<span style=" |
||||
|
float: ${defaultOptions.float === "right" ? "right" : "left"}; |
||||
|
font-size: ${defaultOptions.fontsize}; |
||||
|
color:${defaultOptions.color};"> |
||||
|
${str} |
||||
|
${defaultOptions.isExpected ? ` | ${readTime}` : ""} |
||||
|
</span> |
||||
|
<div style="clear: both"></div> |
||||
|
</div> |
||||
|
${defaultOptions.position !== "bottom" ? html : ""} |
||||
|
` |
||||
|
) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// Docsify plugin options
|
||||
|
window.$docsify["count"] = Object.assign( |
||||
|
defaultOptions, |
||||
|
window.$docsify["count"] |
||||
|
) |
||||
|
window.$docsify.plugins = [].concat(plugin, window.$docsify.plugins) |
@ -0,0 +1,76 @@ |
|||||
|
(function (Prism) { |
||||
|
|
||||
|
// https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
|
||||
|
// https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
|
||||
|
var anchorOrAlias = /[*&][^\s[\]{},]+/; |
||||
|
// https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
|
||||
|
var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/; |
||||
|
// https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
|
||||
|
var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|' |
||||
|
+ anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)'; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param {string} value |
||||
|
* @param {string} [flags] |
||||
|
* @returns {RegExp} |
||||
|
*/ |
||||
|
function createValuePattern(value, flags) { |
||||
|
flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
|
||||
|
var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|\s*#))/.source |
||||
|
.replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; }); |
||||
|
return RegExp(pattern, flags) |
||||
|
} |
||||
|
|
||||
|
Prism.languages.yaml = { |
||||
|
'scalar': { |
||||
|
pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/.source |
||||
|
.replace(/<<prop>>/g, function () { return properties; })), |
||||
|
lookbehind: true, |
||||
|
alias: 'string' |
||||
|
}, |
||||
|
'comment': /#.*/, |
||||
|
'key': { |
||||
|
pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)[^\r\n{[\]},#\s]+?(?=\s*:\s)/.source |
||||
|
.replace(/<<prop>>/g, function () { return properties; })), |
||||
|
lookbehind: true, |
||||
|
alias: 'atrule' |
||||
|
}, |
||||
|
'directive': { |
||||
|
pattern: /(^[ \t]*)%.+/m, |
||||
|
lookbehind: true, |
||||
|
alias: 'important' |
||||
|
}, |
||||
|
'datetime': { |
||||
|
pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source), |
||||
|
lookbehind: true, |
||||
|
alias: 'number' |
||||
|
}, |
||||
|
'boolean': { |
||||
|
pattern: createValuePattern(/true|false/.source, 'i'), |
||||
|
lookbehind: true, |
||||
|
alias: 'important' |
||||
|
}, |
||||
|
'null': { |
||||
|
pattern: createValuePattern(/null|~/.source, 'i'), |
||||
|
lookbehind: true, |
||||
|
alias: 'important' |
||||
|
}, |
||||
|
'string': { |
||||
|
// \2 because of the lookbehind group
|
||||
|
pattern: createValuePattern(/("|')(?:(?!\2)[^\\\r\n]|\\.)*\2/.source), |
||||
|
lookbehind: true, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'number': { |
||||
|
pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'), |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'tag': tag, |
||||
|
'important': anchorOrAlias, |
||||
|
'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./ |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.yml = Prism.languages.yaml; |
||||
|
|
||||
|
}(Prism)); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,20 @@ |
|||||
|
/* |
||||
|
PDFObject v2.1.1 |
||||
|
https://github.com/pipwerks/PDFObject
|
||||
|
Copyright (c) 2008-2018 Philip Hutchison |
||||
|
MIT-style license: http://pipwerks.mit-license.org/
|
||||
|
UMD module pattern from https://github.com/umdjs/umd/blob/master/templates/returnExports.js
|
||||
|
*/ |
||||
|
|
||||
|
(function(root,factory){if(typeof define==='function'&&define.amd){define([],factory);}else if(typeof module==='object'&&module.exports){module.exports=factory();}else{root.PDFObject=factory();}}(this,function(){"use strict";if(typeof window==="undefined"||typeof navigator==="undefined"){return false;} |
||||
|
var pdfobjectversion="2.1.1",ua=window.navigator.userAgent,supportsPDFs,isIE,supportsPdfMimeType=(typeof navigator.mimeTypes['application/pdf']!=="undefined"),supportsPdfActiveX,isModernBrowser=(function(){return(typeof window.Promise!=="undefined");})(),isFirefox=(function(){return(ua.indexOf("irefox")!==-1);})(),isFirefoxWithPDFJS=(function(){if(!isFirefox){return false;} |
||||
|
return(parseInt(ua.split("rv:")[1].split(".")[0],10)>18);})(),isIOS=(function(){return(/iphone|ipad|ipod/i.test(ua.toLowerCase()));})(),createAXO,buildFragmentString,log,embedError,embed,getTargetElement,generatePDFJSiframe,generateEmbedElement;createAXO=function(type){var ax;try{ax=new ActiveXObject(type);}catch(e){ax=null;} |
||||
|
return ax;};isIE=function(){return!!(window.ActiveXObject||"ActiveXObject"in window);};supportsPdfActiveX=function(){return!!(createAXO("AcroPDF.PDF")||createAXO("PDF.PdfCtrl"));};supportsPDFs=(!isIOS&&(isFirefoxWithPDFJS||supportsPdfMimeType||(isIE()&&supportsPdfActiveX())));buildFragmentString=function(pdfParams){var string="",prop;if(pdfParams){for(prop in pdfParams){if(pdfParams.hasOwnProperty(prop)){string+=encodeURIComponent(prop)+"="+encodeURIComponent(pdfParams[prop])+"&";}} |
||||
|
if(string){string="#"+string;string=string.slice(0,string.length-1);}} |
||||
|
return string;};log=function(msg){if(typeof console!=="undefined"&&console.log){console.log("[PDFObject] "+msg);}};embedError=function(msg){log(msg);return false;};getTargetElement=function(targetSelector){var targetNode=document.body;if(typeof targetSelector==="string"){targetNode=document.querySelector(targetSelector);}else if(typeof jQuery!=="undefined"&&targetSelector instanceof jQuery&&targetSelector.length){targetNode=targetSelector.get(0);}else if(typeof targetSelector.nodeType!=="undefined"&&targetSelector.nodeType===1){targetNode=targetSelector;} |
||||
|
return targetNode;};generatePDFJSiframe=function(targetNode,url,pdfOpenFragment,PDFJS_URL,id){var fullURL=PDFJS_URL+"?file="+encodeURIComponent(url)+pdfOpenFragment;var scrollfix=(isIOS)?"-webkit-overflow-scrolling: touch; overflow-y: scroll; ":"overflow: hidden; ";var iframe="<div style='"+scrollfix+"position: absolute; top: 0; right: 0; bottom: 0; left: 0;'><iframe "+id+" src='"+fullURL+"' style='border: none; width: 100%; height: 100%;' frameborder='0'></iframe></div>";targetNode.className+=" pdfobject-container";targetNode.style.position="relative";targetNode.style.overflow="auto";targetNode.innerHTML=iframe;return targetNode.getElementsByTagName("iframe")[0];};generateEmbedElement=function(targetNode,targetSelector,url,pdfOpenFragment,width,height,id){var style="";if(targetSelector&&targetSelector!==document.body){style="width: "+width+"; height: "+height+";";}else{style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;";} |
||||
|
targetNode.className+=" pdfobject-container";targetNode.innerHTML="<embed "+id+" class='pdfobject' src='"+url+pdfOpenFragment+"' type='application/pdf' style='overflow: auto; "+style+"'/>";return targetNode.getElementsByTagName("embed")[0];};embed=function(url,targetSelector,options){if(typeof url!=="string"){return embedError("URL is not valid");} |
||||
|
targetSelector=(typeof targetSelector!=="undefined")?targetSelector:false;options=(typeof options!=="undefined")?options:{};var id=(options.id&&typeof options.id==="string")?"id='"+options.id+"'":"",page=(options.page)?options.page:false,pdfOpenParams=(options.pdfOpenParams)?options.pdfOpenParams:{},fallbackLink=(typeof options.fallbackLink!=="undefined")?options.fallbackLink:true,width=(options.width)?options.width:"100%",height=(options.height)?options.height:"100%",assumptionMode=(typeof options.assumptionMode==="boolean")?options.assumptionMode:true,forcePDFJS=(typeof options.forcePDFJS==="boolean")?options.forcePDFJS:false,PDFJS_URL=(options.PDFJS_URL)?options.PDFJS_URL:false,targetNode=getTargetElement(targetSelector),fallbackHTML="",pdfOpenFragment="",fallbackHTML_default="<p>This browser does not support inline PDFs. Please download the PDF to view it: <a href='[url]'>Download PDF</a></p>";if(!targetNode){return embedError("Target element cannot be determined");} |
||||
|
if(page){pdfOpenParams.page=page;} |
||||
|
pdfOpenFragment=buildFragmentString(pdfOpenParams);if(forcePDFJS&&PDFJS_URL){return generatePDFJSiframe(targetNode,url,pdfOpenFragment,PDFJS_URL,id);}else if(supportsPDFs||(assumptionMode&&isModernBrowser&&!isIOS)){return generateEmbedElement(targetNode,targetSelector,url,pdfOpenFragment,width,height,id);}else if(PDFJS_URL){return generatePDFJSiframe(targetNode,url,pdfOpenFragment,PDFJS_URL,id);}else{if(fallbackLink){fallbackHTML=(typeof fallbackLink==="string")?fallbackLink:fallbackHTML_default;targetNode.innerHTML=fallbackHTML.replace(/\[url\]/g,url);} |
||||
|
return embedError("This browser does not support embedded PDFs");}};return{embed:function(a,b,c){return embed(a,b,c);},pdfobjectversion:(function(){return pdfobjectversion;})(),supportsPDFs:(function(){return supportsPDFs;})()};})); |
File diff suppressed because one or more lines are too long
@ -0,0 +1,36 @@ |
|||||
|
Prism.languages.c = Prism.languages.extend('clike', { |
||||
|
'class-name': { |
||||
|
pattern: /(\b(?:enum|struct)\s+)\w+/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, |
||||
|
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, |
||||
|
'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.insertBefore('c', 'string', { |
||||
|
'macro': { |
||||
|
// allow for multiline macro definitions
|
||||
|
// spaces after the # character compile fine with gcc
|
||||
|
pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im, |
||||
|
lookbehind: true, |
||||
|
alias: 'property', |
||||
|
inside: { |
||||
|
// highlight the path of the include statement as a string
|
||||
|
'string': { |
||||
|
pattern: /(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
// highlight macro directives as keywords
|
||||
|
'directive': { |
||||
|
pattern: /(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, |
||||
|
lookbehind: true, |
||||
|
alias: 'keyword' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// highlight predefined macros as constants
|
||||
|
'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ |
||||
|
}); |
||||
|
|
||||
|
delete Prism.languages.c['boolean']; |
@ -0,0 +1,21 @@ |
|||||
|
Prism.languages.cpp = Prism.languages.extend('c', { |
||||
|
'class-name': { |
||||
|
pattern: /(\b(?:class|enum|struct)\s+)\w+/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, |
||||
|
'number': { |
||||
|
pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, |
||||
|
'boolean': /\b(?:true|false)\b/ |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.insertBefore('cpp', 'string', { |
||||
|
'raw-string': { |
||||
|
pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, |
||||
|
alias: 'string', |
||||
|
greedy: true |
||||
|
} |
||||
|
}); |
@ -0,0 +1,57 @@ |
|||||
|
(function (Prism) { |
||||
|
|
||||
|
var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; |
||||
|
|
||||
|
Prism.languages.css = { |
||||
|
'comment': /\/\*[\s\S]*?\*\//, |
||||
|
'atrule': { |
||||
|
pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/, |
||||
|
inside: { |
||||
|
'rule': /@[\w-]+/ |
||||
|
// See rest below
|
||||
|
} |
||||
|
}, |
||||
|
'url': { |
||||
|
pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'), |
||||
|
inside: { |
||||
|
'function': /^url/i, |
||||
|
'punctuation': /^\(|\)$/ |
||||
|
} |
||||
|
}, |
||||
|
'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), |
||||
|
'string': { |
||||
|
pattern: string, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, |
||||
|
'important': /!important\b/i, |
||||
|
'function': /[-a-z0-9]+(?=\()/i, |
||||
|
'punctuation': /[(){};:,]/ |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.css['atrule'].inside.rest = Prism.languages.css; |
||||
|
|
||||
|
var markup = Prism.languages.markup; |
||||
|
if (markup) { |
||||
|
markup.tag.addInlined('style', 'css'); |
||||
|
|
||||
|
Prism.languages.insertBefore('inside', 'attr-value', { |
||||
|
'style-attr': { |
||||
|
pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, |
||||
|
inside: { |
||||
|
'attr-name': { |
||||
|
pattern: /^\s*style/i, |
||||
|
inside: markup.tag.inside |
||||
|
}, |
||||
|
'punctuation': /^\s*=\s*['"]|['"]\s*$/, |
||||
|
'attr-value': { |
||||
|
pattern: /.+/i, |
||||
|
inside: Prism.languages.css |
||||
|
} |
||||
|
}, |
||||
|
alias: 'language-css' |
||||
|
} |
||||
|
}, markup.tag); |
||||
|
} |
||||
|
|
||||
|
}(Prism)); |
@ -0,0 +1,129 @@ |
|||||
|
/** |
||||
|
* prism.js Dark theme for JavaScript, CSS and HTML |
||||
|
* Based on the slides of the talk “/Reg(exp){2}lained/” |
||||
|
* @author Lea Verou |
||||
|
*/ |
||||
|
|
||||
|
code[class*="language-"], |
||||
|
pre[class*="language-"] { |
||||
|
color: white; |
||||
|
background: none; |
||||
|
text-shadow: 0 -.1em .2em black; |
||||
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; |
||||
|
font-size: 1em; |
||||
|
text-align: left; |
||||
|
white-space: pre; |
||||
|
word-spacing: normal; |
||||
|
word-break: normal; |
||||
|
word-wrap: normal; |
||||
|
line-height: 1.5; |
||||
|
|
||||
|
-moz-tab-size: 4; |
||||
|
-o-tab-size: 4; |
||||
|
tab-size: 4; |
||||
|
|
||||
|
-webkit-hyphens: none; |
||||
|
-moz-hyphens: none; |
||||
|
-ms-hyphens: none; |
||||
|
hyphens: none; |
||||
|
} |
||||
|
|
||||
|
@media print { |
||||
|
code[class*="language-"], |
||||
|
pre[class*="language-"] { |
||||
|
text-shadow: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
pre[class*="language-"], |
||||
|
:not(pre) > code[class*="language-"] { |
||||
|
background: hsl(30, 20%, 25%); |
||||
|
} |
||||
|
|
||||
|
/* Code blocks */ |
||||
|
pre[class*="language-"] { |
||||
|
padding: 1em; |
||||
|
margin: .5em 0; |
||||
|
overflow: auto; |
||||
|
border: .3em solid hsl(30, 20%, 40%); |
||||
|
border-radius: .5em; |
||||
|
box-shadow: 1px 1px .5em black inset; |
||||
|
} |
||||
|
|
||||
|
/* Inline code */ |
||||
|
:not(pre) > code[class*="language-"] { |
||||
|
padding: .15em .2em .05em; |
||||
|
border-radius: .3em; |
||||
|
border: .13em solid hsl(30, 20%, 40%); |
||||
|
box-shadow: 1px 1px .3em -.1em black inset; |
||||
|
white-space: normal; |
||||
|
} |
||||
|
|
||||
|
.token.comment, |
||||
|
.token.prolog, |
||||
|
.token.doctype, |
||||
|
.token.cdata { |
||||
|
color: hsl(30, 20%, 50%); |
||||
|
} |
||||
|
|
||||
|
.token.punctuation { |
||||
|
opacity: .7; |
||||
|
} |
||||
|
|
||||
|
.token.namespace { |
||||
|
opacity: .7; |
||||
|
} |
||||
|
|
||||
|
.token.property, |
||||
|
.token.tag, |
||||
|
.token.boolean, |
||||
|
.token.number, |
||||
|
.token.constant, |
||||
|
.token.symbol { |
||||
|
color: hsl(350, 40%, 70%); |
||||
|
} |
||||
|
|
||||
|
.token.selector, |
||||
|
.token.attr-name, |
||||
|
.token.string, |
||||
|
.token.char, |
||||
|
.token.builtin, |
||||
|
.token.inserted { |
||||
|
color: hsl(75, 70%, 60%); |
||||
|
} |
||||
|
|
||||
|
.token.operator, |
||||
|
.token.entity, |
||||
|
.token.url, |
||||
|
.language-css .token.string, |
||||
|
.style .token.string, |
||||
|
.token.variable { |
||||
|
color: hsl(40, 90%, 60%); |
||||
|
} |
||||
|
|
||||
|
.token.atrule, |
||||
|
.token.attr-value, |
||||
|
.token.keyword { |
||||
|
color: hsl(350, 40%, 70%); |
||||
|
} |
||||
|
|
||||
|
.token.regex, |
||||
|
.token.important { |
||||
|
color: #e90; |
||||
|
} |
||||
|
|
||||
|
.token.important, |
||||
|
.token.bold { |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.token.italic { |
||||
|
font-style: italic; |
||||
|
} |
||||
|
|
||||
|
.token.entity { |
||||
|
cursor: help; |
||||
|
} |
||||
|
|
||||
|
.token.deleted { |
||||
|
color: red; |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
Prism.languages.docker = { |
||||
|
'keyword': { |
||||
|
pattern: /(^\s*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)/mi, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/, |
||||
|
'comment': /#.*/, |
||||
|
'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/ |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.dockerfile = Prism.languages.docker; |
@ -0,0 +1,63 @@ |
|||||
|
(function (Prism) { |
||||
|
|
||||
|
var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; |
||||
|
|
||||
|
// based on the java naming conventions
|
||||
|
var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/; |
||||
|
|
||||
|
Prism.languages.java = Prism.languages.extend('clike', { |
||||
|
'class-name': [ |
||||
|
className, |
||||
|
|
||||
|
// variables and parameters
|
||||
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
||||
|
/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/ |
||||
|
], |
||||
|
'keyword': keywords, |
||||
|
'function': [ |
||||
|
Prism.languages.clike.function, |
||||
|
{ |
||||
|
pattern: /(\:\:)[a-z_]\w*/, |
||||
|
lookbehind: true |
||||
|
} |
||||
|
], |
||||
|
'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, |
||||
|
'operator': { |
||||
|
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, |
||||
|
lookbehind: true |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.insertBefore('java', 'string', { |
||||
|
'triple-quoted-string': { |
||||
|
// http://openjdk.java.net/jeps/355#Description
|
||||
|
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, |
||||
|
greedy: true, |
||||
|
alias: 'string' |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.insertBefore('java', 'class-name', { |
||||
|
'annotation': { |
||||
|
alias: 'punctuation', |
||||
|
pattern: /(^|[^.])@\w+/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'namespace': { |
||||
|
pattern: /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/, |
||||
|
lookbehind: true, |
||||
|
inside: { |
||||
|
'punctuation': /\./, |
||||
|
} |
||||
|
}, |
||||
|
'generics': { |
||||
|
pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, |
||||
|
inside: { |
||||
|
'class-name': className, |
||||
|
'keyword': keywords, |
||||
|
'punctuation': /[<>(),.:]/, |
||||
|
'operator': /[?&|]/ |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}(Prism)); |
@ -0,0 +1,91 @@ |
|||||
|
Prism.languages.javascript = Prism.languages.extend('clike', { |
||||
|
'class-name': [ |
||||
|
Prism.languages.clike['class-name'], |
||||
|
{ |
||||
|
pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, |
||||
|
lookbehind: true |
||||
|
} |
||||
|
], |
||||
|
'keyword': [ |
||||
|
{ |
||||
|
pattern: /((?:^|})\s*)(?:catch|finally)\b/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
{ |
||||
|
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
], |
||||
|
'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, |
||||
|
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
||||
|
'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, |
||||
|
'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/ |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; |
||||
|
|
||||
|
Prism.languages.insertBefore('javascript', 'keyword', { |
||||
|
'regex': { |
||||
|
pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, |
||||
|
lookbehind: true, |
||||
|
greedy: true |
||||
|
}, |
||||
|
// This must be declared before keyword because we use "function" inside the look-forward
|
||||
|
'function-variable': { |
||||
|
pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, |
||||
|
alias: 'function' |
||||
|
}, |
||||
|
'parameter': [ |
||||
|
{ |
||||
|
pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, |
||||
|
lookbehind: true, |
||||
|
inside: Prism.languages.javascript |
||||
|
}, |
||||
|
{ |
||||
|
pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, |
||||
|
inside: Prism.languages.javascript |
||||
|
}, |
||||
|
{ |
||||
|
pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, |
||||
|
lookbehind: true, |
||||
|
inside: Prism.languages.javascript |
||||
|
}, |
||||
|
{ |
||||
|
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, |
||||
|
lookbehind: true, |
||||
|
inside: Prism.languages.javascript |
||||
|
} |
||||
|
], |
||||
|
'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/ |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.insertBefore('javascript', 'string', { |
||||
|
'template-string': { |
||||
|
pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'template-punctuation': { |
||||
|
pattern: /^`|`$/, |
||||
|
alias: 'string' |
||||
|
}, |
||||
|
'interpolation': { |
||||
|
pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, |
||||
|
lookbehind: true, |
||||
|
inside: { |
||||
|
'interpolation-punctuation': { |
||||
|
pattern: /^\${|}$/, |
||||
|
alias: 'punctuation' |
||||
|
}, |
||||
|
rest: Prism.languages.javascript |
||||
|
} |
||||
|
}, |
||||
|
'string': /[\s\S]+/ |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
if (Prism.languages.markup) { |
||||
|
Prism.languages.markup.tag.addInlined('script', 'javascript'); |
||||
|
} |
||||
|
|
||||
|
Prism.languages.js = Prism.languages.javascript; |
@ -0,0 +1,19 @@ |
|||||
|
Prism.languages.json = { |
||||
|
'property': { |
||||
|
pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'string': { |
||||
|
pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, |
||||
|
'number': /-?\d+\.?\d*(?:e[+-]?\d+)?/i, |
||||
|
'punctuation': /[{}[\],]/, |
||||
|
'operator': /:/, |
||||
|
'boolean': /\b(?:true|false)\b/, |
||||
|
'null': { |
||||
|
pattern: /\bnull\b/, |
||||
|
alias: 'keyword' |
||||
|
} |
||||
|
}; |
@ -0,0 +1 @@ |
|||||
|
Prism.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,number:/-?\d+\.?\d*(?:e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}}; |
@ -0,0 +1,64 @@ |
|||||
|
(function (Prism) { |
||||
|
var funcPattern = /\\(?:[^a-z()[\]]|[a-z*]+)/i; |
||||
|
var insideEqu = { |
||||
|
'equation-command': { |
||||
|
pattern: funcPattern, |
||||
|
alias: 'regex' |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.latex = { |
||||
|
'comment': /%.*/m, |
||||
|
// the verbatim environment prints whitespace to the document
|
||||
|
'cdata': { |
||||
|
pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})[\s\S]*?(?=\\end\{\2\})/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
/* |
||||
|
* equations can be between $$ $$ or $ $ or \( \) or \[ \] |
||||
|
* (all are multiline) |
||||
|
*/ |
||||
|
'equation': [ |
||||
|
{ |
||||
|
pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/, |
||||
|
inside: insideEqu, |
||||
|
alias: 'string' |
||||
|
}, |
||||
|
{ |
||||
|
pattern: /(\\begin\{((?:equation|math|eqnarray|align|multline|gather)\*?)\})[\s\S]*?(?=\\end\{\2\})/, |
||||
|
lookbehind: true, |
||||
|
inside: insideEqu, |
||||
|
alias: 'string' |
||||
|
} |
||||
|
], |
||||
|
/* |
||||
|
* arguments which are keywords or references are highlighted |
||||
|
* as keywords |
||||
|
*/ |
||||
|
'keyword': { |
||||
|
pattern: /(\\(?:begin|end|ref|cite|label|usepackage|documentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'url': { |
||||
|
pattern: /(\\url\{)[^}]+(?=\})/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
/* |
||||
|
* section or chapter headlines are highlighted as bold so that |
||||
|
* they stand out more |
||||
|
*/ |
||||
|
'headline': { |
||||
|
pattern: /(\\(?:part|chapter|section|subsection|frametitle|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\}(?:\[[^\]]+\])?)/, |
||||
|
lookbehind: true, |
||||
|
alias: 'class-name' |
||||
|
}, |
||||
|
'function': { |
||||
|
pattern: funcPattern, |
||||
|
alias: 'selector' |
||||
|
}, |
||||
|
'punctuation': /[[\]{}&]/ |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.tex = Prism.languages.latex; |
||||
|
Prism.languages.context = Prism.languages.latex; |
||||
|
})(Prism); |
@ -0,0 +1,344 @@ |
|||||
|
(function (Prism) { |
||||
|
|
||||
|
// Allow only one line break
|
||||
|
var inner = /(?:\\.|[^\\\n\r]|(?:\r?\n|\r)(?!\r?\n|\r))/.source; |
||||
|
|
||||
|
/** |
||||
|
* This function is intended for the creation of the bold or italic pattern. |
||||
|
* |
||||
|
* This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped. |
||||
|
* |
||||
|
* _Note:_ Keep in mind that this adds a capturing group. |
||||
|
* |
||||
|
* @param {string} pattern |
||||
|
* @param {boolean} starAlternative Whether to also add an alternative where all `_`s are replaced with `*`s. |
||||
|
* @returns {RegExp} |
||||
|
*/ |
||||
|
function createInline(pattern, starAlternative) { |
||||
|
pattern = pattern.replace(/<inner>/g, inner); |
||||
|
if (starAlternative) { |
||||
|
pattern = pattern + '|' + pattern.replace(/_/g, '\\*'); |
||||
|
} |
||||
|
return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
var tableCell = /(?:\\.|``.+?``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; |
||||
|
var tableRow = /\|?__(?:\|__)+\|?(?:(?:\r?\n|\r)|$)/.source.replace(/__/g, tableCell); |
||||
|
var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\r?\n|\r)/.source; |
||||
|
|
||||
|
|
||||
|
Prism.languages.markdown = Prism.languages.extend('markup', {}); |
||||
|
Prism.languages.insertBefore('markdown', 'prolog', { |
||||
|
'blockquote': { |
||||
|
// > ...
|
||||
|
pattern: /^>(?:[\t ]*>)*/m, |
||||
|
alias: 'punctuation' |
||||
|
}, |
||||
|
'table': { |
||||
|
pattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'), |
||||
|
inside: { |
||||
|
'table-data-rows': { |
||||
|
pattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'), |
||||
|
lookbehind: true, |
||||
|
inside: { |
||||
|
'table-data': { |
||||
|
pattern: RegExp(tableCell), |
||||
|
inside: Prism.languages.markdown |
||||
|
}, |
||||
|
'punctuation': /\|/ |
||||
|
} |
||||
|
}, |
||||
|
'table-line': { |
||||
|
pattern: RegExp('^(' + tableRow + ')' + tableLine + '$'), |
||||
|
lookbehind: true, |
||||
|
inside: { |
||||
|
'punctuation': /\||:?-{3,}:?/ |
||||
|
} |
||||
|
}, |
||||
|
'table-header-row': { |
||||
|
pattern: RegExp('^' + tableRow + '$'), |
||||
|
inside: { |
||||
|
'table-header': { |
||||
|
pattern: RegExp(tableCell), |
||||
|
alias: 'important', |
||||
|
inside: Prism.languages.markdown |
||||
|
}, |
||||
|
'punctuation': /\|/ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
'code': [ |
||||
|
{ |
||||
|
// Prefixed by 4 spaces or 1 tab and preceded by an empty line
|
||||
|
pattern: /(^[ \t]*(?:\r?\n|\r))(?: {4}|\t).+(?:(?:\r?\n|\r)(?: {4}|\t).+)*/m, |
||||
|
lookbehind: true, |
||||
|
alias: 'keyword' |
||||
|
}, |
||||
|
{ |
||||
|
// `code`
|
||||
|
// ``code``
|
||||
|
pattern: /``.+?``|`[^`\r\n]+`/, |
||||
|
alias: 'keyword' |
||||
|
}, |
||||
|
{ |
||||
|
// ```optional language
|
||||
|
// code block
|
||||
|
// ```
|
||||
|
pattern: /^```[\s\S]*?^```$/m, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'code-block': { |
||||
|
pattern: /^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'code-language': { |
||||
|
pattern: /^(```).+/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'punctuation': /```/ |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
'title': [ |
||||
|
{ |
||||
|
// title 1
|
||||
|
// =======
|
||||
|
|
||||
|
// title 2
|
||||
|
// -------
|
||||
|
pattern: /\S.*(?:\r?\n|\r)(?:==+|--+)(?=[ \t]*$)/m, |
||||
|
alias: 'important', |
||||
|
inside: { |
||||
|
punctuation: /==+$|--+$/ |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
// # title 1
|
||||
|
// ###### title 6
|
||||
|
pattern: /(^\s*)#+.+/m, |
||||
|
lookbehind: true, |
||||
|
alias: 'important', |
||||
|
inside: { |
||||
|
punctuation: /^#+|#+$/ |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
'hr': { |
||||
|
// ***
|
||||
|
// ---
|
||||
|
// * * *
|
||||
|
// -----------
|
||||
|
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, |
||||
|
lookbehind: true, |
||||
|
alias: 'punctuation' |
||||
|
}, |
||||
|
'list': { |
||||
|
// * item
|
||||
|
// + item
|
||||
|
// - item
|
||||
|
// 1. item
|
||||
|
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, |
||||
|
lookbehind: true, |
||||
|
alias: 'punctuation' |
||||
|
}, |
||||
|
'url-reference': { |
||||
|
// [id]: http://example.com "Optional title"
|
||||
|
// [id]: http://example.com 'Optional title'
|
||||
|
// [id]: http://example.com (Optional title)
|
||||
|
// [id]: <http://example.com> "Optional title"
|
||||
|
pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, |
||||
|
inside: { |
||||
|
'variable': { |
||||
|
pattern: /^(!?\[)[^\]]+/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, |
||||
|
'punctuation': /^[\[\]!:]|[<>]/ |
||||
|
}, |
||||
|
alias: 'url' |
||||
|
}, |
||||
|
'bold': { |
||||
|
// **strong**
|
||||
|
// __strong__
|
||||
|
|
||||
|
// allow one nested instance of italic text using the same delimiter
|
||||
|
pattern: createInline(/__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__/.source, true), |
||||
|
lookbehind: true, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'content': { |
||||
|
pattern: /(^..)[\s\S]+(?=..$)/, |
||||
|
lookbehind: true, |
||||
|
inside: {} // see below
|
||||
|
}, |
||||
|
'punctuation': /\*\*|__/ |
||||
|
} |
||||
|
}, |
||||
|
'italic': { |
||||
|
// *em*
|
||||
|
// _em_
|
||||
|
|
||||
|
// allow one nested instance of bold text using the same delimiter
|
||||
|
pattern: createInline(/_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_/.source, true), |
||||
|
lookbehind: true, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'content': { |
||||
|
pattern: /(^.)[\s\S]+(?=.$)/, |
||||
|
lookbehind: true, |
||||
|
inside: {} // see below
|
||||
|
}, |
||||
|
'punctuation': /[*_]/ |
||||
|
} |
||||
|
}, |
||||
|
'strike': { |
||||
|
// ~~strike through~~
|
||||
|
// ~strike~
|
||||
|
pattern: createInline(/(~~?)(?:(?!~)<inner>)+?\2/.source, false), |
||||
|
lookbehind: true, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'content': { |
||||
|
pattern: /(^~~?)[\s\S]+(?=\1$)/, |
||||
|
lookbehind: true, |
||||
|
inside: {} // see below
|
||||
|
}, |
||||
|
'punctuation': /~~?/ |
||||
|
} |
||||
|
}, |
||||
|
'url': { |
||||
|
// [example](http://example.com "Optional title")
|
||||
|
// [example][id]
|
||||
|
// [example] [id]
|
||||
|
pattern: createInline(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\])<inner>)+\])/.source, false), |
||||
|
lookbehind: true, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'variable': { |
||||
|
pattern: /(\[)[^\]]+(?=\]$)/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'content': { |
||||
|
pattern: /(^!?\[)[^\]]+(?=\])/, |
||||
|
lookbehind: true, |
||||
|
inside: {} // see below
|
||||
|
}, |
||||
|
'string': { |
||||
|
pattern: /"(?:\\.|[^"\\])*"(?=\)$)/ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
['url', 'bold', 'italic', 'strike'].forEach(function (token) { |
||||
|
['url', 'bold', 'italic', 'strike'].forEach(function (inside) { |
||||
|
if (token !== inside) { |
||||
|
Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside]; |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
Prism.hooks.add('after-tokenize', function (env) { |
||||
|
if (env.language !== 'markdown' && env.language !== 'md') { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
function walkTokens(tokens) { |
||||
|
if (!tokens || typeof tokens === 'string') { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
for (var i = 0, l = tokens.length; i < l; i++) { |
||||
|
var token = tokens[i]; |
||||
|
|
||||
|
if (token.type !== 'code') { |
||||
|
walkTokens(token.content); |
||||
|
continue; |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
* Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token |
||||
|
* is optional. But the grammar is defined so that there is only one case we have to handle: |
||||
|
* |
||||
|
* token.content = [ |
||||
|
* <span class="punctuation">```</span>,
|
||||
|
* <span class="code-language">xxxx</span>, |
||||
|
* '\n', // exactly one new lines (\r or \n or \r\n)
|
||||
|
* <span class="code-block">...</span>, |
||||
|
* '\n', // exactly one new lines again
|
||||
|
* <span class="punctuation">```</span>
|
||||
|
* ]; |
||||
|
*/ |
||||
|
|
||||
|
var codeLang = token.content[1]; |
||||
|
var codeBlock = token.content[3]; |
||||
|
|
||||
|
if (codeLang && codeBlock && |
||||
|
codeLang.type === 'code-language' && codeBlock.type === 'code-block' && |
||||
|
typeof codeLang.content === 'string') { |
||||
|
|
||||
|
// this might be a language that Prism does not support
|
||||
|
|
||||
|
// do some replacements to support C++, C#, and F#
|
||||
|
var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp') |
||||
|
// only use the first word
|
||||
|
lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase(); |
||||
|
var alias = 'language-' + lang; |
||||
|
|
||||
|
// add alias
|
||||
|
if (!codeBlock.alias) { |
||||
|
codeBlock.alias = [alias]; |
||||
|
} else if (typeof codeBlock.alias === 'string') { |
||||
|
codeBlock.alias = [codeBlock.alias, alias]; |
||||
|
} else { |
||||
|
codeBlock.alias.push(alias); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
walkTokens(env.tokens); |
||||
|
}); |
||||
|
|
||||
|
Prism.hooks.add('wrap', function (env) { |
||||
|
if (env.type !== 'code-block') { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var codeLang = ''; |
||||
|
for (var i = 0, l = env.classes.length; i < l; i++) { |
||||
|
var cls = env.classes[i]; |
||||
|
var match = /language-(.+)/.exec(cls); |
||||
|
if (match) { |
||||
|
codeLang = match[1]; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var grammar = Prism.languages[codeLang]; |
||||
|
|
||||
|
if (!grammar) { |
||||
|
if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) { |
||||
|
var id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16); |
||||
|
env.attributes['id'] = id; |
||||
|
|
||||
|
Prism.plugins.autoloader.loadLanguages(codeLang, function () { |
||||
|
var ele = document.getElementById(id); |
||||
|
if (ele) { |
||||
|
ele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} else { |
||||
|
// reverse Prism.util.encode
|
||||
|
var code = env.content.replace(/</g, '<').replace(/&/g, '&'); |
||||
|
|
||||
|
env.content = Prism.highlight(code, grammar, codeLang); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
Prism.languages.md = Prism.languages.markdown; |
||||
|
|
||||
|
}(Prism)); |
@ -0,0 +1 @@ |
|||||
|
!function(d){function n(n,e){return n=n.replace(/<inner>/g,function(){return"(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?!\n|\r\n?))"}),e&&(n=n+"|"+n.replace(/_/g,"\\*")),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}var e="(?:\\\\.|``.+?``|`[^`\r\n]+`|[^\\\\|\r\n`])+",t="\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|$)".replace(/__/g,function(){return e}),a="\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)";d.languages.markdown=d.languages.extend("markup",{}),d.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+t+a+"(?:"+t+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+t+a+")(?:"+t+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(e),inside:d.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+t+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+t+"$"),inside:{"table-header":{pattern:RegExp(e),alias:"important",inside:d.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n("__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n("_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n("(~~?)(?:(?!~)<inner>)+?\\2",!1),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n('!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)| ?\\[(?:(?!\\])<inner>)+\\])',!1),lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(\[)[^\]]+(?=\]$)/,lookbehind:!0},content:{pattern:/(^!?\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["url","bold","italic","strike"].forEach(function(e){["url","bold","italic","strike"].forEach(function(n){e!==n&&(d.languages.markdown[e].inside.content.inside[n]=d.languages.markdown[n])})}),d.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t<a;t++){var i=e[t];if("code"===i.type){var r=i.content[1],o=i.content[3];if(r&&o&&"code-language"===r.type&&"code-block"===o.type&&"string"==typeof r.content){var l=r.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),s="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,s]:o.alias.push(s):o.alias=[s]}}else n(i.content)}}(n.tokens)}),d.hooks.add("wrap",function(n){if("code-block"===n.type){for(var e="",t=0,a=n.classes.length;t<a;t++){var i=n.classes[t],r=/language-(.+)/.exec(i);if(r){e=r[1];break}}var o=d.languages[e];if(o){var l=n.content.replace(/</g,"<").replace(/&/g,"&");n.content=d.highlight(l,o,e)}else if(e&&"none"!==e&&d.plugins.autoloader){var s="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());n.attributes.id=s,d.plugins.autoloader.loadLanguages(e,function(){var n=document.getElementById(s);n&&(n.innerHTML=d.highlight(n.textContent,d.languages[e],e))})}}}),d.languages.md=d.languages.markdown}(Prism); |
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); |
@ -0,0 +1,64 @@ |
|||||
|
Prism.languages.python = { |
||||
|
'comment': { |
||||
|
pattern: /(^|[^\\])#.*/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'string-interpolation': { |
||||
|
pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, |
||||
|
greedy: true, |
||||
|
inside: { |
||||
|
'interpolation': { |
||||
|
// "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
|
||||
|
pattern: /((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/, |
||||
|
lookbehind: true, |
||||
|
inside: { |
||||
|
'format-spec': { |
||||
|
pattern: /(:)[^:(){}]+(?=}$)/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'conversion-option': { |
||||
|
pattern: /![sra](?=[:}]$)/, |
||||
|
alias: 'punctuation' |
||||
|
}, |
||||
|
rest: null |
||||
|
} |
||||
|
}, |
||||
|
'string': /[\s\S]+/ |
||||
|
} |
||||
|
}, |
||||
|
'triple-quoted-string': { |
||||
|
pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i, |
||||
|
greedy: true, |
||||
|
alias: 'string' |
||||
|
}, |
||||
|
'string': { |
||||
|
pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, |
||||
|
greedy: true |
||||
|
}, |
||||
|
'function': { |
||||
|
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'class-name': { |
||||
|
pattern: /(\bclass\s+)\w+/i, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'decorator': { |
||||
|
pattern: /(^\s*)@\w+(?:\.\w+)*/im, |
||||
|
lookbehind: true, |
||||
|
alias: ['annotation', 'punctuation'], |
||||
|
inside: { |
||||
|
'punctuation': /\./ |
||||
|
} |
||||
|
}, |
||||
|
'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, |
||||
|
'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, |
||||
|
'boolean': /\b(?:True|False|None)\b/, |
||||
|
'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, |
||||
|
'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, |
||||
|
'punctuation': /[{}[\];(),.:]/ |
||||
|
}; |
||||
|
|
||||
|
Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; |
||||
|
|
||||
|
Prism.languages.py = Prism.languages.python; |
@ -0,0 +1 @@ |
|||||
|
Prism.languages.scala=Prism.languages.extend("java",{keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b0x[\da-f]*\.?[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e\d+)?[dfl]?/i,symbol:/'[^\d\s\\]\w*/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function; |
@ -0,0 +1,24 @@ |
|||||
|
Prism.languages.sql = { |
||||
|
'comment': { |
||||
|
pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'variable': [ |
||||
|
{ |
||||
|
pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, |
||||
|
greedy: true |
||||
|
}, |
||||
|
/@[\w.$]+/ |
||||
|
], |
||||
|
'string': { |
||||
|
pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, |
||||
|
greedy: true, |
||||
|
lookbehind: true |
||||
|
}, |
||||
|
'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too?
|
||||
|
'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, |
||||
|
'boolean': /\b(?:TRUE|FALSE|NULL)\b/i, |
||||
|
'number': /\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i, |
||||
|
'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, |
||||
|
'punctuation': /[;[\]()`,.]/ |
||||
|
}; |
@ -0,0 +1,83 @@ |
|||||
|
/* =========================================================== |
||||
|
* docsify sw.js |
||||
|
* =========================================================== |
||||
|
* Copyright 2016 @huxpro |
||||
|
* Licensed under Apache 2.0 |
||||
|
* Register service worker. |
||||
|
* ========================================================== */ |
||||
|
|
||||
|
const RUNTIME = 'docsify' |
||||
|
const HOSTNAME_WHITELIST = [ |
||||
|
self.location.hostname, |
||||
|
'fonts.gstatic.com', |
||||
|
'fonts.googleapis.com', |
||||
|
'cdn.jsdelivr.net' |
||||
|
] |
||||
|
|
||||
|
// The Util Function to hack URLs of intercepted requests
|
||||
|
const getFixedUrl = (req) => { |
||||
|
var now = Date.now() |
||||
|
var url = new URL(req.url) |
||||
|
|
||||
|
// 1. fixed http URL
|
||||
|
// Just keep syncing with location.protocol
|
||||
|
// fetch(httpURL) belongs to active mixed content.
|
||||
|
// And fetch(httpRequest) is not supported yet.
|
||||
|
url.protocol = self.location.protocol |
||||
|
|
||||
|
// 2. add query for caching-busting.
|
||||
|
// Github Pages served with Cache-Control: max-age=600
|
||||
|
// max-age on mutable content is error-prone, with SW life of bugs can even extend.
|
||||
|
// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
|
||||
|
// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
|
||||
|
if (url.hostname === self.location.hostname) { |
||||
|
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now |
||||
|
} |
||||
|
return url.href |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Lifecycle Activate |
||||
|
* New one activated when old isnt being used. |
||||
|
* |
||||
|
* waitUntil(): activating ====> activated |
||||
|
*/ |
||||
|
self.addEventListener('activate', event => { |
||||
|
event.waitUntil(self.clients.claim()) |
||||
|
}) |
||||
|
|
||||
|
/** |
||||
|
* @Functional Fetch |
||||
|
* All network requests are being intercepted here. |
||||
|
* |
||||
|
* void respondWith(Promise<Response> r) |
||||
|
*/ |
||||
|
self.addEventListener('fetch', event => { |
||||
|
// Skip some of cross-origin requests, like those for Google Analytics.
|
||||
|
if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) { |
||||
|
// Stale-while-revalidate
|
||||
|
// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
|
||||
|
// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
|
||||
|
const cached = caches.match(event.request) |
||||
|
const fixedUrl = getFixedUrl(event.request) |
||||
|
const fetched = fetch(fixedUrl, { cache: 'no-store' }) |
||||
|
const fetchedCopy = fetched.then(resp => resp.clone()) |
||||
|
|
||||
|
// Call respondWith() with whatever we get first.
|
||||
|
// If the fetch fails (e.g disconnected), wait for the cache.
|
||||
|
// If there’s nothing in cache, wait for the fetch.
|
||||
|
// If neither yields a response, return offline pages.
|
||||
|
event.respondWith( |
||||
|
Promise.race([fetched.catch(_ => cached), cached]) |
||||
|
.then(resp => resp || fetched) |
||||
|
.catch(_ => { /* eat any errors */ }) |
||||
|
) |
||||
|
|
||||
|
// Update the cache with the version we fetched (only for ok status)
|
||||
|
event.waitUntil( |
||||
|
Promise.all([fetchedCopy, caches.open(RUNTIME)]) |
||||
|
.then(([response, cache]) => response.ok && cache.put(event.request, response)) |
||||
|
.catch(_ => { /* eat any errors */ }) |
||||
|
) |
||||
|
} |
||||
|
}) |
@ -0,0 +1 @@ |
|||||
|
!function(){"use strict";function e(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})}function n(e){var n=[];return h.dom.findAll("a:not([data-nosearch])").map(function(t){var o=t.href,i=t.getAttribute("href"),r=e.parse(o).path;r&&-1===n.indexOf(r)&&!Docsify.util.isAbsolutePath(i)&&n.push(r)}),n}function t(e){localStorage.setItem("docsify.search.expires",Date.now()+e),localStorage.setItem("docsify.search.index",JSON.stringify(g))}function o(e,n,t,o){void 0===n&&(n="");var i,r=window.marked.lexer(n),a=window.Docsify.slugify,s={};return r.forEach(function(n){if("heading"===n.type&&n.depth<=o)i=t.toURL(e,{id:a(n.text)}),s[i]={slug:i,title:n.text,body:""};else{if(!i)return;s[i]?s[i].body?s[i].body+="\n"+(n.text||""):s[i].body=n.text:s[i]={slug:i,title:"",body:""}}}),a.clear(),s}function i(n){var t=[],o=[];Object.keys(g).forEach(function(e){o=o.concat(Object.keys(g[e]).map(function(n){return g[e][n]}))}),n=n.trim();var i=n.split(/[\s\-\,\\\/]+/);1!==i.length&&(i=[].concat(n,i));for(var r=0;r<o.length;r++)!function(n){var r=o[n],a=!1,s="",c=r.title&&r.title.trim(),l=r.body&&r.body.trim(),f=r.slug||"";if(c&&l&&(i.forEach(function(n,t){var o=new RegExp(n,"gi"),i=-1,r=-1;if(i=c&&c.search(o),r=l&&l.search(o),i<0&&r<0)a=!1;else{a=!0,r<0&&(r=0);var f=0,d=0;f=r<11?0:r-10,d=0===f?70:r+n.length+60,d>l.length&&(d=l.length);var p="..."+e(l).substring(f,d).replace(o,'<em class="search-keyword">'+n+"</em>")+"...";s+=p}}),a)){var d={title:e(c),content:s,url:f};t.push(d)}}(r);return t}function r(e,i){h=Docsify;var r="auto"===e.paths,a=localStorage.getItem("docsify.search.expires")<Date.now();if(g=JSON.parse(localStorage.getItem("docsify.search.index")),a)g={};else if(!r)return;var s=r?n(i.router):e.paths,c=s.length,l=0;s.forEach(function(n){if(g[n])return l++;h.get(i.router.getFile(n)).then(function(r){g[n]=o(n,r,i.router,e.depth),c===++l&&t(e.maxAge)})})}function a(){Docsify.dom.style("\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}")}function s(e,n){void 0===n&&(n="");var t='<input type="search" value="'+n+'" /><div class="results-panel"></div></div>',o=Docsify.dom.create("div",t),i=Docsify.dom.find("aside");Docsify.dom.toggleClass(o,"search"),Docsify.dom.before(i,o)}function c(e){var n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,".results-panel");if(!e)return t.classList.remove("show"),void(t.innerHTML="");var o=i(e),r="";o.forEach(function(e){r+='<div class="matching-post">\n<a href="'+e.url+'"> \n<h2>'+e.title+"</h2>\n<p>"+e.content+"</p>\n</a>\n</div>"}),t.classList.add("show"),t.innerHTML=r||'<p class="empty">'+y+"</p>"}function l(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input");Docsify.dom.on(n,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return c(n.target.value.trim())},100)})}function f(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var o=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];t.placeholder=e[o]}}function d(e,n){if("string"==typeof e)y=e;else{var t=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];y=e[t]}}function p(e,n){var t=n.router.parse().query.s;a(),s(e,t),l(),t&&setTimeout(function(e){return c(t)},500)}function u(e,n){f(e.placeholder,n.route.path),d(e.noData,n.route.path)}var h,g={},y="",m={placeholder:"Type to search",noData:"No Results!",paths:"auto",depth:2,maxAge:864e5},v=function(e,n){var t=Docsify.util,o=n.config.search||m;Array.isArray(o)?m.paths=o:"object"==typeof o&&(m.paths=Array.isArray(o.paths)?o.paths:"auto",m.maxAge=t.isPrimitive(o.maxAge)?o.maxAge:m.maxAge,m.placeholder=o.placeholder||m.placeholder,m.noData=o.noData||m.noData,m.depth=o.depth||m.depth);var i="auto"===m.paths;e.mounted(function(e){p(m,n),!i&&r(m,n)}),e.doneEach(function(e){u(m,n),i&&r(m,n)})};$docsify.plugins=[].concat(v,$docsify.plugins)}(); |
@ -0,0 +1 @@ |
|||||
|
@font-face{font-family:"socialshare";src:url("../fonts/iconfont.eot");src:url("../fonts/iconfont.eot?#iefix") format("embedded-opentype"),url("../fonts/iconfont.woff") format("woff"),url("../fonts/iconfont.ttf") format("truetype"),url("../fonts/iconfont.svg#iconfont") format("svg")}.social-share{font-family:"socialshare" !important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:0.2px;-moz-osx-font-smoothing:grayscale}.social-share *{font-family:"socialshare" !important}.social-share .icon-tencent:before{content:"\f07a"}.social-share .icon-qq:before{content:"\f11a"}.social-share .icon-weibo:before{content:"\f12a"}.social-share .icon-wechat:before{content:"\f09a"}.social-share .icon-douban:before{content:"\f10a"}.social-share .icon-heart:before{content:"\f20a"}.social-share .icon-like:before{content:"\f00a"}.social-share .icon-qzone:before{content:"\f08a"}.social-share .icon-linkedin:before{content:"\f01a"}.social-share .icon-diandian:before{content:"\f05a"}.social-share .icon-facebook:before{content:"\f03a"}.social-share .icon-google:before{content:"\f04a"}.social-share .icon-twitter:before{content:"\f06a"}.social-share a{position:relative;text-decoration:none;margin:4px;display:inline-block;outline:none}.social-share .social-share-icon{position:relative;display:inline-block;width:32px;height:32px;font-size:20px;border-radius:50%;line-height:32px;border:1px solid #666;color:#666;text-align:center;vertical-align:middle;transition:background 0.6s ease-out 0s}.social-share .social-share-icon:hover{background:#666;color:#fff}.social-share .icon-weibo{color:#ff763b;border-color:#ff763b}.social-share .icon-weibo:hover{background:#ff763b}.social-share .icon-tencent{color:#56b6e7;border-color:#56b6e7}.social-share .icon-tencent:hover{background:#56b6e7}.social-share .icon-qq{color:#56b6e7;border-color:#56b6e7}.social-share .icon-qq:hover{background:#56b6e7}.social-share .icon-qzone{color:#FDBE3D;border-color:#FDBE3D}.social-share .icon-qzone:hover{background:#FDBE3D}.social-share .icon-douban{color:#33b045;border-color:#33b045}.social-share .icon-douban:hover{background:#33b045}.social-share .icon-linkedin{color:#0077B5;border-color:#0077B5}.social-share .icon-linkedin:hover{background:#0077B5}.social-share .icon-facebook{color:#44619D;border-color:#44619D}.social-share .icon-facebook:hover{background:#44619D}.social-share .icon-google{color:#db4437;border-color:#db4437}.social-share .icon-google:hover{background:#db4437}.social-share .icon-twitter{color:#55acee;border-color:#55acee}.social-share .icon-twitter:hover{background:#55acee}.social-share .icon-diandian{color:#307DCA;border-color:#307DCA}.social-share .icon-diandian:hover{background:#307DCA}.social-share .icon-wechat{position:relative;color:#7bc549;border-color:#7bc549}.social-share .icon-wechat:hover{background:#7bc549}.social-share .icon-wechat .wechat-qrcode{display:none;border:1px solid #eee;position:absolute;z-index:9;top:-205px;left:-84px;width:200px;height:192px;color:#666;font-size:12px;text-align:center;background-color:#fff;box-shadow:0 2px 10px #aaa;transition:all 200ms;-webkit-tansition:all 350ms;-moz-transition:all 350ms}.social-share .icon-wechat .wechat-qrcode.bottom{top:40px;left:-84px}.social-share .icon-wechat .wechat-qrcode.bottom:after{display:none}.social-share .icon-wechat .wechat-qrcode h4{font-weight:normal;height:26px;line-height:26px;font-size:12px;background-color:#f3f3f3;margin:0;padding:0;color:#777}.social-share .icon-wechat .wechat-qrcode .qrcode{width:105px;margin:10px auto}.social-share .icon-wechat .wechat-qrcode .qrcode table{margin:0 !important}.social-share .icon-wechat .wechat-qrcode .help p{font-weight:normal;line-height:16px;padding:0;margin:0}.social-share .icon-wechat .wechat-qrcode:after{content:'';position:absolute;left:50%;margin-left:-6px;bottom:-13px;width:0;height:0;border-width:8px 6px 6px 6px;border-style:solid;border-color:#fff transparent transparent transparent}.social-share .icon-wechat:hover .wechat-qrcode{display:block} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,83 @@ |
|||||
|
/* =========================================================== |
||||
|
* docsify sw.js |
||||
|
* =========================================================== |
||||
|
* Copyright 2016 @huxpro |
||||
|
* Licensed under Apache 2.0 |
||||
|
* Register service worker. |
||||
|
* ========================================================== */ |
||||
|
|
||||
|
const RUNTIME = 'docsify' |
||||
|
const HOSTNAME_WHITELIST = [ |
||||
|
self.location.hostname, |
||||
|
'fonts.gstatic.com', |
||||
|
'fonts.googleapis.com', |
||||
|
'cdn.jsdelivr.net' |
||||
|
] |
||||
|
|
||||
|
// The Util Function to hack URLs of intercepted requests
|
||||
|
const getFixedUrl = (req) => { |
||||
|
var now = Date.now() |
||||
|
var url = new URL(req.url) |
||||
|
|
||||
|
// 1. fixed http URL
|
||||
|
// Just keep syncing with location.protocol
|
||||
|
// fetch(httpURL) belongs to active mixed content.
|
||||
|
// And fetch(httpRequest) is not supported yet.
|
||||
|
url.protocol = self.location.protocol |
||||
|
|
||||
|
// 2. add query for caching-busting.
|
||||
|
// Github Pages served with Cache-Control: max-age=600
|
||||
|
// max-age on mutable content is error-prone, with SW life of bugs can even extend.
|
||||
|
// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
|
||||
|
// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
|
||||
|
if (url.hostname === self.location.hostname) { |
||||
|
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now |
||||
|
} |
||||
|
return url.href |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Lifecycle Activate |
||||
|
* New one activated when old isnt being used. |
||||
|
* |
||||
|
* waitUntil(): activating ====> activated |
||||
|
*/ |
||||
|
self.addEventListener('activate', event => { |
||||
|
event.waitUntil(self.clients.claim()) |
||||
|
}) |
||||
|
|
||||
|
/** |
||||
|
* @Functional Fetch |
||||
|
* All network requests are being intercepted here. |
||||
|
* |
||||
|
* void respondWith(Promise<Response> r) |
||||
|
*/ |
||||
|
self.addEventListener('fetch', event => { |
||||
|
// Skip some of cross-origin requests, like those for Google Analytics.
|
||||
|
if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) { |
||||
|
// Stale-while-revalidate
|
||||
|
// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
|
||||
|
// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
|
||||
|
const cached = caches.match(event.request) |
||||
|
const fixedUrl = getFixedUrl(event.request) |
||||
|
const fetched = fetch(fixedUrl, { cache: 'no-store' }) |
||||
|
const fetchedCopy = fetched.then(resp => resp.clone()) |
||||
|
|
||||
|
// Call respondWith() with whatever we get first.
|
||||
|
// If the fetch fails (e.g disconnected), wait for the cache.
|
||||
|
// If there’s nothing in cache, wait for the fetch.
|
||||
|
// If neither yields a response, return offline pages.
|
||||
|
event.respondWith( |
||||
|
Promise.race([fetched.catch(_ => cached), cached]) |
||||
|
.then(resp => resp || fetched) |
||||
|
.catch(_ => { /* eat any errors */ }) |
||||
|
) |
||||
|
|
||||
|
// Update the cache with the version we fetched (only for ok status)
|
||||
|
event.waitUntil( |
||||
|
Promise.all([fetchedCopy, caches.open(RUNTIME)]) |
||||
|
.then(([response, cache]) => response.ok && cache.put(event.request, response)) |
||||
|
.catch(_ => { /* eat any errors */ }) |
||||
|
) |
||||
|
} |
||||
|
}) |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,828 @@ |
|||||
|
@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600"); |
||||
|
* { |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
-webkit-overflow-scrolling: touch; |
||||
|
-webkit-tap-highlight-color: rgba(0,0,0,0); |
||||
|
-webkit-text-size-adjust: none; |
||||
|
-webkit-touch-callout: none; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
body:not(.ready) { |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
body:not(.ready) [data-cloak], |
||||
|
body:not(.ready) .app-nav, |
||||
|
body:not(.ready) > nav { |
||||
|
display: none; |
||||
|
} |
||||
|
div#app { |
||||
|
font-size: 30px; |
||||
|
font-weight: lighter; |
||||
|
margin: 40vh auto; |
||||
|
text-align: center; |
||||
|
} |
||||
|
div#app:empty::before { |
||||
|
content: 'Loading...'; |
||||
|
} |
||||
|
.emoji { |
||||
|
height: 1.2rem; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.progress { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
height: 2px; |
||||
|
left: 0px; |
||||
|
position: fixed; |
||||
|
right: 0px; |
||||
|
top: 0px; |
||||
|
transition: width 0.2s, opacity 0.4s; |
||||
|
width: 0%; |
||||
|
z-index: 999999; |
||||
|
} |
||||
|
.search a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.search .search-keyword { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-style: normal; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
html, |
||||
|
body { |
||||
|
height: 100%; |
||||
|
} |
||||
|
body { |
||||
|
-moz-osx-font-smoothing: grayscale; |
||||
|
-webkit-font-smoothing: antialiased; |
||||
|
color: #34495e; |
||||
|
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; |
||||
|
font-size: 15px; |
||||
|
letter-spacing: 0; |
||||
|
margin: 0; |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
img { |
||||
|
max-width: 100%; |
||||
|
} |
||||
|
a[disabled] { |
||||
|
cursor: not-allowed; |
||||
|
opacity: 0.6; |
||||
|
} |
||||
|
kbd { |
||||
|
border: solid 1px #ccc; |
||||
|
border-radius: 3px; |
||||
|
display: inline-block; |
||||
|
font-size: 12px !important; |
||||
|
line-height: 12px; |
||||
|
margin-bottom: 3px; |
||||
|
padding: 3px 5px; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
li input[type='checkbox'] { |
||||
|
margin: 0 0.2em 0.25em 0; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
.app-nav { |
||||
|
margin: 25px 60px 0 0; |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
text-align: right; |
||||
|
z-index: 10; |
||||
|
/* navbar dropdown */ |
||||
|
} |
||||
|
.app-nav.no-badge { |
||||
|
margin-right: 25px; |
||||
|
} |
||||
|
.app-nav p { |
||||
|
margin: 0; |
||||
|
} |
||||
|
.app-nav > a { |
||||
|
margin: 0 1rem; |
||||
|
padding: 5px 0; |
||||
|
} |
||||
|
.app-nav ul, |
||||
|
.app-nav li { |
||||
|
display: inline-block; |
||||
|
list-style: none; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.app-nav a { |
||||
|
color: inherit; |
||||
|
font-size: 16px; |
||||
|
text-decoration: none; |
||||
|
transition: color 0.3s; |
||||
|
} |
||||
|
.app-nav a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.app-nav a.active { |
||||
|
border-bottom: 2px solid var(--theme-color, #42b983); |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.app-nav li { |
||||
|
display: inline-block; |
||||
|
margin: 0 1rem; |
||||
|
padding: 5px 0; |
||||
|
position: relative; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.app-nav li ul { |
||||
|
background-color: #fff; |
||||
|
border: 1px solid #ddd; |
||||
|
border-bottom-color: #ccc; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
display: none; |
||||
|
max-height: calc(100vh - 61px); |
||||
|
overflow-y: auto; |
||||
|
padding: 10px 0; |
||||
|
position: absolute; |
||||
|
right: -15px; |
||||
|
text-align: left; |
||||
|
top: 100%; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.app-nav li ul li { |
||||
|
display: block; |
||||
|
font-size: 14px; |
||||
|
line-height: 1rem; |
||||
|
margin: 0; |
||||
|
margin: 8px 14px; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.app-nav li ul a { |
||||
|
display: block; |
||||
|
font-size: inherit; |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
} |
||||
|
.app-nav li ul a.active { |
||||
|
border-bottom: 0; |
||||
|
} |
||||
|
.app-nav li:hover ul { |
||||
|
display: block; |
||||
|
} |
||||
|
.github-corner { |
||||
|
border-bottom: 0; |
||||
|
position: fixed; |
||||
|
right: 0; |
||||
|
text-decoration: none; |
||||
|
top: 0; |
||||
|
z-index: 1; |
||||
|
} |
||||
|
.github-corner:hover .octo-arm { |
||||
|
-webkit-animation: octocat-wave 560ms ease-in-out; |
||||
|
animation: octocat-wave 560ms ease-in-out; |
||||
|
} |
||||
|
.github-corner svg { |
||||
|
color: #fff; |
||||
|
fill: var(--theme-color, #42b983); |
||||
|
height: 80px; |
||||
|
width: 80px; |
||||
|
} |
||||
|
main { |
||||
|
display: block; |
||||
|
position: relative; |
||||
|
width: 100vw; |
||||
|
height: 100%; |
||||
|
z-index: 0; |
||||
|
} |
||||
|
main.hidden { |
||||
|
display: none; |
||||
|
} |
||||
|
.anchor { |
||||
|
display: inline-block; |
||||
|
text-decoration: none; |
||||
|
transition: all 0.3s; |
||||
|
} |
||||
|
.anchor span { |
||||
|
color: #34495e; |
||||
|
} |
||||
|
.anchor:hover { |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
.sidebar { |
||||
|
border-right: 1px solid rgba(0,0,0,0.07); |
||||
|
overflow-y: auto; |
||||
|
padding: 40px 0 0; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
transition: transform 250ms ease-out; |
||||
|
width: 300px; |
||||
|
z-index: 20; |
||||
|
} |
||||
|
.sidebar > h1 { |
||||
|
margin: 0 auto 1rem; |
||||
|
font-size: 1.5rem; |
||||
|
font-weight: 300; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.sidebar > h1 a { |
||||
|
color: inherit; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.sidebar > h1 .app-nav { |
||||
|
display: block; |
||||
|
position: static; |
||||
|
} |
||||
|
.sidebar .sidebar-nav { |
||||
|
line-height: 2em; |
||||
|
padding-bottom: 40px; |
||||
|
} |
||||
|
.sidebar li.collapse .app-sub-sidebar { |
||||
|
display: none; |
||||
|
} |
||||
|
.sidebar ul { |
||||
|
margin: 0 0 0 15px; |
||||
|
padding: 0; |
||||
|
} |
||||
|
.sidebar li > p { |
||||
|
font-weight: 700; |
||||
|
margin: 0; |
||||
|
} |
||||
|
.sidebar ul, |
||||
|
.sidebar ul li { |
||||
|
list-style: none; |
||||
|
} |
||||
|
.sidebar ul li a { |
||||
|
border-bottom: none; |
||||
|
display: block; |
||||
|
} |
||||
|
.sidebar ul li ul { |
||||
|
padding-left: 20px; |
||||
|
} |
||||
|
.sidebar::-webkit-scrollbar { |
||||
|
width: 4px; |
||||
|
} |
||||
|
.sidebar::-webkit-scrollbar-thumb { |
||||
|
background: transparent; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.sidebar:hover::-webkit-scrollbar-thumb { |
||||
|
background: rgba(136,136,136,0.4); |
||||
|
} |
||||
|
.sidebar:hover::-webkit-scrollbar-track { |
||||
|
background: rgba(136,136,136,0.1); |
||||
|
} |
||||
|
.sidebar-toggle { |
||||
|
background-color: transparent; |
||||
|
background-color: rgba(255,255,255,0.8); |
||||
|
border: 0; |
||||
|
outline: none; |
||||
|
padding: 10px; |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
text-align: center; |
||||
|
transition: opacity 0.3s; |
||||
|
width: 284px; |
||||
|
z-index: 30; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.sidebar-toggle:hover .sidebar-toggle-button { |
||||
|
opacity: 0.4; |
||||
|
} |
||||
|
.sidebar-toggle span { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
display: block; |
||||
|
margin-bottom: 4px; |
||||
|
width: 16px; |
||||
|
height: 2px; |
||||
|
} |
||||
|
body.sticky .sidebar, |
||||
|
body.sticky .sidebar-toggle { |
||||
|
position: fixed; |
||||
|
} |
||||
|
.content { |
||||
|
padding-top: 60px; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
bottom: 0; |
||||
|
left: 300px; |
||||
|
transition: left 250ms ease; |
||||
|
} |
||||
|
.markdown-section { |
||||
|
margin: 0 auto; |
||||
|
max-width: 80%; |
||||
|
padding: 30px 15px 40px 15px; |
||||
|
position: relative; |
||||
|
} |
||||
|
.markdown-section > * { |
||||
|
box-sizing: border-box; |
||||
|
font-size: inherit; |
||||
|
} |
||||
|
.markdown-section > :first-child { |
||||
|
margin-top: 0 !important; |
||||
|
} |
||||
|
.markdown-section hr { |
||||
|
border: none; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
margin: 2em 0; |
||||
|
} |
||||
|
.markdown-section iframe { |
||||
|
border: 1px solid #eee; |
||||
|
/* fix horizontal overflow on iOS Safari */ |
||||
|
width: 1px; |
||||
|
min-width: 100%; |
||||
|
} |
||||
|
.markdown-section table { |
||||
|
border-collapse: collapse; |
||||
|
border-spacing: 0; |
||||
|
display: block; |
||||
|
margin-bottom: 1rem; |
||||
|
overflow: auto; |
||||
|
width: 100%; |
||||
|
} |
||||
|
.markdown-section th { |
||||
|
border: 1px solid #ddd; |
||||
|
font-weight: bold; |
||||
|
padding: 6px 13px; |
||||
|
} |
||||
|
.markdown-section td { |
||||
|
border: 1px solid #ddd; |
||||
|
padding: 6px 13px; |
||||
|
} |
||||
|
.markdown-section tr { |
||||
|
border-top: 1px solid #ccc; |
||||
|
} |
||||
|
.markdown-section tr:nth-child(2n) { |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
.markdown-section p.tip { |
||||
|
background-color: #f8f8f8; |
||||
|
border-bottom-right-radius: 2px; |
||||
|
border-left: 4px solid #f66; |
||||
|
border-top-right-radius: 2px; |
||||
|
margin: 2em 0; |
||||
|
padding: 12px 24px 12px 30px; |
||||
|
position: relative; |
||||
|
} |
||||
|
.markdown-section p.tip:before { |
||||
|
background-color: #f66; |
||||
|
border-radius: 100%; |
||||
|
color: #fff; |
||||
|
content: '!'; |
||||
|
font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; |
||||
|
font-size: 14px; |
||||
|
font-weight: bold; |
||||
|
left: -12px; |
||||
|
line-height: 20px; |
||||
|
position: absolute; |
||||
|
height: 20px; |
||||
|
width: 20px; |
||||
|
text-align: center; |
||||
|
top: 14px; |
||||
|
} |
||||
|
.markdown-section p.tip code { |
||||
|
background-color: #efefef; |
||||
|
} |
||||
|
.markdown-section p.tip em { |
||||
|
color: #34495e; |
||||
|
} |
||||
|
.markdown-section p.warn { |
||||
|
background: rgba(66,185,131,0.1); |
||||
|
border-radius: 2px; |
||||
|
padding: 1rem; |
||||
|
} |
||||
|
.markdown-section ul.task-list > li { |
||||
|
list-style-type: none; |
||||
|
} |
||||
|
body.close .sidebar { |
||||
|
transform: translateX(-300px); |
||||
|
} |
||||
|
body.close .sidebar-toggle { |
||||
|
width: auto; |
||||
|
} |
||||
|
body.close .content { |
||||
|
left: 0; |
||||
|
} |
||||
|
@media print { |
||||
|
.github-corner, |
||||
|
.sidebar-toggle, |
||||
|
.sidebar, |
||||
|
.app-nav { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
@media screen and (max-width: 768px) { |
||||
|
.github-corner, |
||||
|
.sidebar-toggle, |
||||
|
.sidebar { |
||||
|
position: fixed; |
||||
|
} |
||||
|
.app-nav { |
||||
|
margin-top: 16px; |
||||
|
} |
||||
|
.app-nav li ul { |
||||
|
top: 30px; |
||||
|
} |
||||
|
main { |
||||
|
height: auto; |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
.sidebar { |
||||
|
left: -300px; |
||||
|
transition: transform 250ms ease-out; |
||||
|
} |
||||
|
.content { |
||||
|
left: 0; |
||||
|
max-width: 100vw; |
||||
|
position: static; |
||||
|
padding-top: 20px; |
||||
|
transition: transform 250ms ease; |
||||
|
} |
||||
|
.app-nav, |
||||
|
.github-corner { |
||||
|
transition: transform 250ms ease-out; |
||||
|
} |
||||
|
.sidebar-toggle { |
||||
|
background-color: transparent; |
||||
|
width: auto; |
||||
|
padding: 30px 30px 10px 10px; |
||||
|
} |
||||
|
body.close .sidebar { |
||||
|
transform: translateX(300px); |
||||
|
} |
||||
|
body.close .sidebar-toggle { |
||||
|
background-color: rgba(255,255,255,0.8); |
||||
|
transition: 1s background-color; |
||||
|
width: 284px; |
||||
|
padding: 10px; |
||||
|
} |
||||
|
body.close .content { |
||||
|
transform: translateX(300px); |
||||
|
} |
||||
|
body.close .app-nav, |
||||
|
body.close .github-corner { |
||||
|
display: none; |
||||
|
} |
||||
|
.github-corner:hover .octo-arm { |
||||
|
-webkit-animation: none; |
||||
|
animation: none; |
||||
|
} |
||||
|
.github-corner .octo-arm { |
||||
|
-webkit-animation: octocat-wave 560ms ease-in-out; |
||||
|
animation: octocat-wave 560ms ease-in-out; |
||||
|
} |
||||
|
} |
||||
|
@-webkit-keyframes octocat-wave { |
||||
|
0%, 100% { |
||||
|
transform: rotate(0); |
||||
|
} |
||||
|
20%, 60% { |
||||
|
transform: rotate(-25deg); |
||||
|
} |
||||
|
40%, 80% { |
||||
|
transform: rotate(10deg); |
||||
|
} |
||||
|
} |
||||
|
@keyframes octocat-wave { |
||||
|
0%, 100% { |
||||
|
transform: rotate(0); |
||||
|
} |
||||
|
20%, 60% { |
||||
|
transform: rotate(-25deg); |
||||
|
} |
||||
|
40%, 80% { |
||||
|
transform: rotate(10deg); |
||||
|
} |
||||
|
} |
||||
|
section.cover { |
||||
|
align-items: center; |
||||
|
background-position: center center; |
||||
|
background-repeat: no-repeat; |
||||
|
background-size: cover; |
||||
|
height: 100vh; |
||||
|
display: none; |
||||
|
} |
||||
|
section.cover.show { |
||||
|
display: flex; |
||||
|
} |
||||
|
section.cover.has-mask .mask { |
||||
|
background-color: #fff; |
||||
|
opacity: 0.8; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
height: 100%; |
||||
|
width: 100%; |
||||
|
} |
||||
|
section.cover .cover-main { |
||||
|
flex: 1; |
||||
|
margin: -20px 16px 0; |
||||
|
text-align: center; |
||||
|
z-index: 1; |
||||
|
} |
||||
|
section.cover a { |
||||
|
color: inherit; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
section.cover a:hover { |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
section.cover p { |
||||
|
line-height: 1.5rem; |
||||
|
margin: 1em 0; |
||||
|
} |
||||
|
section.cover h1 { |
||||
|
color: inherit; |
||||
|
font-size: 2.5rem; |
||||
|
font-weight: 300; |
||||
|
margin: 0.625rem 0 2.5rem; |
||||
|
position: relative; |
||||
|
text-align: center; |
||||
|
} |
||||
|
section.cover h1 a { |
||||
|
display: block; |
||||
|
} |
||||
|
section.cover h1 small { |
||||
|
bottom: -0.4375rem; |
||||
|
font-size: 1rem; |
||||
|
position: absolute; |
||||
|
} |
||||
|
section.cover blockquote { |
||||
|
font-size: 1.5rem; |
||||
|
text-align: center; |
||||
|
} |
||||
|
section.cover ul { |
||||
|
line-height: 1.8; |
||||
|
list-style-type: none; |
||||
|
margin: 1em auto; |
||||
|
max-width: 500px; |
||||
|
padding: 0; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a { |
||||
|
border-color: var(--theme-color, #42b983); |
||||
|
border-radius: 2rem; |
||||
|
border-style: solid; |
||||
|
border-width: 1px; |
||||
|
box-sizing: border-box; |
||||
|
color: var(--theme-color, #42b983); |
||||
|
display: inline-block; |
||||
|
font-size: 1.05rem; |
||||
|
letter-spacing: 0.1rem; |
||||
|
margin: 0.5rem 1rem; |
||||
|
padding: 0.75em 2rem; |
||||
|
text-decoration: none; |
||||
|
transition: all 0.15s ease; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:last-child { |
||||
|
background-color: var(--theme-color, #42b983); |
||||
|
color: #fff; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:last-child:hover { |
||||
|
color: inherit; |
||||
|
opacity: 0.8; |
||||
|
} |
||||
|
section.cover .cover-main > p:last-child a:hover { |
||||
|
color: inherit; |
||||
|
} |
||||
|
section.cover blockquote > p > a { |
||||
|
border-bottom: 2px solid var(--theme-color, #42b983); |
||||
|
transition: color 0.3s; |
||||
|
} |
||||
|
section.cover blockquote > p > a:hover { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
body { |
||||
|
background-color: #fff; |
||||
|
} |
||||
|
/* sidebar */ |
||||
|
.sidebar { |
||||
|
background-color: #fff; |
||||
|
color: #364149; |
||||
|
} |
||||
|
.sidebar li { |
||||
|
margin: 6px 0 6px 0; |
||||
|
} |
||||
|
.sidebar ul li a { |
||||
|
color: #505d6b; |
||||
|
font-size: 14px; |
||||
|
font-weight: normal; |
||||
|
overflow: hidden; |
||||
|
text-decoration: none; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.sidebar ul li a:hover { |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
.sidebar ul li ul { |
||||
|
padding: 0; |
||||
|
} |
||||
|
.sidebar ul li.active > a { |
||||
|
border-right: 2px solid; |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.app-sub-sidebar li::before { |
||||
|
content: '-'; |
||||
|
padding-right: 4px; |
||||
|
float: left; |
||||
|
} |
||||
|
/* markdown content found on pages */ |
||||
|
.markdown-section h1, |
||||
|
.markdown-section h2, |
||||
|
.markdown-section h3, |
||||
|
.markdown-section h4, |
||||
|
.markdown-section strong { |
||||
|
color: #2c3e50; |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.markdown-section a { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
font-weight: 600; |
||||
|
} |
||||
|
.markdown-section h1 { |
||||
|
font-size: 2rem; |
||||
|
margin: 0 0 1rem; |
||||
|
} |
||||
|
.markdown-section h2 { |
||||
|
font-size: 1.75rem; |
||||
|
margin: 45px 0 0.8rem; |
||||
|
} |
||||
|
.markdown-section h3 { |
||||
|
font-size: 1.5rem; |
||||
|
margin: 40px 0 0.6rem; |
||||
|
} |
||||
|
.markdown-section h4 { |
||||
|
font-size: 1.25rem; |
||||
|
} |
||||
|
.markdown-section h5 { |
||||
|
font-size: 1rem; |
||||
|
} |
||||
|
.markdown-section h6 { |
||||
|
color: #777; |
||||
|
font-size: 1rem; |
||||
|
} |
||||
|
.markdown-section figure, |
||||
|
.markdown-section p { |
||||
|
margin: 1.2em 0; |
||||
|
} |
||||
|
.markdown-section p, |
||||
|
.markdown-section ul, |
||||
|
.markdown-section ol { |
||||
|
line-height: 1.6rem; |
||||
|
word-spacing: 0.05rem; |
||||
|
} |
||||
|
.markdown-section ul, |
||||
|
.markdown-section ol { |
||||
|
padding-left: 1.5rem; |
||||
|
} |
||||
|
.markdown-section blockquote { |
||||
|
border-left: 4px solid var(--theme-color, #42b983); |
||||
|
color: #858585; |
||||
|
margin: 2em 0; |
||||
|
padding-left: 20px; |
||||
|
} |
||||
|
.markdown-section blockquote p { |
||||
|
font-weight: 600; |
||||
|
margin-left: 0; |
||||
|
} |
||||
|
.markdown-section iframe { |
||||
|
margin: 1em 0; |
||||
|
} |
||||
|
.markdown-section em { |
||||
|
color: #7f8c8d; |
||||
|
} |
||||
|
.markdown-section code { |
||||
|
background-color: #f8f8f8; |
||||
|
border-radius: 2px; |
||||
|
color: #e96900; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
font-size: 0.8rem; |
||||
|
margin: 0 2px; |
||||
|
padding: 3px 5px; |
||||
|
white-space: pre-wrap; |
||||
|
} |
||||
|
.markdown-section pre { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
background-color: #f8f8f8; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
line-height: 1.5rem; |
||||
|
margin: 1.2em 0; |
||||
|
overflow: auto; |
||||
|
padding: 0 1.4rem; |
||||
|
position: relative; |
||||
|
word-wrap: normal; |
||||
|
} |
||||
|
/* code highlight */ |
||||
|
.token.comment, |
||||
|
.token.prolog, |
||||
|
.token.doctype, |
||||
|
.token.cdata { |
||||
|
color: #8e908c; |
||||
|
} |
||||
|
.token.namespace { |
||||
|
opacity: 0.7; |
||||
|
} |
||||
|
.token.boolean, |
||||
|
.token.number { |
||||
|
color: #c76b29; |
||||
|
} |
||||
|
.token.punctuation { |
||||
|
color: #525252; |
||||
|
} |
||||
|
.token.property { |
||||
|
color: #c08b30; |
||||
|
} |
||||
|
.token.tag { |
||||
|
color: #2973b7; |
||||
|
} |
||||
|
.token.string { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.token.selector { |
||||
|
color: #6679cc; |
||||
|
} |
||||
|
.token.attr-name { |
||||
|
color: #2973b7; |
||||
|
} |
||||
|
.token.entity, |
||||
|
.token.url, |
||||
|
.language-css .token.string, |
||||
|
.style .token.string { |
||||
|
color: #22a2c9; |
||||
|
} |
||||
|
.token.attr-value, |
||||
|
.token.control, |
||||
|
.token.directive, |
||||
|
.token.unit { |
||||
|
color: var(--theme-color, #42b983); |
||||
|
} |
||||
|
.token.keyword, |
||||
|
.token.function { |
||||
|
color: #e96900; |
||||
|
} |
||||
|
.token.statement, |
||||
|
.token.regex, |
||||
|
.token.atrule { |
||||
|
color: #22a2c9; |
||||
|
} |
||||
|
.token.placeholder, |
||||
|
.token.variable { |
||||
|
color: #3d8fd1; |
||||
|
} |
||||
|
.token.deleted { |
||||
|
text-decoration: line-through; |
||||
|
} |
||||
|
.token.inserted { |
||||
|
border-bottom: 1px dotted #202746; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.token.italic { |
||||
|
font-style: italic; |
||||
|
} |
||||
|
.token.important, |
||||
|
.token.bold { |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.token.important { |
||||
|
color: #c94922; |
||||
|
} |
||||
|
.token.entity { |
||||
|
cursor: help; |
||||
|
} |
||||
|
.markdown-section pre > code { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
background-color: #f8f8f8; |
||||
|
border-radius: 2px; |
||||
|
color: #525252; |
||||
|
display: block; |
||||
|
font-family: 'Roboto Mono', Monaco, courier, monospace; |
||||
|
font-size: 0.8rem; |
||||
|
line-height: inherit; |
||||
|
margin: 0 2px; |
||||
|
max-width: inherit; |
||||
|
overflow: inherit; |
||||
|
padding: 2.2em 5px; |
||||
|
white-space: inherit; |
||||
|
} |
||||
|
.markdown-section code::after, |
||||
|
.markdown-section code::before { |
||||
|
letter-spacing: 0.05rem; |
||||
|
} |
||||
|
code .token { |
||||
|
-moz-osx-font-smoothing: initial; |
||||
|
-webkit-font-smoothing: initial; |
||||
|
min-height: 1.5rem; |
||||
|
position: relative; |
||||
|
left: auto; |
||||
|
} |
||||
|
pre::after { |
||||
|
color: #ccc; |
||||
|
content: attr(data-lang); |
||||
|
font-size: 0.6rem; |
||||
|
font-weight: 600; |
||||
|
height: 15px; |
||||
|
line-height: 15px; |
||||
|
padding: 5px 10px 0; |
||||
|
position: absolute; |
||||
|
right: 0; |
||||
|
text-align: right; |
||||
|
top: 0; |
||||
|
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue