diff --git a/categories/index.html b/categories/index.html new file mode 100644 index 0000000..c8a68f2 --- /dev/null +++ b/categories/index.html @@ -0,0 +1,76 @@ + + + + Categories + + + + + + + + + + + + + +
+
+ + + +
+ + +
+ + + + + + + + + + diff --git a/css/35c3.min.css b/css/35c3.min.css new file mode 100644 index 0000000..ec49b04 --- /dev/null +++ b/css/35c3.min.css @@ -0,0 +1 @@ +@font-face{font-family:"35c3-font-light";src:url("fonts/35c3-light.woff2") format("woff2"),url("fonts/35c3-light.woff") format("woff");font-weight:normal;font-style:normal}@font-face{font-family:"35c3-font-black";src:url("fonts/35c3-black.woff2") format("woff2"),url("fonts/35c3-black.woff") format("woff");font-weight:bold;font-style:normal}*{box-sizing:border-box}.text-white{color:#fff}.bg-white{color:#000;background-color:#fff}.text-black{color:#000}.bg-black{color:#fff;background-color:#000}.text-fresh{color:#0084b0}.bg-fresh{color:#fff;background-color:#0084b0}.text-hope{color:#00a356}.bg-hope{color:#fff;background-color:#00a356}.text-glint{color:#f9b000}.bg-glint{color:#fff;background-color:#f9b000}.text-beat{color:#e40429}.bg-beat{color:#fff;background-color:#e40429}.text-tenacity{color:#44357e}.bg-tenacity{color:#fff;background-color:#44357e}.text-base{color:#18386b}.bg-base{color:#fff;background-color:#18386b}.text-reboot{color:#4d4d4c}.bg-reboot{color:#fff;background-color:#4d4d4c}*{font-family:"35c3-font-light"}h1,h2,h3,h4,h5,h6{font-family:"35c3-font-black"}a{color:#0084b0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-breakline{white-space:pre-wrap;word-break:break-all}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}label{font-weight:bold}blockquote{padding:10px 20px;margin:0 0 20px;border-left:4px solid transparent;border-image:linear-gradient(to bottom, #00a356, #0084b0) 1 round}code{padding:2px 4px;color:#f9b000;background-color:#4d4d4c}.table{width:100%;max-width:100%;border-spacing:0;border-collapse:collapse}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #4d4d4c}.table tr th,.table tr td{padding:8px;text-align:left;vertical-align:top;font-size:1em}hr{height:8px;border:none;background-image:linear-gradient(to right, #0084b0, #00a356)}.border{border:2px solid transparent;border-image:linear-gradient(to right, #00a356, #0084b0) 1 round}input,textarea,select{width:100%;border-radius:0;box-shadow:none;border:2px solid transparent;border-image:linear-gradient(to right, #00a356, #0084b0) 1 round;background:none;padding:6px 6px;font-size:1em;color:#4d4d4c}input:invalid,input:required,textarea:required{border-image:linear-gradient(to right, #e40429, #44357e) 1 round}input:disabled,textarea:disabled{border-image:linear-gradient(to right, #4d4d4c, #18386b) 1 round}input[type=range]{border:none;background:transparent;margin:0;padding:0;height:32px}input[type=range]:focus{outline:none}input[type=range]::-moz-range-thumb{height:26px;width:26px;border:none;border-radius:50%;background:#009483;cursor:pointer}input[type=range]::-moz-range-thumb:active,input[type=range]::-moz-range-thumb:hover{height:26px;width:26px;border:4px solid #009483;border-radius:50%;cursor:pointer}input[type=range]::-moz-range-track{width:100%;height:8px;cursor:pointer;background-image:linear-gradient(to right, #0084b0, #00a356)}select{-moz-appearance:none;appearance:none}.checkbox{position:relative;display:inline-block;width:26px;height:26px;text-indent:-9999px}.checkbox input{opacity:0;width:0;height:0}.checkbox .toggle{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0}.checkbox .toggle:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border:2px solid #4d4d4c;transition:.4s}.checkbox .toggle:after{content:"";position:absolute;width:14px;height:6px;left:5px;top:6px;border:3px solid transparent;border-top:none;border-right:none;transform:rotate(-45deg);transition:.4s}.checkbox input:checked+.toggle:after{border-color:#4d4d4c}.checkbox input:checked+.toggle:before{border-color:#0084b0;background-color:#0084b0}.checkbox.checkbox-hope input:checked+.toggle:before{border-color:#00a356;background-color:#00a356}.checkbox.checkbox-beat input:checked+.toggle:before{border-color:#e40429;background-color:#e40429}.checkbox:hover .toggle:after{border-color:#0084b0}.checkbox.checkbox-hope:hover .toggle:after{border-color:#00a356}.checkbox.checkbox-beat:hover .toggle:after{border-color:#e40429}.checkbox:hover input:checked+.toggle:before,.checkbox.checkbox-hope:hover input:checked+.toggle:before,.checkbox.checkbox-beat:hover input:checked+.toggle:before{background-color:transparent}.checkbox:hover input:checked+.toggle:after,.checkbox.checkbox-hope:hover input:checked+.toggle:after,.checkbox.checkbox-beat:hover input:checked+.toggle:after{border-color:transparent}.radio{position:relative;display:inline-block;width:26px;height:26px;text-indent:-9999px}.radio input{opacity:0;width:0;height:0}.radio .toggle{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0}.radio .toggle:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border:2px solid #4d4d4c;border-radius:100%;transition:.4s}.radio .toggle:after{content:"";position:absolute;width:11px;height:11px;left:7px;top:7px;border:1px solid transparent;border-top:none;border-right:none;border-radius:100%;transition:.4s}.radio input:checked+.toggle:after{background-color:#4d4d4c}.radio input:checked+.toggle:before{border-color:#0084b0}.radio.radio-hope input:checked+.toggle:before{border-color:#00a356}.radio.radio-beat input:checked+.toggle:before{border-color:#e40429}.radio:hover .toggle:after,.radio input:checked+.toggle:after{background-color:#0084b0}.radio.radio-hope:hover .toggle:after,.radio.radio-hope input:checked+.toggle:after{background-color:#00a356}.radio.radio-beat:hover .toggle:after,.radio.radio-beat input:checked+.toggle:after{background-color:#e40429}.switch{position:relative;display:inline-block;width:48px;height:26px;text-indent:-9999px}.switch input{opacity:0;width:0;height:0}.switch .toggle{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0}.switch .toggle:before{position:absolute;top:3px;left:0;right:0;bottom:3px;content:"";background-color:#4d4d4c;border-radius:26px;transition:.4s}.switch .toggle:after{position:absolute;content:"";height:26px;width:26px;left:0;bottom:0;background-color:#0084b0;transition:.2s;border-radius:50%;transition:.4s}.switch.switch-hope .toggle:after{background-color:#00a356}.switch.switch-beat .toggle:after{background-color:#e40429}.switch input:checked+.toggle:after{transform:translateX(23px);background-color:#4d4d4c}.switch input:checked+.toggle:before{background-color:#0084b0}.switch.switch-hope input:checked+.toggle:before{background-color:#00a356}.switch.switch-beat input:checked+.toggle:before{background-color:#e40429}button{font-size:1em}.btn{display:inline-block;text-align:center;padding:8px;cursor:pointer;white-space:nowrap;vertical-align:middle;border:none;color:#4d4d4c;background-color:transparent}.btn:hover{opacity:.8}.btn:active{opacity:.9}.btn-white{background-color:#fff}.btn-black{background-color:#000}.btn-fresh{color:#fff;background-color:#0084b0}.btn-hope{color:#fff;background-color:#00a356}.btn-glint{color:#fff;background-color:#f9b000}.btn-beat{color:#fff;background-color:#e40429}.btn-tenacity{color:#fff;background-color:#44357e}.btn-base{color:#fff;background-color:#18386b}.btn-reboot{color:#fff;background-color:#4d4d4c}.btn.btn-block{width:100%}.btn-xs{font-size:.7em;padding:4px}.btn-sm{font-size:.9em;padding:6px}.btn-xl{font-size:1.2em;padding:10px}.btn-round{width:2.33em;height:2.33em;border-radius:50%;overflow:hidden;display:inline-flex;justify-content:center;align-items:center;flex-direction:row}.img-auto{display:block;max-width:100%;height:auto}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media screen and (min-width: 768px){.container{width:744.96px}}@media screen and (min-width: 992px){.container{width:962.24px}}@media screen and (min-width: 1200px){.container{width:1164px}}@media screen and (min-width: 1800px){.container{width:1746px}}.row{display:grid;grid-template-columns:repeat(12, 1fr);grid-row-gap:8px;grid-column-gap:8px}.col-1{grid-column-end:span 1}.col-offset-1{grid-column-start:2}.col-2{grid-column-end:span 2}.col-offset-2{grid-column-start:3}.col-3{grid-column-end:span 3}.col-offset-3{grid-column-start:4}.col-4{grid-column-end:span 4}.col-offset-4{grid-column-start:5}.col-5{grid-column-end:span 5}.col-offset-5{grid-column-start:6}.col-6{grid-column-end:span 6}.col-offset-6{grid-column-start:7}.col-7{grid-column-end:span 7}.col-offset-7{grid-column-start:8}.col-8{grid-column-end:span 8}.col-offset-8{grid-column-start:9}.col-9{grid-column-end:span 9}.col-offset-9{grid-column-start:10}.col-10{grid-column-end:span 10}.col-offset-10{grid-column-start:11}.col-11{grid-column-end:span 11}.col-offset-11{grid-column-start:12}.col-12{grid-column-end:span 12}.col-offset-12{grid-column-start:13}@media screen and (max-width: 767px){.col-xs-1{grid-column-end:span 1}.col-xs-offset-1{grid-column-start:2}.col-xs-2{grid-column-end:span 2}.col-xs-offset-2{grid-column-start:3}.col-xs-3{grid-column-end:span 3}.col-xs-offset-3{grid-column-start:4}.col-xs-4{grid-column-end:span 4}.col-xs-offset-4{grid-column-start:5}.col-xs-5{grid-column-end:span 5}.col-xs-offset-5{grid-column-start:6}.col-xs-6{grid-column-end:span 6}.col-xs-offset-6{grid-column-start:7}.col-xs-7{grid-column-end:span 7}.col-xs-offset-7{grid-column-start:8}.col-xs-8{grid-column-end:span 8}.col-xs-offset-8{grid-column-start:9}.col-xs-9{grid-column-end:span 9}.col-xs-offset-9{grid-column-start:10}.col-xs-10{grid-column-end:span 10}.col-xs-offset-10{grid-column-start:11}.col-xs-11{grid-column-end:span 11}.col-xs-offset-11{grid-column-start:12}.col-xs-12{grid-column-end:span 12}.col-xs-offset-12{grid-column-start:13}}@media screen and (min-width: 768px){.col-sm-1{grid-column-end:span 1}.col-sm-offset-1{grid-column-start:2}.col-sm-2{grid-column-end:span 2}.col-sm-offset-2{grid-column-start:3}.col-sm-3{grid-column-end:span 3}.col-sm-offset-3{grid-column-start:4}.col-sm-4{grid-column-end:span 4}.col-sm-offset-4{grid-column-start:5}.col-sm-5{grid-column-end:span 5}.col-sm-offset-5{grid-column-start:6}.col-sm-6{grid-column-end:span 6}.col-sm-offset-6{grid-column-start:7}.col-sm-7{grid-column-end:span 7}.col-sm-offset-7{grid-column-start:8}.col-sm-8{grid-column-end:span 8}.col-sm-offset-8{grid-column-start:9}.col-sm-9{grid-column-end:span 9}.col-sm-offset-9{grid-column-start:10}.col-sm-10{grid-column-end:span 10}.col-sm-offset-10{grid-column-start:11}.col-sm-11{grid-column-end:span 11}.col-sm-offset-11{grid-column-start:12}.col-sm-12{grid-column-end:span 12}.col-sm-offset-12{grid-column-start:13}}@media screen and (min-width: 992px){.col-md-1{grid-column-end:span 1}.col-md-offset-1{grid-column-start:2}.col-md-2{grid-column-end:span 2}.col-md-offset-2{grid-column-start:3}.col-md-3{grid-column-end:span 3}.col-md-offset-3{grid-column-start:4}.col-md-4{grid-column-end:span 4}.col-md-offset-4{grid-column-start:5}.col-md-5{grid-column-end:span 5}.col-md-offset-5{grid-column-start:6}.col-md-6{grid-column-end:span 6}.col-md-offset-6{grid-column-start:7}.col-md-7{grid-column-end:span 7}.col-md-offset-7{grid-column-start:8}.col-md-8{grid-column-end:span 8}.col-md-offset-8{grid-column-start:9}.col-md-9{grid-column-end:span 9}.col-md-offset-9{grid-column-start:10}.col-md-10{grid-column-end:span 10}.col-md-offset-10{grid-column-start:11}.col-md-11{grid-column-end:span 11}.col-md-offset-11{grid-column-start:12}.col-md-12{grid-column-end:span 12}.col-md-offset-12{grid-column-start:13}}@media screen and (min-width: 1200px){.col-lg-1{grid-column-end:span 1}.col-lg-offset-1{grid-column-start:2}.col-lg-2{grid-column-end:span 2}.col-lg-offset-2{grid-column-start:3}.col-lg-3{grid-column-end:span 3}.col-lg-offset-3{grid-column-start:4}.col-lg-4{grid-column-end:span 4}.col-lg-offset-4{grid-column-start:5}.col-lg-5{grid-column-end:span 5}.col-lg-offset-5{grid-column-start:6}.col-lg-6{grid-column-end:span 6}.col-lg-offset-6{grid-column-start:7}.col-lg-7{grid-column-end:span 7}.col-lg-offset-7{grid-column-start:8}.col-lg-8{grid-column-end:span 8}.col-lg-offset-8{grid-column-start:9}.col-lg-9{grid-column-end:span 9}.col-lg-offset-9{grid-column-start:10}.col-lg-10{grid-column-end:span 10}.col-lg-offset-10{grid-column-start:11}.col-lg-11{grid-column-end:span 11}.col-lg-offset-11{grid-column-start:12}.col-lg-12{grid-column-end:span 12}.col-lg-offset-12{grid-column-start:13}}@media screen and (min-width: 1800px){.col-xl-1{grid-column-end:span 1}.col-xl-offset-1{grid-column-start:2}.col-xl-2{grid-column-end:span 2}.col-xl-offset-2{grid-column-start:3}.col-xl-3{grid-column-end:span 3}.col-xl-offset-3{grid-column-start:4}.col-xl-4{grid-column-end:span 4}.col-xl-offset-4{grid-column-start:5}.col-xl-5{grid-column-end:span 5}.col-xl-offset-5{grid-column-start:6}.col-xl-6{grid-column-end:span 6}.col-xl-offset-6{grid-column-start:7}.col-xl-7{grid-column-end:span 7}.col-xl-offset-7{grid-column-start:8}.col-xl-8{grid-column-end:span 8}.col-xl-offset-8{grid-column-start:9}.col-xl-9{grid-column-end:span 9}.col-xl-offset-9{grid-column-start:10}.col-xl-10{grid-column-end:span 10}.col-xl-offset-10{grid-column-start:11}.col-xl-11{grid-column-end:span 11}.col-xl-offset-11{grid-column-start:12}.col-xl-12{grid-column-end:span 12}.col-xl-offset-12{grid-column-start:13}}.hidden{display:none}.visible,.visible-block{display:block}.visible-inline{display:inline}.visible-inline-block{display:inline-block}.visible-print,.visible-print-block,.visible-print-inline,.visible-print-inline-block{display:none}@media print{.hidden-print{display:none}.visible-print,.visible-print-block{display:block}.visible-print-inline{display:inline}.visible-print-inline-block{display:inline-block}}@media screen and (max-width: 767px){.hidden-xs{display:none}.visible-xs,.visible-xs-block{display:block}.visible-xs-inline{display:inline}.visible-xs-inline-block{display:inline-block}}@media screen and (min-width: 768px)and (max-width: 991px){.hidden-sm{display:none}.visible-sm,.visible-sm-block{display:block}.visible-sm-inline{display:inline}.visible-sm-inline-block{display:inline-block}}@media screen and (min-width: 992px)and (max-width: 1199px){.hidden-md{display:none}.visible-md,.visible-md-block{display:block}.visible-md-inline{display:inline}.visible-md-inline-block{display:inline-block}}@media screen and (min-width: 1200px)and (max-width: 1799px){.hidden-lg{display:none}.visible-lg,.visible-lg-block{display:block}.visible-lg-inline{display:inline}.visible-lg-inline-block{display:inline-block}}@media screen and (min-width: 1800px){.hidden-xl{display:none}.visible-xl,.visible-xl-block{display:block}.visible-xl-inline{display:inline}.visible-xl-inline-block{display:inline-block}}/*# sourceMappingURL=35c3.min.css.map */ diff --git a/css/fonts/35c3-black.woff b/css/fonts/35c3-black.woff new file mode 100644 index 0000000..05da8f2 Binary files /dev/null and b/css/fonts/35c3-black.woff differ diff --git a/css/fonts/35c3-black.woff2 b/css/fonts/35c3-black.woff2 new file mode 100644 index 0000000..23bf0a3 Binary files /dev/null and b/css/fonts/35c3-black.woff2 differ diff --git a/css/fonts/35c3-light.woff b/css/fonts/35c3-light.woff new file mode 100644 index 0000000..a3660d0 Binary files /dev/null and b/css/fonts/35c3-light.woff differ diff --git a/css/fonts/35c3-light.woff2 b/css/fonts/35c3-light.woff2 new file mode 100644 index 0000000..5ab01ce Binary files /dev/null and b/css/fonts/35c3-light.woff2 differ diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..2bc127b --- /dev/null +++ b/css/main.css @@ -0,0 +1,11 @@ +@import "reveal.css"; + +.reveal .slides { + text-align: left; +} +body { + background-image: url(https://ccchb.de/logo/CCCHB-logo_256x256_bw.png); + background-position: left 20px top 10px; + background-repeat: no-repeat; + background-size: 8% auto; +} diff --git a/css/reveal.css b/css/reveal.css new file mode 100644 index 0000000..e225c83 --- /dev/null +++ b/css/reveal.css @@ -0,0 +1,293 @@ +@import "35c3.min.css"; + +body { + color:#fff; + background-color:#000; + font-size: 32px; + font-weight: normal; + padding: 5px; +} + +.reveal { + padding: 5px; + border: 8px solid; + border-image: linear-gradient(to right, #00a356, #0084b0) 1; +} + +.reveal .controls { + color: #00a356; + right: 50px; + bottom: 50px; +} + +::selection { + color: #fff; + background: #ffc0d5; + text-shadow: none; +} + +::-moz-selection { + color: #fff; + background: #ffc0d5; + text-shadow: none; +} + +.reveal .slides > section, +.reveal .slides > section > section { + line-height: 1.3; + font-weight: inherit; +} + +/********************************************* + * HEADERS + *********************************************/ +.reveal h1, +.reveal h2, +.reveal h3, +.reveal h4, +.reveal h5, +.reveal h6 { + margin: 0 0 20px 0; + font-weight: 700; + line-height: 1.2; + letter-spacing: normal; + text-transform: uppercase; + text-shadow: none; + word-wrap: break-word; +} + +.reveal h1 { + font-size: 2.6em; +} + +.reveal h2 { + font-size: 2.2em; +} + +.reveal h3 { + font-size: 1.7em; +} + +.reveal h4 { + font-size: 1.4em; +} + +.reveal h1 { + text-shadow: none; +} + +/********************************************* + * OTHER + *********************************************/ +.reveal p { + margin: 20px 0; + line-height: 1.3; +} + +/* Ensure certain elements are never larger than the slide itself */ +.reveal img, +.reveal video, +.reveal iframe { + max-width: 95%; + max-height: 95%; +} + +.reveal strong, +.reveal b { + font-weight: bold; +} + +.reveal em { + font-style: italic; +} + +.reveal ol, +.reveal dl, +.reveal ul { + display: inline-block; + text-align: left; + margin: 0 0 0 1em; +} + +.reveal ol { + list-style-type: decimal; +} + +.reveal ul { + list-style-type: disc; +} + +.reveal ul ul { + list-style-type: square; +} + +.reveal ul ul ul { + list-style-type: circle; +} + +.reveal ul ul, +.reveal ul ol, +.reveal ol ol, +.reveal ol ul { + display: block; + margin-left: 40px; +} + +.reveal dt { + font-weight: bold; +} + +.reveal dd { + margin-left: 40px; +} + +.reveal blockquote { + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); +} + +.reveal blockquote p:first-child, +.reveal blockquote p:last-child { + display: inline-block; +} + +.reveal q { + font-style: italic; +} + +.reveal pre { + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); + border: 2px solid transparent; + border-image: linear-gradient(to right, #00a356, #0084b0) 1 round; +} + +.reveal code { + font-family: monospace; + text-transform: none; +} + +.reveal pre code { + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; +} + +.reveal table { + margin: auto; + border-collapse: collapse; + border-spacing: 0; +} + +.reveal table th { + font-weight: bold; +} + +.reveal table th, +.reveal table td { + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; +} + +.reveal table th[align="center"], +.reveal table td[align="center"] { + text-align: center; +} + +.reveal table th[align="right"], +.reveal table td[align="right"] { + text-align: right; +} + +.reveal table tbody tr:last-child th, +.reveal table tbody tr:last-child td { + border-bottom: none; +} + +.reveal sup { + vertical-align: super; +} + +.reveal sub { + vertical-align: sub; +} + +.reveal small { + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; +} + +.reveal small * { + vertical-align: top; +} + +/********************************************* + * LINKS + *********************************************/ +.reveal .roll span:after { + color: #fff; + background: #f30053; +} + +/********************************************* + * IMAGES + *********************************************/ +.reveal section img { + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 4px solid #363636; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); +} + +.reveal section img.plain { + border: 0; + box-shadow: none; +} + +.reveal a img { + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + transition: all .15s linear; +} + +.reveal a:hover img { + background: rgba(255, 255, 255, 0.2); + border-color: #00a356; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); +} + +/********************************************* + * PROGRESS BAR + *********************************************/ + +.reveal .progress span { + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); +} + +.reveal .progress { + margin: 2px; + z-index: 1000; + background: rgba(0, 0, 0, 0.2); + color: #00a356; +} diff --git a/decentral_messaging/img/central.svg b/decentral_messaging/img/central.svg new file mode 100644 index 0000000..4dc6bb8 --- /dev/null +++ b/decentral_messaging/img/central.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/decentral_messaging/img/federation.svg b/decentral_messaging/img/federation.svg new file mode 100644 index 0000000..cfdb128 --- /dev/null +++ b/decentral_messaging/img/federation.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decentral_messaging/img/j2me-bombus.jpg b/decentral_messaging/img/j2me-bombus.jpg new file mode 100644 index 0000000..637bda4 Binary files /dev/null and b/decentral_messaging/img/j2me-bombus.jpg differ diff --git a/decentral_messaging/img/p2p.svg b/decentral_messaging/img/p2p.svg new file mode 100644 index 0000000..be58e79 --- /dev/null +++ b/decentral_messaging/img/p2p.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/decentral_messaging/index.html b/decentral_messaging/index.html new file mode 100644 index 0000000..12c657a --- /dev/null +++ b/decentral_messaging/index.html @@ -0,0 +1,562 @@ + + + + Dezentrale Messenger + + + + + + + + + + + + + +
+
+ +
+ +

Dezentrale Messenger

+
+

The very last word in instant messaging

+(Motto vom XMPP-Client Converations)

+ +

genofire - Chaos Computer Club Bremen e.V.

+ +
+ +

Agenda

+ +
    +
  • Dezentralität
  • +
  • XMPP - Der Standard
  • +
  • Software (Client und Server)
  • +
  • Ist der Hoster gut
  • +
  • Verschlüsselung
  • +
  • Ausblick
  • +
  • Alternativen
  • +
+ +
+ +

Dezentralität

+ +
    +
  • vs. Zentralität
  • +
+ +

Leider von den meisten Messenger verwendet

+ +

+ +
+ +

Dezentralität

+ +
    +
  • Federation
  • +
+ +

Kommunikation über verschieden unabhängige zentrale Komponenten

+ +

+ + + +
+ +

Dezentralität

+ +
    +
  • Peer-to-Peer
  • +
+ +

Geräte tauschen direkt miteinander Nachrichten aus (ohne eine zentrale Componente)

+ +

+ + + +
+ +

Dezentralität

+ +

Warum notwendig?

+ +
    +
  • Eröffnet ein Wettbewerb
  • +
  • kleine und viele Angriffsziele + +
      +
    • vor Kriminelle
    • +
    • vor Regierungen
    • +
    • alle Überwachen
    • +
    • blockieren / sperren (Zensur)
    • +
  • +
  • Verringert Missbrauch durch Vertrauen
  • +
+ + + +
+ +

Dezentralität

+ +

Nachteile

+ +
    +
  • Komplexität steigt
  • +
  • Gewollte Verringerung an Marktanteil
  • +
  • Kann auch von kriminellen Elementen genutzt werden
  • +
  • Nutzer müssen ggf. sich Ihre Adresse und Passwort merken
  • +
+ + + +
+ +

Extensible Messaging and Presence Protocol (XMPP)

+ +
    +
  • Existiert seit 1999 (unter den Namen Jabber)
  • + +
  • IETF Standard seit 2002

  • + +
  • Google Talk 2005 - 2013 (entwickelte Jingle)

  • + +
  • Facebook 2010 - 2014

  • + +
  • WhatsApp nutzt es intern

  • +
+ + + +
+ +

XMPP

+ +

Adressierung

+ +

JID (Jabber ID) genannt:

+ +
node@domain/ressource
+
+ +

URI-Format: (falls MUC mit ?join am Ende)

+ +
xmpp:node@domain?join
+
+ + + +
+ +

XMPP

+ +

Message

+ +
<message from="geno@fireorbit.de"
+ to="#ccchb@irc.hackint.org" type="groupchat">
+	Hello World
+</message>
+
+ +

Types:

+ +
    +
  • chat
  • +
  • groupchat
  • +
  • headline
  • +
  • normal
  • +
  • error
  • +
+ +
+ +

XMPP

+ +

Present: Aktuelle Live Informationen

+ +
<present to="#ccchb@irc.hackint.org" type="subscribe">
+</present>
+
+ +

Types:

+ +
    +
  • error
  • +
  • probe
  • +
  • subscribe(d)
  • +
  • unavailable
  • +
  • unsubscribe(d)
  • +
+ +
+ +

XMPP

+ +

IQ (Instant Query): Abfragen mit Rückantworten

+ +
<iq to="irc.hackint.org" type="get">
+	<ping xmlns='urn:xmpp:ping'/>
+</iq>
+
+ +

Types:

+ +
    +
  • get
  • +
  • set
  • +
  • result
  • +
  • error
  • +
+ + + +
+ +

Software Clients

+ +

Empfehlungen:

+ +
    +
  • Conversations (Android) + +
      +
    • Pix-Art Messenger
    • +
  • +
  • ChatSecure (iPhone)
  • +
  • Gajim (Desktop)
  • +
  • ConverseJS (WebClient)
  • +
  • Viele mehr + +
  • +
+ +
+ +

Software Clients

+ +

Bombus - Client in J2ME für normale Telefone +

+ Wikipedia - Article Java +

+ +
+ +

Software Server

+ +
    +
  • prosody in lua

    + +
      +
    • leicht erweiterbar
    • +
    • riesige Sammlung an erweiterbaren Modulen (die man nutzen muss)
    • +
  • + +
  • ejabberd (Fork: mongooseIM) in erlang

    + +
      +
    • besitzt alle nötigen Funktionen von Haus aus
    • +
    • sehr gut gewartet
    • +
  • + +
  • OpenFire in Java

  • +
+ +
+ +

Ist der Hoster gut

+ +

Tools zum Testen des Servers (Auswahl an Servern)

+ + + +

XEPs:

+ +
    +
  • PEP / PubSub
  • +
  • MAM (für MUC)
  • +
  • HTTP-Upload
  • +
  • DNS-SRV for TLS (HTTPS)
  • +
+ + + +
+ +

XMPP

+ +

Verschlüsselung

+ +
    +
  • Off-The-Record
  • +
  • OpenPGP
  • +
  • OX
  • +
  • OMEMO
  • +
+ +

Detailert: here

+ + + +
+ +

XMPP Verschlüsselung

+ +
    +
  • Geräte erstellt asynchrones Schlüsselpaar + +
      +
    • öffentlichen Schlüssel wird per PubSub auf dem Server hinterlegt
    • +
  • +
  • Kontakte werden durch PEP / PubSub über neuen Schlüssel informiert + +
      +
    • Dieser muss diesen öffentlichen Schlüssel laden
    • +
  • +
+ + + +
+ +

+

Demo

+Anleitung +

+ +
+ +

Ausblick

+ +
    +
  • Transports + +
      +
    • Biboumi: IRC
    • +
    • Spectrum2: e.g AIM, ICQ, MSN, Yahoo, Telegram, Twitter, “WhatsApp”
    • +
  • +
  • PubSub + +
      +
    • Blogging / Posting (siehe Movim)
    • +
  • +
  • Commands + +
      +
    • Internet of Things
    • +
  • +
+ +

XEP-Liste letzter Eintrag: XEP-0410: MUC Self-Ping (Schrödinger’s Chat)

+ + + +
+ +

Alternativen zu XMPP

+ +

Peer-to-Peer

+ +
    +
  • Nutzen das Tor-Netzwerk + +
      +
    • Tox
    • +
    • Briar + +
        +
      • kann auch Local per Wifi und Bluetooth genutzt werden
      • +
    • +
    • … (viele mehr)
    • +
  • + +
  • libp2p

  • + +
  • (mir sonst keine Weiteren bekannt …)

  • +
+ +
+ +

Alternativen zu XMPP

+ +

Federation

+ +
    +
  • Matrix (Riot): + +
      +
    • Änderungsvorschläge am Protokoll werden durch das Unternehmen entschieden
    • +
  • +
  • (mir sonst keine Weiteren bekannt …)
  • +
+ +
+ +

+

Ende

+

Hackerethik

+ +

3. Mißtraue Autoritäten – fördere Dezentralisierung. +

+
+ +
+ + +
+ + + + + + + + + + diff --git a/highlight-js/.editorconfig b/highlight-js/.editorconfig new file mode 100644 index 0000000..821eb72 --- /dev/null +++ b/highlight-js/.editorconfig @@ -0,0 +1,8 @@ +[*] +end_of_line = lf +insert_final_newline = true + +[*.{js,css}] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/highlight-js/.gitattributes b/highlight-js/.gitattributes new file mode 100644 index 0000000..5c7d623 --- /dev/null +++ b/highlight-js/.gitattributes @@ -0,0 +1,4 @@ +# The build script and some tests use `\n` as markers, so we need to make sure +# that all javascript files are checked out using UNIX line endings (not `\r\n`) +*.js eol=lf +*.txt eol=lf \ No newline at end of file diff --git a/highlight-js/.gitignore b/highlight-js/.gitignore new file mode 100644 index 0000000..9fef4d6 --- /dev/null +++ b/highlight-js/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +build +docs/_build +.idea/ +__pycache__ +*.swp +node_modules +.project +yarn.lock diff --git a/highlight-js/.travis.yml b/highlight-js/.travis.yml new file mode 100644 index 0000000..7ef674f --- /dev/null +++ b/highlight-js/.travis.yml @@ -0,0 +1,30 @@ +language: node_js +node_js: + - "lts/*" + - "node" +env: + - + - BROWSER=1 + - BROWSER=1 NOCOMPRESS=1 +script: + - | + export BUILD_PARAMS="" + + if [ "x$BROWSER" = "x1" ]; then + export BUILD_PARAMS="$BUILD_PARAMS -t browser" + else + export BUILD_PARAMS="$BUILD_PARAMS -t node" + fi + + if [ "x$NOCOMPRESS" = "x1" ]; then + export BUILD_PARAMS="$BUILD_PARAMS -n" + fi + + node tools/build.js $BUILD_PARAMS + + if [ "x$BROWSER" = "x1" ]; then + npm run test-browser + else + npm run test + fi +sudo: false # Use container-based architecture diff --git a/highlight-js/AUTHORS.en.txt b/highlight-js/AUTHORS.en.txt new file mode 100644 index 0000000..4ae292c --- /dev/null +++ b/highlight-js/AUTHORS.en.txt @@ -0,0 +1,274 @@ +Syntax highlighting with language autodetection. + +URL: https://highlightjs.org/ + +Current core developers (alphabetical): + +- Gidi Meir Morris +- Jan T. Sott +- Li Xuanji +- Marcos Cáceres +- Sang Dang + +Former maintainers: + +- Ivan Sagalaev (original author) +- Jeremy Hull +- Oleg Efimov + +Contributors: + +- Peter Leonov +- Victor Karamzin +- Vsevolod Solovyov +- Anton Kovalyov +- Nikita Ledyaev +- Konstantin Evdokimenko +- Dmitri Roudakov +- Yuri Ivanov +- Vladimir Ermakov +- Vladimir Gubarkov +- Brian Beck +- MajestiC +- Vasily Polovnyov +- Vladimir Epifanov +- Alexander Makarov +- Vah +- Shuen-Huei Guan +- Jason Diamond +- Michal Gabrukiewicz +- Ruslan Keba +- Sergey Baranov +- Zaripov Yura +- Oleg Volchkov +- Vasily Mikhailitchenko +- Jan Berkel +- Vladimir Moskva +- Loren Segal +- Andrew Fedorov +- Igor Kalnitsky +- Valerii Hiora +- Nikolay Zakharov +- Dmitry Kovega +- Sergey Ignatov +- Antono Vasiljev +- Stephan Kountso +- pumbur +- John Crepezzi +- Andrey Vlasovskikh +- Alexander Myadzel +- Evgeny Stepanischev +- Dmytrii Nagirniak +- Luigi Maselli +- Denis Bardadym +- Aahan Krish +- Ilya Baryshev +- Aleksandar Ruzicic +- Joe Cheng +- Angel G. Olloqui +- Jason Tate +- Sergey Tikhomirov +- Marc Fornos +- Yoshihide Jimbo +- Casey Duncan +- Eugene Nizhibitsky +- Alberto Gimeno +- Kirk Kimmel +- Nathan Grigg +- Dr. Drang +- Robin Ward +- Dmitry Medvinsky +- Jason Jacobson +- Jonas Follesø +- Dan Allen +- noformnocontent +- Damien White +- Alexander Marenin +- Cédric Néhémie +- Simon Madine +- Benjamin Pannell +- Eric Knibbe +- Poren Chiang +- Kelley van Evert +- Kurt Emch +- Mehdi Dogguy +- Nicolas Braud-Santoni +- Ralf Bitter +- Sylvestre Ledru +- Troy Kershaw +- Zena Treep +- Daniel Kvasnicka +- Carlo Kok +- Bram de Haan +- Seongwon Lee +- Zaven Muradyan +- Brent Bradbury +- Martin Dilling-Hansen +- Ilya Vassilevsky +- Josh Adams +- Dan Tao +- Jeff Escalante +- Jun Yang +- Nikolay Lisienko +- Heiko August +- Domen Kožar +- Travis Odom +- innocenat +- Arthur Bikmullin +- Pascal Hurni +- Roman Shmatov +- Nic West +- Panu Horsmalahti +- Flaviu Tamas +- Damian Mee +- Christopher Kaster +- Chris Eidhof +- Nate Cook +- Matt Diephouse +- Erik Osheim +- Guillaume Laforge +- Lucas Mazza +- Maxim Dikun +- Henrik Feldt +- Anton Kochkov +- Michael Allen +- JP Verkamp +- Adam Joseph Cook +- Sergey Vidyuk +- Radek Liska +- Jose Molina Colmenero +- Max Mikhailov +- Bryant Williams +- Erik Paluka +- Luke Holder +- David Mohundro +- Nicholas Blumhardt +- Christophe de Dinechin +- Taneli Vatanen +- Jen Evers-Corvina +- Kassio Borges +- Cedric Sohrauer +- Mickaël Delahaye +- Hakan Özler +- Trey Shugart +- Vincent Zurczak +- Adam Joseph Cook +- Edwin Dalorzo +- mucaho +- Dennis Titze +- Jon Evans +- Brian Quistorff +- Jonathan Suever +- Alexis Hénaut +- Chris Kiehl +- Peter Piwowarski +- Kenta Sato +- Anthony Scemama +- Taufik Nurrohman +- Pedro Oliveira +- Gu Yiling +- Thomas Applencourt +- Andrew Farmer +- Sergey Mashkov +- Raivo Laanemets +- Kenneth Fuglsang +- David Anson +- Louis Barranqueiro +- Tim Schumacher +- Lucas Werkmeister +- Dan Panzarella +- Bruno Dias +- Jay Strybis +- Guillaume Gomez +- Janis Voigtländer +- Dirk Kirsten +- MY Sun +- Vadimtro +- Benjamin Auder +- Dotan Dimet +- Manh Tuan +- Philippe Charrière +- Stefan Bechert +- Samuel Reed +- Yury Selivanov +- Tsuyusato Kitsune +- Mick MacCallum +- Kristoffer Gronlund +- Søren Enevoldsen +- Daniel Rosenwasser +- Ladislav Prskavec +- Jan Kühle +- Stefan Wienert +- Nikita Savchenko +- Stefania Mellai +- Nebuleon Fumika +- prince +- Brendan Rocks +- Raphaël Assénat +- Matt Evans +- Martin Braun +- Boris Cherny +- John Foster +- Robert Dodier +- Anthony Dugois +- Qeole +- Denis Ciccale +- Michael Johnston +- Taras +- Philipp Wolfer +- Mikko Kouhia +- Billy Quith +- Herbert Shin +- Tristano Ajmone +- Taisuke Fujimoto +- Boone Severson +- Victor Zhou +- Lars Schulna +- Jacob Childress +- Gavin Siu +- Builder's Brewery +- Sergey Bronnikov +- Joe Eli McIlvain +- Stephan Boyer +- Alex McKibben +- Daniel Gamage +- Matthew Daly +- Magnus Madsen +- Camil Staps +- Alexander Lichter +- Nicolas Le Gall +- Kenton Hamaluik +- Marvin Saignat +- Michael Rodler +- Sergey Sobko +- Hale Chan +- Kasper Andersen +- Philipp A. +- Guannan Wei +- Sam Wu +- Ike Ku +- Andres Täht +- Rene Saarsoo +- Jordi Petit +- Raphaël Parrëe +- Joël Porquet +- Alex Arslan +- Stanislav Belov +- Ivan Dementev +- Nicolas LLOBERA +- Morten Piibeleht +- Martin Clausen +- Arctic Ice Studio +- Google Inc. (David Benjamin) +- Ahmad Awais +- Tristian Kelly +- Melissa Geels +- Dmitriy Tarasov +- Egor Rogov +- Meseta +- Harmon +- Eric Bailey +- Gustavo Costa +- Antoine Boisier-Michaud +- Alejandro Isaza +- Laurent Voullemier diff --git a/highlight-js/CHANGES.md b/highlight-js/CHANGES.md new file mode 100644 index 0000000..0c924be --- /dev/null +++ b/highlight-js/CHANGES.md @@ -0,0 +1,1757 @@ +## Master + +New languages: + +New styles: + +Improvements: + +- Fixed Dockerfile definition when using highlight continuation parameter, by [Laurent Voullemier][] +- Added tests & new `annotation` and `verbatim` keywords to *Crystal*, by [Benoit de Chezelles][] +- Added missing dockerfile markup tests, by [Laurent Voullemier][] + Allow empty prompt text in clojure-repl, by [Egor Rogov][] +- Fixed several issues with *Crystal* language definition, by [Johannes Müller][] +- Added `C#` as an alias for *CSharp* language, by [Ahmed Atito][] +- Added generic user-defined proc support, new compiler define, refactor to re-use rules, and add tests to *GAUSS*, by [Matthew Evans][] +- Improve *Crystal* language to highlight regexes after some keywords, by [Tsuyusato Kitsune][] +- Fix filterByQualifiers: fileInfo can be null + +[Laurent Voullemier]: https://github.com/l-vo +[Benoit de Chezelles]: https://github.com/bew +[Johannes Müller]: https://github.com/straight-shoota +[Ahmed Atito]: https://github.com/atitoa93 +[Matthew Evans]: https://github.com/matthewevans +[Tsuyusato Kitsune]: https://github.com/MakeNowJust + +## Version 9.13.1 + +Improvements: + +- *C#* function declarations no longer include trailing whitespace, by [JeremyTCD][] +- Added new and missing keywords to *AngelScript*, by [Melissa Geels][] +- *TypeScript* decorator factories highlighting fix, by [Antoine Boisier-Michaud][] +- Added support for multiline strings to *Swift*, by [Alejandro Isaza][] +- Fixed issue that was causing some minifiers to fail. +- Fixed `autoDetection` to accept language aliases. + +[JeremyTCD]: https://github.com/JeremyTCD +[Melissa Geels]: https://github.com/codecat +[Antoine Boisier-Michaud]: https://github.com/Aboisier +[Alejandro Isaza]: https://github.com/alejandro-isaza + +## Version 9.13.0 + +New languages: + +- *ArcGIS Arcade* by [John Foster][] +- *AngelScript* by [Melissa Geels][] +- *GML* by [meseta][] +- *isbl* built-in language DIRECTUM and Conterra by [Dmitriy Tarasov][]. +- *PostgreSQL* SQL dialect and PL/pgSQL language by [Egor Rogov][]. +- *ReasonML* by [Gidi Meir Morris][] +- *SAS* by [Mauricio Caceres Bravo][] +- *Plaintext* by [Egor Rogov][] +- *.properties* by [bostko][] and [Egor Rogov][] + +New styles: + +- *a11y-dark theme* by [Eric Bailey][] +- *a11y-light theme* by [Eric Bailey][] +- *An Old Hope* by [Gustavo Costa][] +- *Atom One Dark Reasonable* by [Gidi Meir Morris][] +- *isbl editor dark* by [Dmitriy Tarasov][] +- *isbl editor light* by [Dmitriy Tarasov][] +- *Lightfair* by [Tristian Kelly][] +- [*Nord*][nord-highlightjs] by [Arctic Ice Studio][] +- *[🦄 Shades of Purple](https://github.com/ahmadawais/Shades-of-Purple-HighlightJS)* by [Ahmad Awais][] + +Improvements: + +- New attribute `endSameAsBegin` for nested constructs with variable names + by [Egor Rogov][]. +- *Python* highlighting of escaped quotes fixed by [Harmon][] +- *PHP*: Added alias for php7, by [Vijaya Chandran Mani][] +- *C++* string handling, by [David Benjamin][] +- *Swift* Add `@objcMembers` to `@attributes`, by [Berk Çebi][] +- Infrastructural changes by [Marcos Cáceres][] +- Fixed metachars highighting for *NSIS* by [Jan T. Sott][] +- *Yaml* highlight local tags as types by [Léo Lam][] +- Improved highlighting for *Elixir* by [Piotr Kaminski][] +- New attribute `disableAutodetect` for preventing autodetection by [Egor Rogov][] +- *Matlab*: transpose operators and double quote strings, by [JohnC32][] and [Egor Rogov][] +- Various documentation typos and improvemets by [Jimmy Wärting][], [Lutz Büch][], [bcleland][] +- *Cmake* updated with new keywords and commands by [Deniz Bahadir][] + +[Ahmad Awais]: https://github.com/ahmadawais +[Arctic Ice Studio]: https://github.com/arcticicestudio +[Dmitriy Tarasov]: https://github.com/MedvedTMN +[Egor Rogov]: https://github.com/egor-rogov +[Eric Bailey]: https://github.com/ericwbailey +[Gidi Meir Morris]: https://github.com/gmmorris +[Gustavo Costa]: https://github.com/gusbemacbe +[Harmon]: https://github.com/Harmon758 +[Melissa Geels]: https://github.com/codecat +[meseta]: https://github.com/meseta +[nord-highlightjs]: https://github.com/arcticicestudio/nord-highlightjs +[Tristian Kelly]: https://github.com/TristianK3604 +[Vijaya Chandran Mani]: https://github.com/vijaycs85 +[John Foster]: https://github.com/jf990 +[David Benjamin]: https://github.com/davidben +[Berk Çebi]: https://github.com/berkcebi +[Mauricio Caceres Bravo]: https://github.com/mcaceresb +[bostko]: https://github.com/bostko +[Deniz Bahadir]: https://github.com/Bagira80 +[bcleland]: https://github.com/bcleland +[JohnC32]: https://github.com/JohnC32 +[Lutz Büch]: https://github.com/lutz-100worte +[Piotr Kaminski]: https://github.com/pkaminski +[Léo Lam]: https://github.com/leoetlino +[Jan T. Sott]: https://github.com/idleberg +[Jimmy Wärting]: https://github.com/jimmywarting +[Marcos Cáceres]: https://github.com/marcoscaceres + +## Version 9.12.0 + +New language: + +- *MikroTik* RouterOS Scripting language by [Ivan Dementev][]. + +New style: + +- *VisualStudio 2015 Dark* by [Nicolas LLOBERA][] + +Improvements: + +- *Crystal* updated with new keywords and syntaxes by [Tsuyusato Kitsune][]. +- *Julia* updated to the modern definitions by [Alex Arslan][]. +- *julia-repl* added by [Morten Piibeleht][]. +- [Stanislav Belov][] wrote a new definition for *1C*, replacing the one that + has not been updated for more than 8 years. The new version supports syntax + for versions 7.7 and 8. +- [Nicolas LLOBERA][] improved C# definition fixing edge cases with function + titles detection and added highlighting of `[Attributes]`. +- [nnnik][] provided a few correctness fixes for *Autohotkey*. +- [Martin Clausen][] made annotation collections in *Clojure* to look + consistently with other kinds. +- [Alejandro Alonso][] updated *Swift* keywords. + +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Alex Arslan]: https://github.com/ararslan +[Morten Piibeleht]: https://github.com/mortenpi +[Stanislav Belov]: https://github.com/4ppl +[Ivan Dementev]: https://github.com/DiVAN1x +[Nicolas LLOBERA]: https://github.com/Nicolas01 +[nnnik]: https://github.com/nnnik +[Martin Clausen]: https://github.com/maacl +[Alejandro Alonso]: https://github.com/Azoy + +## Version 9.11.0 + +New languages: + +- *Shell* by [Tsuyusato Kitsune][] +- *jboss-cli* by [Raphaël Parrëe][] + +Improvements: + +- [Joël Porquet] has [greatly improved the definition of *makefile*][5b3e0e6]. +- *C++* class titles are now highlighted as in other languages with classes. +- [Jordi Petit][] added rarely used `or`, `and` and `not` keywords to *C++*. +- [Pieter Vantorre][] fixed highlighting of negative floating point values. + + +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Jordi Petit]: https://github.com/jordi-petit +[Raphaël Parrëe]: https://github.com/rparree +[Pieter Vantorre]: https://github.com/NuclearCookie +[5b3e0e6]: https://github.com/isagalaev/highlight.js/commit/5b3e0e68bfaae282faff6697d6a490567fa9d44b + + +## Version 9.10.0 + +Apologies for missing the previous release cycle. Some thing just can't be +automated… Anyway, we're back! + +New languages: + +- *Hy* by [Sergey Sobko][] +- *Leaf* by [Hale Chan][] +- *N1QL* by [Andres Täht][] and [Rene Saarsoo][] + +Improvements: + +- *Rust* got updated with new keywords by [Kasper Andersen][] and then + significantly modernized even more by [Eduard-Mihai Burtescu][] (yes, @eddyb, + Rust core team member!) +- *Python* updated with f-literals by [Philipp A][]. +- *YAML* updated with unquoted strings support. +- *Gauss* updated with new keywords by [Matt Evans][]. +- *Lua* updated with new keywords by [Joe Blow][]. +- *Kotlin* updated with new keywords by [Philipp Hauer][]. +- *TypeScript* got highlighting of function params and updated keywords by + [Ike Ku][]. +- *Scheme* now correctly handles \`-quoted lists thanks to [Guannan Wei]. +- [Sam Wu][] fixed handling of `<<` in *C++* defines. + +[Philipp A]: https://github.com/flying-sheep +[Philipp Hauer]: https://github.com/phauer +[Sergey Sobko]: https://github.com/profitware +[Hale Chan]: https://github.com/halechan +[Matt Evans]: https://github.com/matthewevans +[Joe Blow]: https://github.com/mossarelli +[Kasper Andersen]: https://github.com/kasma1990 +[Eduard-Mihai Burtescu]: https://github.com/eddyb +[Andres Täht]: https://github.com/andrestaht +[Rene Saarsoo]: https://github.com/nene +[Philipp Hauer]: https://github.com/phauer +[Ike Ku]: https://github.com/dempfi +[Guannan Wei]: https://github.com/Kraks +[Sam Wu]: https://github.com/samsam2310 + + +## Version 9.9.0 + +New languages + +- *LLVM* by [Michael Rodler][] + +Improvements: + +- *TypeScript* updated with annotations and param lists inside constructors, by + [Raphael Parree][]. +- *CoffeeScript* updated with new keywords and fixed to recognize JavaScript + in \`\`\`, thanks to thanks to [Geoffrey Booth][]. +- Compiler directives in *Delphi* are now correctly highlighted as "meta". + +[Raphael Parree]: https://github.com/rparree +[Michael Rodler]: https://github.com/f0rki +[Geoffrey Booth]: https://github.com/GeoffreyBooth + + +## Version 9.8.0 "New York" + +This version is the second one that deserved a name. Because I'm in New York, +and the release isn't missing the deadline only because it's still Tuesday on +West Coast. + +New languages: + +- *Clean* by [Camil Staps][] +- *Flix* by [Magnus Madsen][] + +Improvements: + +- [Kenton Hamaluik][] did a comprehensive update for *Haxe*. +- New commands for *PowerShell* from [Nicolas Le Gall][]. +- [Jan T. Sott][] updated *NSIS*. +- *Java* and *Swift* support unicode characters in identifiers thanks to + [Alexander Lichter][]. + +[Camil Staps]: https://github.com/camilstaps +[Magnus Madsen]: https://github.com/magnus-madsen +[Kenton Hamaluik]: https://github.com/FuzzyWuzzie +[Nicolas Le Gall]: https://github.com/darkitty +[Jan T. Sott]: https://github.com/idleberg +[Alexander Lichter]: https://github.com/manniL + + +## Version 9.7.0 + +A comprehensive bugfix release. This is one of the best things about +highlight.js: even boring things keep getting better (even if slow). + +- VHDL updated with PSL keywords and uses more consistent styling. +- Nested C-style comments no longer break highlighting in many languages. +- JavaScript updated with `=>` functions, highlighted object attributes and + parsing within template string substitution blocks (`${...}`). +- Fixed another corner case with self-closing `` in JSX. +- Added `HEALTHCHECK` directive in Docker. +- Delphi updated with new Free Pascal keywords. +- Fixed digit separator parsing in C++. +- C# updated with new keywords and fixed to allow multiple identifiers within + generics `<...>`. +- Fixed another slow regex in Less. + + +## Version 9.6.0 + +New languages: + +- *ABNF* and *EBNF* by [Alex McKibben][] +- *Awk* by [Matthew Daly][] +- *SubUnit* by [Sergey Bronnikov][] + +New styles: + +- *Atom One* in both Dark and Light variants by [Daniel Gamage][] + +Plus, a few smaller updates for *Lasso*, *Elixir*, *C++* and *SQL*. + +[Alex McKibben]: https://github.com/mckibbenta +[Daniel Gamage]: https://github.com/danielgamage +[Matthew Daly]: https://github.com/matthewbdaly +[Sergey Bronnikov]: https://github.com/ligurio + + +## Version 9.5.0 + +New languages: + +- *Excel* by [Victor Zhou][] +- *Linden Scripting Language* by [Builder's Brewery][] +- *TAP* (Test Anything Protocol) by [Sergey Bronnikov][] +- *Pony* by [Joe Eli McIlvain][] +- *Coq* by [Stephan Boyer][] +- *dsconfig* and *LDIF* by [Jacob Childress][] + +New styles: + +- *Ocean Dark* by [Gavin Siu][] + +Notable changes: + +- [Minh Nguyễn][] added more built-ins to Objective C. +- [Jeremy Hull][] fixed corner cases in C++ preprocessor directives and Diff + comments. +- [Victor Zhou][] added support for digit separators in C++ numbers. + +[Gavin Siu]: https://github.com/gavsiu +[Builder's Brewery]: https://github.com/buildersbrewery +[Victor Zhou]: https://github.com/OiCMudkips +[Sergey Bronnikov]: https://github.com/ligurio +[Joe Eli McIlvain]: https://github.com/jemc +[Stephan Boyer]: https://github.com/boyers +[Jacob Childress]: https://github.com/braveulysses +[Minh Nguyễn]: https://github.com/1ec5 +[Jeremy Hull]: https://github.com/sourrust + + +## Version 9.4.0 + +New languages: + +- *PureBASIC* by [Tristano Ajmone][] +- *BNF* by [Oleg Efimov][] +- *Ada* by [Lars Schulna][] + +New styles: + +- *PureBASIC* by [Tristano Ajmone][] + +Improvements to existing languages and styles: + +- We now highlight function declarations in Go. +- [Taisuke Fujimoto][] contributed very convoluted rules for raw and + interpolated strings in C#. +- [Boone Severson][] updated Verilog to comply with IEEE 1800-2012 + SystemVerilog. +- [Victor Zhou][] improved rules for comments and strings in PowerShell files. +- [Janis Voigtländer][] updated the definition of Elm to version 0.17 of the + languages. Elm is now featured on the front page of . +- Special variable `$this` is highlighted as a keyword in PHP. +- `usize` and `isize` are now highlighted in Rust. +- Fixed labels and directives in x86 assembler. + +[Tristano Ajmone]: https://github.com/tajmone +[Taisuke Fujimoto]: https://github.com/temp-impl +[Oleg Efimov]: https://github.com/Sannis +[Boone Severson]: https://github.com/BooneJS +[Victor Zhou]: https://github.com/OiCMudkips +[Lars Schulna]: https://github.com/captain-hanuta +[Janis Voigtländer]: https://github.com/jvoigtlaender + + +## Version 9.3.0 + +New languages: + +- *Tagger Script* by [Philipp Wolfer][] +- *MoonScript* by [Billy Quith][] + +New styles: + +- *xt256* by [Herbert Shin][] + +Improvements to existing languages and styles: + +- More robust handling of unquoted HTML tag attributes +- Relevance tuning for QML which was unnecessary eager at seizing other + languages' code +- Improve GAMS language parsing +- Fixed a bunch of bugs around selectors in Less +- Kotlin's got a new definition for annotations, updated keywords and other + minor improvements +- Added `move` to Rust keywords +- Markdown now recognizes \`\`\`-fenced code blocks +- Improved detection of function declarations in C++ and C# + +[Philipp Wolfer]: https://github.com/phw +[Billy Quith]: https://github.com/billyquith +[Herbert Shin]: https://github.com/initbar + + +## Version 9.2.0 + +New languages: + +- *QML* by [John Foster][] +- *HTMLBars* by [Michael Johnston][] +- *CSP* by [Taras][] +- *Maxima* by [Robert Dodier][] + +New styles: + +- *Gruvbox* by [Qeole][] +- *Dracula* by [Denis Ciccale][] + +Improvements to existing languages and styles: + +- We now correctly handle JSX with arbitrary node tree depth. +- Argument list for `(lambda)` in Scheme is no longer highlighted as a function + call. +- Stylus syntax doesn't break on valid CSS. +- More correct handling of comments and strings and other improvements for + VimScript. +- More subtle work on the default style. +- We now use anonymous modules for AMD. +- `macro_rules!` is now recognized as a built-in in Rust. + +[John Foster]: https://github.com/jf990 +[Qeole]: https://github.com/Qeole +[Denis Ciccale]: https://github.com/dciccale +[Michael Johnston]: https://github.com/lastobelus +[Taras]: https://github.com/oxdef +[Robert Dodier]: https://github.com/robert-dodier + + +## Version 9.1.0 + +New languages: + +- *Stan* by [Brendan Rocks][] +- *BASIC* by [Raphaël Assénat][] +- *GAUSS* by [Matt Evans][] +- *DTS* by [Martin Braun][] +- *Arduino* by [Stefania Mellai][] + +New Styles: + +- *Arduino Light* by [Stefania Mellai][] + +Improvements to existing languages and styles: + +- Handle return type annotations in Python +- Allow shebang headers in Javascript +- Support strings in Rust meta +- Recognize `struct` as a class-level definition in Rust +- Recognize b-prefixed chars and strings in Rust +- Better numbers handling in Verilog + +[Brendan Rocks]: http://brendanrocks.com +[Raphaël Assénat]: https://github.com/raphnet +[Matt Evans]: https://github.com/matthewevans +[Martin Braun]: https://github.com/mbr0wn +[Stefania Mellai]: https://github.com/smellai + + +## Version 9.0.0 + +The new major version brings a reworked styling system. Highlight.js now defines +a limited set of highlightable classes giving a consistent result across all the +styles and languages. You can read a more detailed explanation and background in +the [tracking issue][#348] that started this long process back in May. + +This change is backwards incompatible for those who uses highlight.js with a +custom stylesheet. The [new style guide][sg] explains how to write styles +in this new world. + +Bundled themes have also suffered a significant amount of improvements and may +look different in places, but all the things now consistent and make more sense. +Among others, the Default style has got a refresh and will probably be tweaked +some more in next releases. Please do give your feedback in our +[issue tracker][issues]. + +New languages in this release: + +- *Caché Object Script* by [Nikita Savchenko][] +- *YAML* by [Stefan Wienert][] +- *MIPS Assembler* by [Nebuleon Fumika][] +- *HSP* by [prince][] + +Improvements to existing languages and styles: + +- ECMAScript 6 modules import now do not require closing semicolon. +- ECMAScript 6 classes constructors now highlighted. +- Template string support for Typescript, as for ECMAScript 6. +- Scala case classes params highlight fixed. +- Built-in names introduced in Julia v0.4 added by [Kenta Sato][]. +- Refreshed Default style. + +Other notable changes: + +- [Web workers support][webworkers] added bu [Jan Kühle][]. +- We now have tests for compressed browser builds as well. +- The building tool chain has been switched to node.js 4.x. and is now + shamelessly uses ES6 features all over the place, courtesy of [Jeremy Hull][]. +- License added to non-compressed browser build. + +[Jan Kühle]: https://github.com/frigus02 +[Stefan Wienert]: https://github.com/zealot128 +[Kenta Sato]: https://github.com/bicycle1885 +[Nikita Savchenko]: https://github.com/ZitRos +[webworkers]: https://github.com/isagalaev/highlight.js#web-workers +[Jeremy Hull]: https://github.com/sourrust +[#348]: https://github.com/isagalaev/highlight.js/issues/348 +[sg]: http://highlightjs.readthedocs.org/en/latest/style-guide.html +[issues]: https://github.com/isagalaev/highlight.js/issues +[Nebuleon Fumika]: https://github.com/Nebuleon +[prince]: https://github.com/prince-0203 + + +## Version 8.9.1 + +Some last-minute changes reverted due to strange bug with minified browser build: + +- Scala case classes params highlight fixed +- ECMAScript 6 modules import now do not require closing semicolon +- ECMAScript 6 classes constructors now highlighted +- Template string support for Typescript, as for ECMAScript 6 +- License added to not minified browser build + + +## Version 8.9.0 + +New languages: + +- *crmsh* by [Kristoffer Gronlund][] +- *SQF* by [Soren Enevoldsen][] + +[Kristoffer Gronlund]: https://github.com/krig +[Soren Enevoldsen]: https://github.com/senevoldsen90 + +Notable fixes and improvements to existing languages: + +- Added `abstract` and `namespace` keywords to TypeScript by [Daniel Rosenwasser][] +- Added `label` support to Dockerfile by [Ladislav Prskavec][] +- Crystal highlighting improved by [Tsuyusato Kitsune][] +- Missing Swift keywords added by [Nate Cook][] +- Improve detection of C block comments +- ~~Scala case classes params highlight fixed~~ +- ~~ECMAScript 6 modules import now do not require closing semicolon~~ +- ~~ECMAScript 6 classes constructors now highlighted~~ +- ~~Template string support for Typescript, as for ECMAScript 6~~ + +Other notable changes: + +- ~~License added to not minified browser build~~ + +[Kristoffer Gronlund]: https://github.com/krig +[Søren Enevoldsen]: https://github.com/senevoldsen90 +[Daniel Rosenwasser]: https://github.com/DanielRosenwasser +[Ladislav Prskavec]: https://github.com/abtris +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Nate Cook]: https://github.com/natecook1000 + + +## Version 8.8.0 + +New languages: + +- *Golo* by [Philippe Charrière][] +- *GAMS* by [Stefan Bechert][] +- *IRPF90* by [Anthony Scemama][] +- *Access logs* by [Oleg Efimov][] +- *Crystal* by [Tsuyusato Kitsune][] + +Notable fixes and improvements to existing languages: + +- JavaScript highlighting no longer fails with ES6 default parameters +- Added keywords `async` and `await` to Python +- PHP heredoc support improved +- Allow preprocessor directives within C++ functions + +Other notable changes: + +- Change versions to X.Y.Z SemVer-compatible format +- Added ability to build all targets at once + +[Philippe Charrière]: https://github.com/k33g +[Stefan Bechert]: https://github.com/b-pos465 +[Anthony Scemama]: https://github.com/scemama +[Oleg Efimov]: https://github.com/Sannis +[Tsuyusato Kitsune]: https://github.com/MakeNowJust + + +## Version 8.7 + +New languages: + +- *Zephir* by [Oleg Efimov][] +- *Elm* by [Janis Voigtländer][] +- *XQuery* by [Dirk Kirsten][] +- *Mojolicious* by [Dotan Dimet][] +- *AutoIt* by Manh Tuan from [J2TeaM][] +- *Toml* (ini extension) by [Guillaume Gomez][] + +New styles: + +- *Hopscotch* by [Jan T. Sott][] +- *Grayscale* by [MY Sun][] + +Notable fixes and improvements to existing languages: + +- Fix encoding of images when copied over in certain builds +- Fix incorrect highlighting of the word "bug" in comments +- Treat decorators different from matrix multiplication in Python +- Fix traits inheritance highlighting in Rust +- Fix incorrect document +- Oracle keywords added to SQL language definition by [Vadimtro][] +- Postgres keywords added to SQL language definition by [Benjamin Auder][] +- Fix registers in x86asm being highlighted as a hex number +- Fix highlighting for numbers with a leading decimal point +- Correctly highlight numbers and strings inside of C/C++ macros +- C/C++ functions now support pointer, reference, and move returns + +[Oleg Efimov]: https://github.com/Sannis +[Guillaume Gomez]: https://github.com/GuillaumeGomez +[Janis Voigtländer]: https://github.com/jvoigtlaender +[Jan T. Sott]: https://github.com/idleberg +[Dirk Kirsten]: https://github.com/dirkk +[MY Sun]: https://github.com/simonmysun +[Vadimtro]: https://github.com/Vadimtro +[Benjamin Auder]: https://github.com/ghost +[Dotan Dimet]: https://github.com/dotandimet +[J2TeaM]: https://github.com/J2TeaM + + +## Version 8.6 + +New languages: + +- *C/AL* by [Kenneth Fuglsang][] +- *DNS zone file* by [Tim Schumacher][] +- *Ceylon* by [Lucas Werkmeister][] +- *OpenSCAD* by [Dan Panzarella][] +- *Inform7* by [Bruno Dias][] +- *armasm* by [Dan Panzarella][] +- *TP* by [Jay Strybis][] + +New styles: + +- *Atelier Cave*, *Atelier Estuary*, + *Atelier Plateau* and *Atelier Savanna* by [Bram de Haan][] +- *Github Gist* by [Louis Barranqueiro][] + +Notable fixes and improvements to existing languages: + +- Multi-line raw strings from C++11 are now supported +- Fix class names with dashes in HAML +- The `async` keyword from ES6/7 is now supported +- TypeScript functions handle type and parameter complexity better +- We unified phpdoc/javadoc/yardoc etc modes across all languages +- CSS .class selectors relevance was dropped to prevent wrong language detection +- Images is now included to CDN build +- Release process is now automated + +[Bram de Haan]: https://github.com/atelierbram +[Kenneth Fuglsang]: https://github.com/kfuglsang +[Louis Barranqueiro]: https://github.com/LouisBarranqueiro +[Tim Schumacher]: https://github.com/enko +[Lucas Werkmeister]: https://github.com/lucaswerkmeister +[Dan Panzarella]: https://github.com/pzl +[Bruno Dias]: https://github.com/sequitur +[Jay Strybis]: https://github.com/unreal + + +## Version 8.5 + +New languages: + +- *pf.conf* by [Peter Piwowarski][] +- *Julia* by [Kenta Sato][] +- *Prolog* by [Raivo Laanemets][] +- *Docker* by [Alexis Hénaut][] +- *Fortran* by [Anthony Scemama][] and [Thomas Applencourt][] +- *Kotlin* by [Sergey Mashkov][] + +New styles: + +- *Agate* by [Taufik Nurrohman][] +- *Darcula* by [JetBrains][] +- *Atelier Sulphurpool* by [Bram de Haan][] +- *Android Studio* by [Pedro Oliveira][] + +Notable fixes and improvements to existing languages: + +- ES6 features in JavaScript are better supported now by [Gu Yiling][]. +- Swift now recognizes body-less method definitions. +- Single expression functions `def foo, do: ... ` now work in Elixir. +- More uniform detection of built-in classes in Objective C. +- Fixes for number literals and processor directives in Rust. +- HTML ` + ``` + +- `tabReplace` and `useBR` that were used in different places are also unified + into the global options object and are to be set using `configure(options)`. + This function is documented in our [API docs][]. Also note that these + parameters are gone from `highlightBlock` and `fixMarkup` which are now also + rely on `configure`. + +- We removed public-facing (though undocumented) object `hljs.LANGUAGES` which + was used to register languages with the library in favor of two new methods: + `registerLanguage` and `getLanguage`. Both are documented in our [API docs][]. + +- Result returned from `highlight` and `highlightAuto` no longer contains two + separate attributes contributing to relevance score, `relevance` and + `keyword_count`. They are now unified in `relevance`. + +Another technically compatible change that nonetheless might need attention: + +- The structure of the NPM package was refactored, so if you had installed it + locally, you'll have to update your paths. The usual `require('highlight.js')` + works as before. This is contributed by [Dmitry Smolin][]. + +New features: + +- Languages now can be recognized by multiple names like "js" for JavaScript or + "html" for, well, HTML (which earlier insisted on calling it "xml"). These + aliases can be specified in the class attribute of the code container in your + HTML as well as in various API calls. For now there are only a few very common + aliases but we'll expand it in the future. All of them are listed in the + [class reference][cr]. + +- Language detection can now be restricted to a subset of languages relevant in + a given context — a web page or even a single highlighting call. This is + especially useful for node.js build that includes all the known languages. + Another example is a StackOverflow-style site where users specify languages + as tags rather than in the markdown-formatted code snippets. This is + documented in the [API reference][] (see methods `highlightAuto` and + `configure`). + +- Language definition syntax streamlined with [variants][] and + [beginKeywords][]. + +New languages and styles: + +- *Oxygene* by [Carlo Kok][] +- *Mathematica* by [Daniel Kvasnička][] +- *Autohotkey* by [Seongwon Lee][] +- *Atelier* family of styles in 10 variants by [Bram de Haan][] +- *Paraíso* styles by [Jan T. Sott][] + +Miscellaneous improvements: + +- Highlighting `=>` prompts in Clojure. +- [Jeremy Hull][] fixed a lot of styles for consistency. +- Finally, highlighting PHP and HTML [mixed in peculiar ways][php-html]. +- Objective C and C# now properly highlight titles in method definition. +- Big overhaul of relevance counting for a number of languages. Please do report + bugs about mis-detection of non-trivial code snippets! + +[API reference]: http://highlightjs.readthedocs.org/en/latest/api.html + +[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html +[api docs]: http://highlightjs.readthedocs.org/en/latest/api.html +[variants]: https://groups.google.com/d/topic/highlightjs/VoGC9-1p5vk/discussion +[beginKeywords]: https://github.com/isagalaev/highlight.js/commit/6c7fdea002eb3949577a85b3f7930137c7c3038d +[php-html]: https://twitter.com/highlightjs/status/408890903017689088 + +[Carlo Kok]: https://github.com/carlokok +[Bram de Haan]: https://github.com/atelierbram +[Daniel Kvasnička]: https://github.com/dkvasnicka +[Dmitry Smolin]: https://github.com/dimsmol +[Jeremy Hull]: https://github.com/sourrust +[Seongwon Lee]: https://github.com/dlimpid +[Jan T. Sott]: https://github.com/idleberg + + +## Version 7.5 + +A catch-up release dealing with some of the accumulated contributions. This one +is probably will be the last before the 8.0 which will be slightly backwards +incompatible regarding some advanced use-cases. + +One outstanding change in this version is the addition of 6 languages to the +[hosted script][d]: Markdown, ObjectiveC, CoffeeScript, Apache, Nginx and +Makefile. It now weighs about 6K more but we're going to keep it under 30K. + +New languages: + +- OCaml by [Mehdi Dogguy][mehdid] and [Nicolas Braud-Santoni][nbraud] +- [LiveCode Server][lcs] by [Ralf Bitter][revig] +- Scilab by [Sylvestre Ledru][sylvestre] +- basic support for Makefile by [Ivan Sagalaev][isagalaev] + +Improvements: + +- Ruby's got support for characters like `?A`, `?1`, `?\012` etc. and `%r{..}` + regexps. +- Clojure now allows a function call in the beginning of s-expressions + `(($filter "myCount") (arr 1 2 3 4 5))`. +- Haskell's got new keywords and now recognizes more things like pragmas, + preprocessors, modules, containers, FFIs etc. Thanks to [Zena Treep][treep] + for the implementation and to [Jeremy Hull][sourrust] for guiding it. +- Miscellaneous fixes in PHP, Brainfuck, SCSS, Asciidoc, CMake, Python and F#. + +[mehdid]: https://github.com/mehdid +[nbraud]: https://github.com/nbraud +[revig]: https://github.com/revig +[lcs]: http://livecode.com/developers/guides/server/ +[sylvestre]: https://github.com/sylvestre +[isagalaev]: https://github.com/isagalaev +[treep]: https://github.com/treep +[sourrust]: https://github.com/sourrust +[d]: http://highlightjs.org/download/ + + +## New core developers + +The latest long period of almost complete inactivity in the project coincided +with growing interest to it led to a decision that now seems completely obvious: +we need more core developers. + +So without further ado let me welcome to the core team two long-time +contributors: [Jeremy Hull][] and [Oleg +Efimov][]. + +Hope now we'll be able to work through stuff faster! + +P.S. The historical commit is [here][1] for the record. + +[Jeremy Hull]: https://github.com/sourrust +[Oleg Efimov]: https://github.com/sannis +[1]: https://github.com/isagalaev/highlight.js/commit/f3056941bda56d2b72276b97bc0dd5f230f2473f + + +## Version 7.4 + +This long overdue version is a snapshot of the current source tree with all the +changes that happened during the past year. Sorry for taking so long! + +Along with the changes in code highlight.js has finally got its new home at +, moving from its cradle on Software Maniacs which it +outgrew a long time ago. Be sure to report any bugs about the site to +. + +On to what's new… + +New languages: + +- Handlebars templates by [Robin Ward][] +- Oracle Rules Language by [Jason Jacobson][] +- F# by [Joans Follesø][] +- AsciiDoc and Haml by [Dan Allen][] +- Lasso by [Eric Knibbe][] +- SCSS by [Kurt Emch][] +- VB.NET by [Poren Chiang][] +- Mizar by [Kelley van Evert][] + +[Robin Ward]: https://github.com/eviltrout +[Jason Jacobson]: https://github.com/jayce7 +[Joans Follesø]: https://github.com/follesoe +[Dan Allen]: https://github.com/mojavelinux +[Eric Knibbe]: https://github.com/EricFromCanada +[Kurt Emch]: https://github.com/kemch +[Poren Chiang]: https://github.com/rschiang +[Kelley van Evert]: https://github.com/kelleyvanevert + +New style themes: + +- Monokai Sublime by [noformnocontent][] +- Railscasts by [Damien White][] +- Obsidian by [Alexander Marenin][] +- Docco by [Simon Madine][] +- Mono Blue by [Ivan Sagalaev][] (uses a single color hue for everything) +- Foundation by [Dan Allen][] + +[noformnocontent]: http://nn.mit-license.org/ +[Damien White]: https://github.com/visoft +[Alexander Marenin]: https://github.com/ioncreature +[Simon Madine]: https://github.com/thingsinjars +[Ivan Sagalaev]: https://github.com/isagalaev + +Other notable changes: + +- Corrected many corner cases in CSS. +- Dropped Python 2 version of the build tool. +- Implemented building for the AMD format. +- Updated Rust keywords (thanks to [Dmitry Medvinsky][]). +- Literal regexes can now be used in language definitions. +- CoffeeScript highlighting is now significantly more robust and rich due to + input from [Cédric Néhémie][]. + +[Dmitry Medvinsky]: https://github.com/dmedvinsky +[Cédric Néhémie]: https://github.com/abe33 + + +## Version 7.3 + +- Since this version highlight.js no longer works in IE version 8 and older. + It's made it possible to reduce the library size and dramatically improve code + readability and made it easier to maintain. Time to go forward! + +- New languages: AppleScript (by [Nathan Grigg][ng] and [Dr. Drang][dd]) and + Brainfuck (by [Evgeny Stepanischev][bolk]). + +- Improvements to existing languages: + + - interpreter prompt in Python (`>>>` and `...`) + - @-properties and classes in CoffeeScript + - E4X in JavaScript (by [Oleg Efimov][oe]) + - new keywords in Perl (by [Kirk Kimmel][kk]) + - big Ruby syntax update (by [Vasily Polovnyov][vast]) + - small fixes in Bash + +- Also Oleg Efimov did a great job of moving all the docs for language and style + developers and contributors from the old wiki under the source code in the + "docs" directory. Now these docs are nicely presented at + . + +[ng]: https://github.com/nathan11g +[dd]: https://github.com/drdrang +[bolk]: https://github.com/bolknote +[oe]: https://github.com/Sannis +[kk]: https://github.com/kimmel +[vast]: https://github.com/vast + + +## Version 7.2 + +A regular bug-fix release without any significant new features. Enjoy! + + +## Version 7.1 + +A Summer crop: + +- [Marc Fornos][mf] made the definition for Clojure along with the matching + style Rainbow (which, of course, works for other languages too). +- CoffeeScript support continues to improve getting support for regular + expressions. +- Yoshihide Jimbo ported to highlight.js [five Tomorrow styles][tm] from the + [project by Chris Kempson][tm0]. +- Thanks to [Casey Duncun][cd] the library can now be built in the popular + [AMD format][amd]. +- And last but not least, we've got a fair number of correctness and consistency + fixes, including a pretty significant refactoring of Ruby. + +[mf]: https://github.com/mfornos +[tm]: http://jmblog.github.com/color-themes-for-highlightjs/ +[tm0]: https://github.com/ChrisKempson/Tomorrow-Theme +[cd]: https://github.com/caseman +[amd]: http://requirejs.org/docs/whyamd.html + + +## Version 7.0 + +The reason for the new major version update is a global change of keyword syntax +which resulted in the library getting smaller once again. For example, the +hosted build is 2K less than at the previous version while supporting two new +languages. + +Notable changes: + +- The library now works not only in a browser but also with [node.js][]. It is + installable with `npm install highlight.js`. [API][] docs are available on our + wiki. + +- The new unique feature (apparently) among syntax highlighters is highlighting + *HTTP* headers and an arbitrary language in the request body. The most useful + languages here are *XML* and *JSON* both of which highlight.js does support. + Here's [the detailed post][p] about the feature. + +- Two new style themes: a dark "south" *[Pojoaque][]* by Jason Tate and an + emulation of*XCode* IDE by [Angel Olloqui][ao]. + +- Three new languages: *D* by [Aleksandar Ružičić][ar], *R* by [Joe Cheng][jc] + and *GLSL* by [Sergey Tikhomirov][st]. + +- *Nginx* syntax has become a million times smaller and more universal thanks to + remaking it in a more generic manner that doesn't require listing all the + directives in the known universe. + +- Function titles are now highlighted in *PHP*. + +- *Haskell* and *VHDL* were significantly reworked to be more rich and correct + by their respective maintainers [Jeremy Hull][sr] and [Igor Kalnitsky][ik]. + +And last but not least, many bugs have been fixed around correctness and +language detection. + +Overall highlight.js currently supports 51 languages and 20 style themes. + +[node.js]: http://nodejs.org/ +[api]: http://softwaremaniacs.org/wiki/doku.php/highlight.js:api +[p]: http://softwaremaniacs.org/blog/2012/05/10/http-and-json-in-highlight-js/en/ +[pojoaque]: http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html +[ao]: https://github.com/angelolloqui +[ar]: https://github.com/raleksandar +[jc]: https://github.com/jcheng5 +[st]: https://github.com/tikhomirov +[sr]: https://github.com/sourrust +[ik]: https://github.com/ikalnitsky + + +## Version 6.2 + +A lot of things happened in highlight.js since the last version! We've got nine +new contributors, the discussion group came alive, and the main branch on GitHub +now counts more than 350 followers. Here are most significant results coming +from all this activity: + +- 5 (five!) new languages: Rust, ActionScript, CoffeeScript, MatLab and + experimental support for markdown. Thanks go to [Andrey Vlasovskikh][av], + [Alexander Myadzel][am], [Dmytrii Nagirniak][dn], [Oleg Efimov][oe], [Denis + Bardadym][db] and [John Crepezzi][jc]. + +- 2 new style themes: Monokai by [Luigi Maselli][lm] and stylistic imitation of + another well-known highlighter Google Code Prettify by [Aahan Krish][ak]. + +- A vast number of [correctness fixes and code refactorings][log], mostly made + by [Oleg Efimov][oe] and [Evgeny Stepanischev][es]. + +[av]: https://github.com/vlasovskikh +[am]: https://github.com/myadzel +[dn]: https://github.com/dnagir +[oe]: https://github.com/Sannis +[db]: https://github.com/btd +[jc]: https://github.com/seejohnrun +[lm]: http://grigio.org/ +[ak]: https://github.com/geekpanth3r +[es]: https://github.com/bolknote +[log]: https://github.com/isagalaev/highlight.js/commits/ + + +## Version 6.1 — Solarized + +[Jeremy Hull][jh] has implemented my dream feature — a port of [Solarized][] +style theme famous for being based on the intricate color theory to achieve +correct contrast and color perception. It is now available for highlight.js in +both variants — light and dark. + +This version also adds a new original style Arta. Its author pumbur maintains a +[heavily modified fork of highlight.js][pb] on GitHub. + +[jh]: https://github.com/sourrust +[solarized]: http://ethanschoonover.com/solarized +[pb]: https://github.com/pumbur/highlight.js + + +## Version 6.0 + +New major version of the highlighter has been built on a significantly +refactored syntax. Due to this it's even smaller than the previous one while +supporting more languages! + +New languages are: + +- Haskell by [Jeremy Hull][sourrust] +- Erlang in two varieties — module and REPL — made collectively by [Nikolay + Zakharov][desh], [Dmitry Kovega][arhibot] and [Sergey Ignatov][ignatov] +- Objective C by [Valerii Hiora][vhbit] +- Vala by [Antono Vasiljev][antono] +- Go by [Stephan Kountso][steplg] + +[sourrust]: https://github.com/sourrust +[desh]: http://desh.su/ +[arhibot]: https://github.com/arhibot +[ignatov]: https://github.com/ignatov +[vhbit]: https://github.com/vhbit +[antono]: https://github.com/antono +[steplg]: https://github.com/steplg + +Also this version is marginally faster and fixes a number of small long-standing +bugs. + +Developer overview of the new language syntax is available in a [blog post about +recent beta release][beta]. + +[beta]: http://softwaremaniacs.org/blog/2011/04/25/highlight-js-60-beta/en/ + +P.S. New version is not yet available on a Yandex CDN, so for now you have to +download [your own copy][d]. + +[d]: /soft/highlight/en/download/ + + +## Version 5.14 + +Fixed bugs in HTML/XML detection and relevance introduced in previous +refactoring. + +Also test.html now shows the second best result of language detection by +relevance. + + +## Version 5.13 + +Past weekend began with a couple of simple additions for existing languages but +ended up in a big code refactoring bringing along nice improvements for language +developers. + +### For users + +- Description of C++ has got new keywords from the upcoming [C++ 0x][] standard. +- Description of HTML has got new tags from [HTML 5][]. +- CSS-styles have been unified to use consistent padding and also have lost + pop-outs with names of detected languages. +- [Igor Kalnitsky][ik] has sent two new language descriptions: CMake & VHDL. + +This makes total number of languages supported by highlight.js to reach 35. + +Bug fixes: + +- Custom classes on `
` tags are not being overridden anymore
+- More correct highlighting of code blocks inside non-`
` containers:
+  highlighter now doesn't insist on replacing them with its own container and
+  just replaces the contents.
+- Small fixes in browser compatibility and heuristics.
+
+[c++ 0x]: http://ru.wikipedia.org/wiki/C%2B%2B0x
+[html 5]: http://en.wikipedia.org/wiki/HTML5
+[ik]: http://kalnitsky.org.ua/
+
+### For developers
+
+The most significant change is the ability to include language submodes right
+under `contains` instead of defining explicit named submodes in the main array:
+
+    contains: [
+      'string',
+      'number',
+      {begin: '\\n', end: hljs.IMMEDIATE_RE}
+    ]
+
+This is useful for auxiliary modes needed only in one place to define parsing.
+Note that such modes often don't have `className` and hence won't generate a
+separate `` in the resulting markup. This is similar in effect to
+`noMarkup: true`. All existing languages have been refactored accordingly.
+
+Test file test.html has at last become a real test. Now it not only puts the
+detected language name under the code snippet but also tests if it matches the
+expected one. Test summary is displayed right above all language snippets.
+
+
+## CDN
+
+Fine people at [Yandex][] agreed to host highlight.js on their big fast servers.
+[Link up][l]!
+
+[yandex]: http://yandex.com/
+[l]: http://softwaremaniacs.org/soft/highlight/en/download/
+
+
+## Version 5.10 — "Paris".
+
+Though I'm on a vacation in Paris, I decided to release a new version with a
+couple of small fixes:
+
+- Tomas Vitvar discovered that TAB replacement doesn't always work when used
+  with custom markup in code
+- SQL parsing is even more rigid now and doesn't step over SmallTalk in tests
+
+
+## Version 5.9
+
+A long-awaited version is finally released.
+
+New languages:
+
+- Andrew Fedorov made a definition for Lua
+- a long-time highlight.js contributor [Peter Leonov][pl] made a definition for
+  Nginx config
+- [Vladimir Moskva][vm] made a definition for TeX
+
+[pl]: http://kung-fu-tzu.ru/
+[vm]: http://fulc.ru/
+
+Fixes for existing languages:
+
+- [Loren Segal][ls] reworked the Ruby definition and added highlighting for
+  [YARD][] inline documentation
+- the definition of SQL has become more solid and now it shouldn't be overly
+  greedy when it comes to language detection
+
+[ls]: http://gnuu.org/
+[yard]: http://yardoc.org/
+
+The highlighter has become more usable as a library allowing to do highlighting
+from initialization code of JS frameworks and in ajax methods (see.
+readme.eng.txt).
+
+Also this version drops support for the [WordPress][wp] plugin. Everyone is
+welcome to [pick up its maintenance][p] if needed.
+
+[wp]: http://wordpress.org/
+[p]: http://bazaar.launchpad.net/~isagalaev/+junk/highlight/annotate/342/src/wp_highlight.js.php
+
+
+## Version 5.8
+
+- Jan Berkel has contributed a definition for Scala. +1 to hotness!
+- All CSS-styles are rewritten to work only inside `
` tags to avoid
+  conflicts with host site styles.
+
+
+## Version 5.7.
+
+Fixed escaping of quotes in VBScript strings.
+
+
+## Version 5.5
+
+This version brings a small change: now .ini-files allow digits, underscores and
+square brackets in key names.
+
+
+## Version 5.4
+
+Fixed small but upsetting bug in the packer which caused incorrect highlighting
+of explicitly specified languages. Thanks to Andrew Fedorov for precise
+diagnostics!
+
+
+## Version 5.3
+
+The version to fulfil old promises.
+
+The most significant change is that highlight.js now preserves custom user
+markup in code along with its own highlighting markup. This means that now it's
+possible to use, say, links in code. Thanks to [Vladimir Dolzhenko][vd] for the
+[initial proposal][1] and for making a proof-of-concept patch.
+
+Also in this version:
+
+- [Vasily Polovnyov][vp] has sent a GitHub-like style and has implemented
+  support for CSS @-rules and Ruby symbols.
+- Yura Zaripov has sent two styles: Brown Paper and School Book.
+- Oleg Volchkov has sent a definition for [Parser 3][p3].
+
+[1]: http://softwaremaniacs.org/forum/highlightjs/6612/
+[p3]: http://www.parser.ru/
+[vp]: http://vasily.polovnyov.ru/
+[vd]: http://dolzhenko.blogspot.com/
+
+
+## Version 5.2
+
+- at last it's possible to replace indentation TABs with something sensible
+  (e.g. 2 or 4 spaces)
+- new keywords and built-ins for 1C by Sergey Baranov
+- a couple of small fixes to Apache highlighting
+
+
+## Version 5.1
+
+This is one of those nice version consisting entirely of new and shiny
+contributions!
+
+- [Vladimir Ermakov][vooon] created highlighting for AVR Assembler
+- [Ruslan Keba][rukeba] created highlighting for Apache config file. Also his
+  original visual style for it is now available for all highlight.js languages
+  under the name "Magula".
+- [Shuen-Huei Guan][drake] (aka Drake) sent new keywords for RenderMan
+  languages. Also thanks go to [Konstantin Evdokimenko][ke] for his advice on
+  the matter.
+
+[vooon]: http://vehq.ru/about/
+[rukeba]: http://rukeba.com/
+[drake]: http://drakeguan.org/
+[ke]: http://k-evdokimenko.moikrug.ru/
+
+
+## Version 5.0
+
+The main change in the new major version of highlight.js is a mechanism for
+packing several languages along with the library itself into a single compressed
+file. Now sites using several languages will load considerably faster because
+the library won't dynamically include additional files while loading.
+
+Also this version fixes a long-standing bug with Javascript highlighting that
+couldn't distinguish between regular expressions and division operations.
+
+And as usually there were a couple of minor correctness fixes.
+
+Great thanks to all contributors! Keep using highlight.js.
+
+
+## Version 4.3
+
+This version comes with two contributions from [Jason Diamond][jd]:
+
+- language definition for C# (yes! it was a long-missed thing!)
+- Visual Studio-like highlighting style
+
+Plus there are a couple of minor bug fixes for parsing HTML and XML attributes.
+
+[jd]: http://jason.diamond.name/weblog/
+
+
+## Version 4.2
+
+The biggest news is highlighting for Lisp, courtesy of Vasily Polovnyov. It's
+somewhat experimental meaning that for highlighting "keywords" it doesn't use
+any pre-defined set of a Lisp dialect. Instead it tries to highlight first word
+in parentheses wherever it makes sense. I'd like to ask people programming in
+Lisp to confirm if it's a good idea and send feedback to [the forum][f].
+
+Other changes:
+
+- Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
+- [Vladimir Epifanov][voldmar] has implemented javascript style switcher for
+  test.html
+- comments now allowed inside Ruby function definition
+- [MEL][] language from [Shuen-Huei Guan][drake]
+- whitespace now allowed between `
` and ``
+- better auto-detection of C++ and PHP
+- HTML allows embedded VBScript (`<% .. %>`)
+
+[f]: http://softwaremaniacs.org/forum/highlightjs/
+[voldmar]: http://voldmar.ya.ru/
+[mel]: http://en.wikipedia.org/wiki/Maya_Embedded_Language
+[drake]: http://drakeguan.org/
+
+
+## Version 4.1
+
+Languages:
+
+- Bash from Vah
+- DOS bat-files from Alexander Makarov (Sam)
+- Diff files from Vasily Polovnyov
+- Ini files from myself though initial idea was from Sam
+
+Styles:
+
+- Zenburn from Vladimir Epifanov, this is an imitation of a
+  [well-known theme for Vim][zenburn].
+- Ascetic from myself, as a realization of ideals of non-flashy highlighting:
+  just one color in only three gradations :-)
+
+In other news. [One small bug][bug] was fixed, built-in keywords were added for
+Python and C++ which improved auto-detection for the latter (it was shame that
+[my wife's blog][alenacpp] had issues with it from time to time). And lastly
+thanks go to Sam for getting rid of my stylistic comments in code that were
+getting in the way of [JSMin][].
+
+[zenburn]: http://en.wikipedia.org/wiki/Zenburn
+[alenacpp]: http://alenacpp.blogspot.com/
+[bug]: http://softwaremaniacs.org/forum/viewtopic.php?id=1823
+[jsmin]: http://code.google.com/p/jsmin-php/
+
+
+## Version 4.0
+
+New major version is a result of vast refactoring and of many contributions.
+
+Visible new features:
+
+- Highlighting of embedded languages. Currently is implemented highlighting of
+  Javascript and CSS inside HTML.
+- Bundled 5 ready-made style themes!
+
+Invisible new features:
+
+- Highlight.js no longer pollutes global namespace. Only one object and one
+  function for backward compatibility.
+- Performance is further increased by about 15%.
+
+Changing of a major version number caused by a new format of language definition
+files. If you use some third-party language files they should be updated.
+
+
+## Version 3.5
+
+A very nice version in my opinion fixing a number of small bugs and slightly
+increased speed in a couple of corner cases. Thanks to everybody who reports
+bugs in he [forum][f] and by email!
+
+There is also a new language — XML. A custom XML formerly was detected as HTML
+and didn't highlight custom tags. In this version I tried to make custom XML to
+be detected and highlighted by its own rules. Which by the way include such
+things as CDATA sections and processing instructions (``).
+
+[f]: http://softwaremaniacs.org/forum/viewforum.php?id=6
+
+
+## Version 3.3
+
+[Vladimir Gubarkov][xonix] has provided an interesting and useful addition.
+File export.html contains a little program that shows and allows to copy and
+paste an HTML code generated by the highlighter for any code snippet. This can
+be useful in situations when one can't use the script itself on a site.
+
+
+[xonix]: http://xonixx.blogspot.com/
+
+
+## Version 3.2 consists completely of contributions:
+
+- Vladimir Gubarkov has described SmallTalk
+- Yuri Ivanov has described 1C
+- Peter Leonov has packaged the highlighter as a Firefox extension
+- Vladimir Ermakov has compiled a mod for phpBB
+
+Many thanks to you all!
+
+
+## Version 3.1
+
+Three new languages are available: Django templates, SQL and Axapta. The latter
+two are sent by [Dmitri Roudakov][1]. However I've almost entirely rewrote an
+SQL definition but I'd never started it be it from the ground up :-)
+
+The engine itself has got a long awaited feature of grouping keywords
+("keyword", "built-in function", "literal"). No more hacks!
+
+[1]: http://roudakov.ru/
+
+
+## Version 3.0
+
+It is major mainly because now highlight.js has grown large and has become
+modular. Now when you pass it a list of languages to highlight it will
+dynamically load into a browser only those languages.
+
+Also:
+
+- Konstantin Evdokimenko of [RibKit][] project has created a highlighting for
+  RenderMan Shading Language and RenderMan Interface Bytestream. Yay for more
+  languages!
+- Heuristics for C++ and HTML got better.
+- I've implemented (at last) a correct handling of backslash escapes in C-like
+  languages.
+
+There is also a small backwards incompatible change in the new version. The
+function initHighlighting that was used to initialize highlighting instead of
+initHighlightingOnLoad a long time ago no longer works. If you by chance still
+use it — replace it with the new one.
+
+[RibKit]: http://ribkit.sourceforge.net/
+
+
+## Version 2.9
+
+Highlight.js is a parser, not just a couple of regular expressions. That said
+I'm glad to announce that in the new version 2.9 has support for:
+
+- in-string substitutions for Ruby -- `#{...}`
+- strings from from numeric symbol codes (like #XX) for Delphi
+
+
+## Version 2.8
+
+A maintenance release with more tuned heuristics. Fully backwards compatible.
+
+
+## Version 2.7
+
+- Nikita Ledyaev presents highlighting for VBScript, yay!
+- A couple of bugs with escaping in strings were fixed thanks to Mickle
+- Ongoing tuning of heuristics
+
+Fixed bugs were rather unpleasant so I encourage everyone to upgrade!
+
+
+## Version 2.4
+
+- Peter Leonov provides another improved highlighting for Perl
+- Javascript gets a new kind of keywords — "literals". These are the words
+  "true", "false" and "null"
+
+Also highlight.js homepage now lists sites that use the library. Feel free to
+add your site by [dropping me a message][mail] until I find the time to build a
+submit form.
+
+[mail]: mailto:Maniac@SoftwareManiacs.Org
+
+
+## Version 2.3
+
+This version fixes IE breakage in previous version. My apologies to all who have
+already downloaded that one!
+
+
+## Version 2.2
+
+- added highlighting for Javascript
+- at last fixed parsing of Delphi's escaped apostrophes in strings
+- in Ruby fixed highlighting of keywords 'def' and 'class', same for 'sub' in
+  Perl
+
+
+## Version 2.0
+
+- Ruby support by [Anton Kovalyov][ak]
+- speed increased by orders of magnitude due to new way of parsing
+- this same way allows now correct highlighting of keywords in some tricky
+  places (like keyword "End" at the end of Delphi classes)
+
+[ak]: http://anton.kovalyov.net/
+
+
+## Version 1.0
+
+Version 1.0 of javascript syntax highlighter is released!
+
+It's the first version available with English description. Feel free to post
+your comments and question to [highlight.js forum][forum]. And don't be afraid
+if you find there some fancy Cyrillic letters -- it's for Russian users too :-)
+
+[forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6
diff --git a/highlight-js/LICENSE b/highlight-js/LICENSE
new file mode 100644
index 0000000..422deb7
--- /dev/null
+++ b/highlight-js/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2006, Ivan Sagalaev
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of highlight.js nor the names of its contributors 
+      may be used to endorse or promote products derived from this software 
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/highlight-js/README.md b/highlight-js/README.md
new file mode 100644
index 0000000..6cf5235
--- /dev/null
+++ b/highlight-js/README.md
@@ -0,0 +1,186 @@
+# Highlight.js
+
+[![Build Status](https://travis-ci.org/highlightjs/highlight.js.svg?branch=master)](https://travis-ci.org/highlightjs/highlight.js)
+
+Highlight.js is a syntax highlighter written in JavaScript. It works in
+the browser as well as on the server. It works with pretty much any
+markup, doesn’t depend on any framework, and has automatic language
+detection.
+
+## Getting Started
+
+The bare minimum for using highlight.js on a web page is linking to the
+library along with one of the styles and calling
+[`initHighlightingOnLoad`][1]:
+
+```html
+
+
+
+```
+
+This will find and highlight code inside of `
` tags; it tries
+to detect the language automatically. If automatic detection doesn’t
+work for you, you can specify the language in the `class` attribute:
+
+```html
+
...
+``` + +The list of supported language classes is available in the [class +reference][2]. Classes can also be prefixed with either `language-` or +`lang-`. + +To make arbitrary text look like code, but without highlighting, use the +`plaintext` class: + +```html +
...
+``` + +To disable highlighting altogether use the `nohighlight` class: + +```html +
...
+``` + +## Custom Initialization + +When you need a bit more control over the initialization of +highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4] +functions. This allows you to control *what* to highlight and *when*. + +Here’s an equivalent way to calling [`initHighlightingOnLoad`][1] using +jQuery: + +```javascript +$(document).ready(function() { + $('pre code').each(function(i, block) { + hljs.highlightBlock(block); + }); +}); +``` + +You can use any tags instead of `
` to mark up your code. If
+you don't use a container that preserves line breaks you will need to
+configure highlight.js to use the `
` tag: + +```javascript +hljs.configure({useBR: true}); + +$('div.code').each(function(i, block) { + hljs.highlightBlock(block); +}); +``` + +For other options refer to the documentation for [`configure`][4]. + + +## Web Workers + +You can run highlighting inside a web worker to avoid freezing the browser +window while dealing with very big chunks of code. + +In your main script: + +```javascript +addEventListener('load', function() { + var code = document.querySelector('#code'); + var worker = new Worker('worker.js'); + worker.onmessage = function(event) { code.innerHTML = event.data; } + worker.postMessage(code.textContent); +}) +``` + +In worker.js: + +```javascript +onmessage = function(event) { + importScripts('/highlight.pack.js'); + var result = self.hljs.highlightAuto(event.data); + postMessage(result.value); +} +``` + + +## Getting the Library + +You can get highlight.js as a hosted, or custom-build, browser script or +as a server module. Right out of the box the browser script supports +both AMD and CommonJS, so if you wish you can use RequireJS or +Browserify without having to build from source. The server module also +works perfectly fine with Browserify, but there is the option to use a +build specific to browsers rather than something meant for a server. +Head over to the [download page][5] for all the options. + +**Don't link to GitHub directly.** The library is not supposed to work straight +from the source, it requires building. If none of the pre-packaged options +work for you refer to the [building documentation][6]. + +**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be +too big. If you don't see the language you need in the ["Common" section][5], +it can be added manually: + +```html + +``` + +**On Almond.** You need to use the optimizer to give the module a name. For +example: + +``` +r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js +``` + + +### CommonJS + +You can import Highlight.js as a CommonJS-module: + +```bash +npm install highlight.js --save +``` + +In your application: + +```javascript +import hljs from 'highlight.js'; +``` + +The default import imports all languages! Therefore it is likely to be more efficient to import only the library and the languages you need: + +```javascript +import hljs from 'highlight.js/lib/highlight'; +import javascript from 'highlight.js/lib/languages/javascript'; +hljs.registerLanguage('javascript', javascript); +``` + +To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can import the stylesheet directly into your CommonJS-module: + +```javascript +import hljs from 'highlight.js/lib/highlight'; +import 'highlight.js/styles/github.css' +``` + +## License + +Highlight.js is released under the BSD License. See [LICENSE][7] file +for details. + +## Links + +The official site for the library is at . + +Further in-depth documentation for the API and other topics is at +. + +Authors and contributors are listed in the [AUTHORS.en.txt][8] file. + +[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload +[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html +[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block +[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options +[5]: https://highlightjs.org/download/ +[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html +[7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.en.txt diff --git a/highlight-js/README.ru.md b/highlight-js/README.ru.md new file mode 100644 index 0000000..44285f6 --- /dev/null +++ b/highlight-js/README.ru.md @@ -0,0 +1,142 @@ +# Highlight.js + +Highlight.js — это инструмент для подсветки синтаксиса, написанный на JavaScript. Он работает +и в браузере, и на сервере. Он работает с практически любой HTML разметкой, не +зависит от каких-либо фреймворков и умеет автоматически определять язык. + + +## Начало работы + +Минимум, что нужно сделать для использования highlight.js на веб-странице — это +подключить библиотеку, CSS-стили и вызывать [`initHighlightingOnLoad`][1]: + +```html + + + +``` + +Библиотека найдёт и раскрасит код внутри тегов `
`, попытавшись
+автоматически определить язык. Когда автоопределение не срабатывает, можно явно
+указать язык в атрибуте class:
+
+```html
+
...
+``` + +Список поддерживаемых классов языков доступен в [справочнике по классам][2]. +Класс также можно предварить префиксами `language-` или `lang-`. + +Чтобы отключить подсветку для какого-то блока, используйте класс `nohighlight`: + +```html +
...
+``` + +## Инициализация вручную + +Чтобы иметь чуть больше контроля за инициализацией подсветки, вы можете +использовать функции [`highlightBlock`][3] и [`configure`][4]. Таким образом +можно управлять тем, *что* и *когда* подсвечивать. + +Вот пример инициализации, эквивалентной вызову [`initHighlightingOnLoad`][1], но +с использованием jQuery: + +```javascript +$(document).ready(function() { + $('pre code').each(function(i, block) { + hljs.highlightBlock(block); + }); +}); +``` + +Вы можете использовать любые теги разметки вместо `
`. Если
+используете контейнер, не сохраняющий переводы строк, вам нужно сказать
+highlight.js использовать для них тег `
`: + +```javascript +hljs.configure({useBR: true}); + +$('div.code').each(function(i, block) { + hljs.highlightBlock(block); +}); +``` + +Другие опции можно найти в документации функции [`configure`][4]. + + +## Web Workers + +Подсветку можно запустить внутри web worker'а, чтобы окно +браузера не подтормаживало при работе с большими кусками кода. + +В основном скрипте: + +```javascript +addEventListener('load', function() { + var code = document.querySelector('#code'); + var worker = new Worker('worker.js'); + worker.onmessage = function(event) { code.innerHTML = event.data; } + worker.postMessage(code.textContent); +}) +``` + +В worker.js: + +```javascript +onmessage = function(event) { + importScripts('/highlight.pack.js'); + var result = self.hljs.highlightAuto(event.data); + postMessage(result.value); +} +``` + + +## Установка библиотеки + +Highlight.js можно использовать в браузере прямо с CDN хостинга или скачать +индивидуальную сборку, а также установив модуль на сервере. На +[странице загрузки][5] подробно описаны все варианты. + +**Не подключайте GitHub напрямую.** Библиотека не предназначена для +использования в виде исходного кода, а требует отдельной сборки. Если вам не +подходит ни один из готовых вариантов, читайте [документацию по сборке][6]. + +**Файл на CDN содержит не все языки.** Иначе он будет слишком большого размера. +Если нужного вам языка нет в [категории "Common"][5], можно дообавить его +вручную: + +```html + +``` + +**Про Almond.** Нужно задать имя модуля в оптимизаторе, например: + +``` +r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js +``` + + +## Лицензия + +Highlight.js распространяется под лицензией BSD. Подробнее читайте файл +[LICENSE][7]. + + +## Ссылки + +Официальный сайт билиотеки расположен по адресу . + +Более подробная документация по API и другим темам расположена на +. + +Авторы и контрибьюторы перечислены в файле [AUTHORS.ru.txt][8] file. + +[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload +[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html +[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block +[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options +[5]: https://highlightjs.org/download/ +[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html +[7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.ru.txt diff --git a/highlight-js/demo/demo.js b/highlight-js/demo/demo.js new file mode 100644 index 0000000..3516cb0 --- /dev/null +++ b/highlight-js/demo/demo.js @@ -0,0 +1,119 @@ +(function() { + 'use strict'; + + var $window = $(window), + $languages = $('#languages div'), + $linkTitle = $('link[title]'), + $categoryContainer = $('#categories'), + $styleContainer = $('#styles'); + + function resizeLists() { + var screenHeight = $window.height() + + $categoryContainer.css('max-height', screenHeight / 4); + $categoryContainer.perfectScrollbar('update'); + $styleContainer.height( + screenHeight - $styleContainer.position().top - 20 + ); + $styleContainer.perfectScrollbar('update'); + } + + function selectCategory(category) { + $languages.each(function(i, language) { + var $language = $(language); + + if ($language.hasClass(category)) { + var code = $language.find('code'); + + if (!code.hasClass('hljs')) { + hljs.highlightBlock(code.get(0)); + } + + $language.show(); + } else { + $language.hide(); + } + }); + + $(document).scrollTop(0); + } + + function categoryKey(c) { + return c === 'common' ? '' : c === 'misc' ? 'z' : c === 'all' ? 'zz' : c; + } + + function initCategories() { + var $categories, categoryNames; + var categories = {}; + + $languages.each(function(i, div) { + if (!div.className) { + div.className += 'misc'; + } + div.className += ' all'; + div.className.split(' ').forEach(function(c) { + categories[c] = (categories[c] || 0) + 1; + }); + }); + + categoryNames = Object.keys(categories); + + categoryNames.sort(function(a, b) { + a = categoryKey(a); + b = categoryKey(b); + return a < b ? -1 : a > b ? 1 : 0; + }); + + categoryNames.forEach(function(c) { + $categoryContainer.append( + '
  • ' + c + ' (' + categories[c] +')
  • ' + ); + }); + + $categories = $categoryContainer.find('li'); + + $categories.click(function() { + var $category = $(this); + + $categories.removeClass('current'); + $category.addClass('current'); + selectCategory($category.data('category')); + }); + + $categories.first().click(); + $categoryContainer.perfectScrollbar(); + } + + function selectStyle(style) { + $linkTitle.each(function(i, link) { + link.disabled = (link.title !== style); + }); + } + + function initStyles() { + var $styles; + + $linkTitle.each(function(i, link) { + $styleContainer.append('
  • ' + link.title + '
  • '); + }); + + $styles = $styleContainer.find('li'); + + $styles.click(function() { + var $style = $(this); + + $styles.removeClass('current'); + $style.addClass('current'); + selectStyle($style.text()); + }); + $styles.first().click(); + $styleContainer.perfectScrollbar(); + } + + $(function() { + initCategories(); + initStyles(); + $window.resize(resizeLists); + resizeLists(); + }); +}).call(this); diff --git a/highlight-js/demo/index.html b/highlight-js/demo/index.html new file mode 100644 index 0000000..14becb4 --- /dev/null +++ b/highlight-js/demo/index.html @@ -0,0 +1,55 @@ + + + + + + highlight.js demo + + + + + <% _.each(styles, function(style) { %> + + <% }); %> + + + + +
    + +
    + <% _.each(blobs, function(blob) { %> + <% var categories = blob.fileInfo.Category; %> +
    class="<%= categories.join(' ') %>"<% } %>> +

    <%- blob.fileInfo.Language %>

    +
    <%- blob.result %>
    +
    + <% }); %> +
    + +
    + + + + + + + diff --git a/highlight-js/demo/jquery-2.1.1.min.js b/highlight-js/demo/jquery-2.1.1.min.js new file mode 100644 index 0000000..e5ace11 --- /dev/null +++ b/highlight-js/demo/jquery-2.1.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n(" diff --git a/highlight-js/test/detect/xquery/default.txt b/highlight-js/test/detect/xquery/default.txt new file mode 100644 index 0000000..9ac5efd --- /dev/null +++ b/highlight-js/test/detect/xquery/default.txt @@ -0,0 +1,20 @@ +declare option output:method 'json'; + +( +let $map := map { 'R': 'red', 'G': 'green', 'B': 'blue' } +return ( + $map?* (: 1. returns all values; same as: map:keys($map) ! $map(.) :), + $map?R (: 2. returns the value associated with the key 'R'; same as: $map('R') :), + $map?('G','B') (: 3. returns the values associated with the key 'G' and 'B' :) +), + +('A', 'B', 'C') => count(), + +for $country in db:open('factbook')//country +where $country/@population > 100000000 +let $name := $country/name[1] +for $city in $country//city[population > 1000000] +group by $name +return { $city/name } + +) diff --git a/highlight-js/test/detect/yaml/default.txt b/highlight-js/test/detect/yaml/default.txt new file mode 100644 index 0000000..49c4939 --- /dev/null +++ b/highlight-js/test/detect/yaml/default.txt @@ -0,0 +1,39 @@ +--- +# comment +string_1: "Bar" +string_2: 'bar' +string_3: bar +inline_keys_ignored: sompath/name/file.jpg +keywords_in_yaml: + - true + - false + - TRUE + - FALSE + - 21 + - 21.0 + - !!str 123 +"quoted_key": &foobar + bar: foo + foo: + "foo": bar + +reference: *foobar + +multiline_1: | + Multiline + String +multiline_2: > + Multiline + String +multiline_3: " + Multiline string + " + +ansible_variables: "foo {{variable}}" + +array_nested: +- a +- b: 1 + c: 2 +- b +- comment diff --git a/highlight-js/test/detect/zephir/default.txt b/highlight-js/test/detect/zephir/default.txt new file mode 100644 index 0000000..8142e7f --- /dev/null +++ b/highlight-js/test/detect/zephir/default.txt @@ -0,0 +1,55 @@ +function testBefore( a, var b = 5, int c = 10) +{ + a->method1(); + + return b + c; +} + +namespace Test; + +use RuntimeException as RE; + +/** + * Example comment + */ +class Test extends CustomClass implements TestInterface +{ + const C1 = null; + + // Magic constant: http://php.net/manual/ru/language.constants.predefined.php + const className = __CLASS__; + + public function method1() + { + int a = 1, b = 2; + return a + b; + } + + // See fn is allowed like shortcut + public fn method2() -> + { + call_user_func(function() { echo "hello"; }); + + + [1, 2, 3, 4, 5]->walk( + function(int! x) { + return x * x; + } + ); + + [1, 2, 3, 4, 5]->walk( + function(_, int key) { echo key; } + ); + + array input = [1, 2, 3, 4, 5]; + + input->walk( + function(_, int key) { echo key; } + ); + + + input->map(x => x * x); + + return this; + } +} diff --git a/highlight-js/test/fixtures/expect/brInPre.txt b/highlight-js/test/fixtures/expect/brInPre.txt new file mode 100644 index 0000000..e065147 --- /dev/null +++ b/highlight-js/test/fixtures/expect/brInPre.txt @@ -0,0 +1 @@ +>> '\x41\x42\x43'
    'ABC'


    >> '\x61\x62\x63'
    'abc' diff --git a/highlight-js/test/fixtures/expect/custommarkup.txt b/highlight-js/test/fixtures/expect/custommarkup.txt new file mode 100644 index 0000000..f0304c2 --- /dev/null +++ b/highlight-js/test/fixtures/expect/custommarkup.txt @@ -0,0 +1,3 @@ +<div id="contents"> + <p>Hello, World!Goodbye, cruel world! +</div> diff --git a/highlight-js/test/fixtures/expect/customtabreplace.txt b/highlight-js/test/fixtures/expect/customtabreplace.txt new file mode 100644 index 0000000..d217f1c --- /dev/null +++ b/highlight-js/test/fixtures/expect/customtabreplace.txt @@ -0,0 +1,4 @@ +for x in [1, 2, 3]: + count(x) + if x == 3: + count(x + 1) \ No newline at end of file diff --git a/highlight-js/test/fixtures/expect/endsWithParentVariants.txt b/highlight-js/test/fixtures/expect/endsWithParentVariants.txt new file mode 100644 index 0000000..15d7617 --- /dev/null +++ b/highlight-js/test/fixtures/expect/endsWithParentVariants.txt @@ -0,0 +1 @@ +( [ ( ) ] ) diff --git a/highlight-js/test/fixtures/expect/explicit1.txt b/highlight-js/test/fixtures/expect/explicit1.txt new file mode 100644 index 0000000..59544c1 --- /dev/null +++ b/highlight-js/test/fixtures/expect/explicit1.txt @@ -0,0 +1,2 @@ +for x in [1, 2, 3]: + count(x) \ No newline at end of file diff --git a/highlight-js/test/fixtures/expect/explicit2.txt b/highlight-js/test/fixtures/expect/explicit2.txt new file mode 100644 index 0000000..1a49fda --- /dev/null +++ b/highlight-js/test/fixtures/expect/explicit2.txt @@ -0,0 +1,2 @@ +@import "compass/reset"; +$colorGreenDark: darken($colorGreen, 10); diff --git a/highlight-js/test/fixtures/expect/languagealias.txt b/highlight-js/test/fixtures/expect/languagealias.txt new file mode 100644 index 0000000..571f200 --- /dev/null +++ b/highlight-js/test/fixtures/expect/languagealias.txt @@ -0,0 +1 @@ +var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>'; \ No newline at end of file diff --git a/highlight-js/test/fixtures/expect/sublanguages.txt b/highlight-js/test/fixtures/expect/sublanguages.txt new file mode 100644 index 0000000..2a89d6a --- /dev/null +++ b/highlight-js/test/fixtures/expect/sublanguages.txt @@ -0,0 +1,4 @@ +<? echo 'php'; /* ?> */ ?> +<body> +<script>document.write('Legacy code');</script> +</body> diff --git a/highlight-js/test/fixtures/expect/tabreplace.txt b/highlight-js/test/fixtures/expect/tabreplace.txt new file mode 100644 index 0000000..01d1c57 --- /dev/null +++ b/highlight-js/test/fixtures/expect/tabreplace.txt @@ -0,0 +1,2 @@ +for x in [1, 2, 3]: + count(x) \ No newline at end of file diff --git a/highlight-js/test/fixtures/expect/useBr.txt b/highlight-js/test/fixtures/expect/useBr.txt new file mode 100644 index 0000000..7707a4c --- /dev/null +++ b/highlight-js/test/fixtures/expect/useBr.txt @@ -0,0 +1 @@ +<head>
    <meta charset="utf-8">
    <title></title>
    </head> diff --git a/highlight-js/test/fixtures/index.html b/highlight-js/test/fixtures/index.html new file mode 100644 index 0000000..aba3e89 --- /dev/null +++ b/highlight-js/test/fixtures/index.html @@ -0,0 +1,146 @@ + + + + + highlight.js test + + +
    + + +
    for x in [1, 2, 3]:
    +  count(x)
    + + +
    for x in [1, 2, 3]:
    +  count(x)
    + + +
    for x in [1, 2, 3]:
    +  count(x)
    + + +
    @import "compass/reset";
    +$colorGreenDark: darken($colorGreen, 10);
    +
    + + +
    @import "compass/reset";
    +$colorGreenDark: darken($colorGreen, 10);
    +
    + +
    + +
    + + +
    for x in [1, 2, 3]:
    +	count(x)
    + + +
    <div id="contents">
    +  <p>Hello, World!Goodbye, cruel world!
    +</div>
    +
    + + +
    for x in [1, 2, 3]:
    +	count(x)
    +	if x == 3:
    +		count(x + 1)
    + + +
    >> '\x41\x42\x43'
    'ABC'


    >> '\x61\x62\x63'
    'abc' +
    + +
    + +
    + + +
    var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>';
    + +
    + +
    + + +
    <div id="contents">
    +  <p>Hello, World!
    +</div>
    +
    <div id="contents">
    +  <p>Hello, World!
    +</div>
    +
    <div id="contents">
    +  <p>Hello, World!
    +</div>
    +
    <div id="contents">
    +  <p>Hello, World!
    +</div>
    + + +
    Computer output
    + + +
    for x in [1, 2, 3]: count(x)
    + + +
    for x in [1, 2, 3]: count(x)
    + + +
    for x in [1, 2, 3]: count(x)
    + + +
    var x = 'foo';
    +
    var x = 'foo';
    + +
    + + +
    <? echo 'php'; /* ?> */ ?>
    +<body>
    +<script>document.write('Legacy code');</script>
    +</body>
    +
    + +
    + + +
    <?xml version="1.0"?>
    +    <response value="ok" xml:lang="en"></response>
    + + +
    <?xml version="1.0"?>
    +    <response value="ok" xml:lang="en"></response>
    + + +
    <?xml version="1.0"?>
    +    <response value="ok" xml:lang="en"></response>
    + + +
    <?xml version="1.0"?>
    +    <response value="ok" xml:lang="en"></response>
    + +
    + +
    + +
    <head>
    <meta charset="utf-8">
    <title></title>
    </head>
    + +
    <head>
    + <meta charset="utf-8">
    + <title></title>
    +</head>
    + +
    <head>
    + <meta charset="utf-8">
    + <title></title>
    +</head>
    + +
    + +
    ( [ ( ) ] )
    + + + + diff --git a/highlight-js/test/fixtures/nested.js b/highlight-js/test/fixtures/nested.js new file mode 100644 index 0000000..81e17d3 --- /dev/null +++ b/highlight-js/test/fixtures/nested.js @@ -0,0 +1,17 @@ +module.exports = function(hljs) { + var BODY = { + className: 'body', endsWithParent: true + }; + var LIST = { + className: 'list', + variants: [ + {begin: /\(/, end: /\)/}, + {begin: /\[/, end: /\]/} + ], + contains: [BODY] + }; + BODY.contains = [LIST]; + return { + contains: [LIST] + } +}; diff --git a/highlight-js/test/index.js b/highlight-js/test/index.js new file mode 100644 index 0000000..2657a31 --- /dev/null +++ b/highlight-js/test/index.js @@ -0,0 +1,22 @@ +'use strict'; + +// Tests specific to the API exposed inside the hljs object. +// Right now, that only includes tests for several common regular expressions. +require('./api'); + +// Tests for auto detection of languages via `highlightAuto`. +require('./detect'); + +// HTML markup tests for particular languages. Usually when there is an +// incorrect highlighting of one language, once the bug get fixed, the +// expected markup will be added into the `test/markup` folder to keep +// theses highlighting errors from cropping up again. +require('./markup'); + +// Tests meant for the browser only. Using the `test/fixtures/index.html` file +// along with `jsdom` these tests check for things like: custom markup already +// existing in the code being highlighted, blocks that disable highlighting, +// and several other cases. Do note that the `test/fixtures/index.html` file +// isn't actually used to test inside a browser but `jsdom` acts as a virtual +// browser inside of node.js and runs together with all the other tests. +require('./special'); diff --git a/highlight-js/test/markup/accesslog/default.expect.txt b/highlight-js/test/markup/accesslog/default.expect.txt new file mode 100644 index 0000000..4e4dc30 --- /dev/null +++ b/highlight-js/test/markup/accesslog/default.expect.txt @@ -0,0 +1 @@ +20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" diff --git a/highlight-js/test/markup/accesslog/default.txt b/highlight-js/test/markup/accesslog/default.txt new file mode 100644 index 0000000..a9d4325 --- /dev/null +++ b/highlight-js/test/markup/accesslog/default.txt @@ -0,0 +1 @@ +20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" diff --git a/highlight-js/test/markup/actionscript/method-call.expect.txt b/highlight-js/test/markup/actionscript/method-call.expect.txt new file mode 100644 index 0000000..752a397 --- /dev/null +++ b/highlight-js/test/markup/actionscript/method-call.expect.txt @@ -0,0 +1 @@ +x.get(0); diff --git a/highlight-js/test/markup/actionscript/method-call.txt b/highlight-js/test/markup/actionscript/method-call.txt new file mode 100644 index 0000000..1449787 --- /dev/null +++ b/highlight-js/test/markup/actionscript/method-call.txt @@ -0,0 +1 @@ +x.get(0); diff --git a/highlight-js/test/markup/arcade/profile.expect.txt b/highlight-js/test/markup/arcade/profile.expect.txt new file mode 100644 index 0000000..e7ace43 --- /dev/null +++ b/highlight-js/test/markup/arcade/profile.expect.txt @@ -0,0 +1,9 @@ +/* + Isolated test for the most recent version +*/ +function offsetPopulation(offset){ + var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); + var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); + var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); + return popDensity; +} \ No newline at end of file diff --git a/highlight-js/test/markup/arcade/profile.txt b/highlight-js/test/markup/arcade/profile.txt new file mode 100644 index 0000000..b4f54b0 --- /dev/null +++ b/highlight-js/test/markup/arcade/profile.txt @@ -0,0 +1,9 @@ +/* + Isolated test for the most recent version +*/ +function offsetPopulation(offset){ + var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); + var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); + var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); + return popDensity; +} diff --git a/highlight-js/test/markup/aspectj/intertype-constructor.expect.txt b/highlight-js/test/markup/aspectj/intertype-constructor.expect.txt new file mode 100644 index 0000000..9cfa198 --- /dev/null +++ b/highlight-js/test/markup/aspectj/intertype-constructor.expect.txt @@ -0,0 +1,3 @@ +public MyClass.new() throws Exception{ + // intertype constructor body +} diff --git a/highlight-js/test/markup/aspectj/intertype-constructor.txt b/highlight-js/test/markup/aspectj/intertype-constructor.txt new file mode 100644 index 0000000..0199ef9 --- /dev/null +++ b/highlight-js/test/markup/aspectj/intertype-constructor.txt @@ -0,0 +1,3 @@ +public MyClass.new() throws Exception{ + // intertype constructor body +} diff --git a/highlight-js/test/markup/aspectj/intertype-method.expect.txt b/highlight-js/test/markup/aspectj/intertype-method.expect.txt new file mode 100644 index 0000000..09b1c54 --- /dev/null +++ b/highlight-js/test/markup/aspectj/intertype-method.expect.txt @@ -0,0 +1,6 @@ +public void MyClass.doSomething() throws Exception{ + // intertype method body +} +public void A.doSomething(int param1){ + // intertype method body +} diff --git a/highlight-js/test/markup/aspectj/intertype-method.txt b/highlight-js/test/markup/aspectj/intertype-method.txt new file mode 100644 index 0000000..99787a0 --- /dev/null +++ b/highlight-js/test/markup/aspectj/intertype-method.txt @@ -0,0 +1,6 @@ +public void MyClass.doSomething() throws Exception{ + // intertype method body +} +public void A.doSomething(int param1){ + // intertype method body +} diff --git a/highlight-js/test/markup/bash/no-numbers.expect.txt b/highlight-js/test/markup/bash/no-numbers.expect.txt new file mode 100644 index 0000000..33fc753 --- /dev/null +++ b/highlight-js/test/markup/bash/no-numbers.expect.txt @@ -0,0 +1,3 @@ +# numbers aren't highlighted in bash as their semantics is +# not strictly defined for command line parameters +$ tail -10 access.log diff --git a/highlight-js/test/markup/bash/no-numbers.txt b/highlight-js/test/markup/bash/no-numbers.txt new file mode 100644 index 0000000..8e94063 --- /dev/null +++ b/highlight-js/test/markup/bash/no-numbers.txt @@ -0,0 +1,3 @@ +# numbers aren't highlighted in bash as their semantics is +# not strictly defined for command line parameters +$ tail -10 access.log diff --git a/highlight-js/test/markup/ceylon/nested-comments.expect.txt b/highlight-js/test/markup/ceylon/nested-comments.expect.txt new file mode 100644 index 0000000..85c529d --- /dev/null +++ b/highlight-js/test/markup/ceylon/nested-comments.expect.txt @@ -0,0 +1,5 @@ +/* + /* + Ceylon has nested comments. + */ + */ diff --git a/highlight-js/test/markup/ceylon/nested-comments.txt b/highlight-js/test/markup/ceylon/nested-comments.txt new file mode 100644 index 0000000..39b49eb --- /dev/null +++ b/highlight-js/test/markup/ceylon/nested-comments.txt @@ -0,0 +1,5 @@ +/* + /* + Ceylon has nested comments. + */ + */ diff --git a/highlight-js/test/markup/clojure-repl/prompt.expect.txt b/highlight-js/test/markup/clojure-repl/prompt.expect.txt new file mode 100644 index 0000000..ee50199 --- /dev/null +++ b/highlight-js/test/markup/clojure-repl/prompt.expect.txt @@ -0,0 +1,2 @@ +user=> +=> diff --git a/highlight-js/test/markup/clojure-repl/prompt.txt b/highlight-js/test/markup/clojure-repl/prompt.txt new file mode 100644 index 0000000..a410dda --- /dev/null +++ b/highlight-js/test/markup/clojure-repl/prompt.txt @@ -0,0 +1,2 @@ +user=> +=> diff --git a/highlight-js/test/markup/clojure/hint_col.expect.txt b/highlight-js/test/markup/clojure/hint_col.expect.txt new file mode 100644 index 0000000..06e96c0 --- /dev/null +++ b/highlight-js/test/markup/clojure/hint_col.expect.txt @@ -0,0 +1,34 @@ +(import [java.lang.annotation Retention RetentionPolicy Target ElementType] + [javax.xml.ws WebServiceRef WebServiceRefs]) + +(definterface Foo (foo [])) + +;; annotation on type +(deftype ^{Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + Bar [^int a + ;; on field + ^{:tag int + Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + b] + ;; on method + Foo (^{Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + foo [this] 42)) + +(seq (.getAnnotations Bar)) +(seq (.getAnnotations (.getField Bar "b"))) +(seq (.getAnnotations (.getMethod Bar "foo" nil))) diff --git a/highlight-js/test/markup/clojure/hint_col.txt b/highlight-js/test/markup/clojure/hint_col.txt new file mode 100644 index 0000000..9584dec --- /dev/null +++ b/highlight-js/test/markup/clojure/hint_col.txt @@ -0,0 +1,34 @@ +(import [java.lang.annotation Retention RetentionPolicy Target ElementType] + [javax.xml.ws WebServiceRef WebServiceRefs]) + +(definterface Foo (foo [])) + +;; annotation on type +(deftype ^{Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + Bar [^int a + ;; on field + ^{:tag int + Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + b] + ;; on method + Foo (^{Deprecated true + Retention RetentionPolicy/RUNTIME + javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] + javax.xml.ws.soap.Addressing {:enabled false :required true} + WebServiceRefs [(WebServiceRef {:name "fred" :type String}) + (WebServiceRef {:name "ethel" :mappedName "lucy"})]} + foo [this] 42)) + +(seq (.getAnnotations Bar)) +(seq (.getAnnotations (.getField Bar "b"))) +(seq (.getAnnotations (.getMethod Bar "foo" nil))) diff --git a/highlight-js/test/markup/clojure/symbols-numbers.expect.txt b/highlight-js/test/markup/clojure/symbols-numbers.expect.txt new file mode 100644 index 0000000..f9c48b2 --- /dev/null +++ b/highlight-js/test/markup/clojure/symbols-numbers.expect.txt @@ -0,0 +1 @@ +(def +x [(a 1) +2 -3.0 y-5]) diff --git a/highlight-js/test/markup/clojure/symbols-numbers.txt b/highlight-js/test/markup/clojure/symbols-numbers.txt new file mode 100644 index 0000000..01e839b --- /dev/null +++ b/highlight-js/test/markup/clojure/symbols-numbers.txt @@ -0,0 +1 @@ +(def +x [(a 1) +2 -3.0 y-5]) diff --git a/highlight-js/test/markup/coffeescript/division.expect.txt b/highlight-js/test/markup/coffeescript/division.expect.txt new file mode 100644 index 0000000..28a9dfa --- /dev/null +++ b/highlight-js/test/markup/coffeescript/division.expect.txt @@ -0,0 +1,8 @@ +# Divisions +x = 6/foo/i +x = 6 /foo +x = 6 / foo +x = 6 /foo * 2/gm +x = f /foo +x = f / foo / gm +x = f /foo * 2/6 diff --git a/highlight-js/test/markup/coffeescript/division.txt b/highlight-js/test/markup/coffeescript/division.txt new file mode 100644 index 0000000..483fa56 --- /dev/null +++ b/highlight-js/test/markup/coffeescript/division.txt @@ -0,0 +1,8 @@ +# Divisions +x = 6/foo/i +x = 6 /foo +x = 6 / foo +x = 6 /foo * 2/gm +x = f /foo +x = f / foo / gm +x = f /foo * 2/6 diff --git a/highlight-js/test/markup/coffeescript/function.expect.txt b/highlight-js/test/markup/coffeescript/function.expect.txt new file mode 100644 index 0000000..0c4f8af --- /dev/null +++ b/highlight-js/test/markup/coffeescript/function.expect.txt @@ -0,0 +1,14 @@ +returnNull = -> null +returnTrue = () -> true +square = (x) -> x * x + +npmWishlist.sha256 = (str) -> + throw new Error() + +str.split(" ").map((m) -> m.charCodeAt(0)) + +fs.readFile("package.json", "utf-8", (err, content) -> + data = JSON.parse(content) + + data.version +) diff --git a/highlight-js/test/markup/coffeescript/function.txt b/highlight-js/test/markup/coffeescript/function.txt new file mode 100644 index 0000000..d76f3b9 --- /dev/null +++ b/highlight-js/test/markup/coffeescript/function.txt @@ -0,0 +1,14 @@ +returnNull = -> null +returnTrue = () -> true +square = (x) -> x * x + +npmWishlist.sha256 = (str) -> + throw new Error() + +str.split(" ").map((m) -> m.charCodeAt(0)) + +fs.readFile("package.json", "utf-8", (err, content) -> + data = JSON.parse(content) + + data.version +) diff --git a/highlight-js/test/markup/coffeescript/regex.expect.txt b/highlight-js/test/markup/coffeescript/regex.expect.txt new file mode 100644 index 0000000..51c3f9c --- /dev/null +++ b/highlight-js/test/markup/coffeescript/regex.expect.txt @@ -0,0 +1,8 @@ +# Regexps +x = /\// +x = /\n/ +x = /ab\/ ab/ +x = f /6 * 2/ - 3 +x = f /foo * 2/gm +x = if true then /\n/ else /[.,]+/ +x = ///^key-#{key}-\d+/// diff --git a/highlight-js/test/markup/coffeescript/regex.txt b/highlight-js/test/markup/coffeescript/regex.txt new file mode 100644 index 0000000..e62a0fc --- /dev/null +++ b/highlight-js/test/markup/coffeescript/regex.txt @@ -0,0 +1,8 @@ +# Regexps +x = /\// +x = /\n/ +x = /ab\/ ab/ +x = f /6 * 2/ - 3 +x = f /foo * 2/gm +x = if true then /\n/ else /[.,]+/ +x = ///^key-#{key}-\d+/// diff --git a/highlight-js/test/markup/cos/basic.expect.txt b/highlight-js/test/markup/cos/basic.expect.txt new file mode 100644 index 0000000..e26474f --- /dev/null +++ b/highlight-js/test/markup/cos/basic.expect.txt @@ -0,0 +1,7 @@ +SET test = 1 +set ^global = 2 +Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 +if (^global = 2) { + do ##class(Cinema.Utils).AddShow("test") // line comment +} +d:(^global = 2) ..thisClassMethod(1, 2, "test") diff --git a/highlight-js/test/markup/cos/basic.txt b/highlight-js/test/markup/cos/basic.txt new file mode 100644 index 0000000..97e0328 --- /dev/null +++ b/highlight-js/test/markup/cos/basic.txt @@ -0,0 +1,7 @@ +SET test = 1 +set ^global = 2 +Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 +if (^global = 2) { + do ##class(Cinema.Utils).AddShow("test") // line comment +} +d:(^global = 2) ..thisClassMethod(1, 2, "test") diff --git a/highlight-js/test/markup/cos/embedded.expect.txt b/highlight-js/test/markup/cos/embedded.expect.txt new file mode 100644 index 0000000..d070b70 --- /dev/null +++ b/highlight-js/test/markup/cos/embedded.expect.txt @@ -0,0 +1,5 @@ +/* + * Multiline comment + */ +&sql(SELECT * FROM Cinema.Film WHERE Length > 2) +&js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }> diff --git a/highlight-js/test/markup/cos/embedded.txt b/highlight-js/test/markup/cos/embedded.txt new file mode 100644 index 0000000..1f0c3e1 --- /dev/null +++ b/highlight-js/test/markup/cos/embedded.txt @@ -0,0 +1,5 @@ +/* + * Multiline comment + */ +&sql(SELECT * FROM Cinema.Film WHERE Length > 2) +&js diff --git a/highlight-js/test/markup/cpp/expression-keywords.expect.txt b/highlight-js/test/markup/cpp/expression-keywords.expect.txt new file mode 100644 index 0000000..4fb7c52 --- /dev/null +++ b/highlight-js/test/markup/cpp/expression-keywords.expect.txt @@ -0,0 +1,2 @@ +double x = exp(log(2)); // recognize built-ins +return 0; // recognize keyword that started the expression diff --git a/highlight-js/test/markup/cpp/expression-keywords.txt b/highlight-js/test/markup/cpp/expression-keywords.txt new file mode 100644 index 0000000..93b0cff --- /dev/null +++ b/highlight-js/test/markup/cpp/expression-keywords.txt @@ -0,0 +1,2 @@ +double x = exp(log(2)); // recognize built-ins +return 0; // recognize keyword that started the expression diff --git a/highlight-js/test/markup/cpp/function-params.expect.txt b/highlight-js/test/markup/cpp/function-params.expect.txt new file mode 100644 index 0000000..a388045 --- /dev/null +++ b/highlight-js/test/markup/cpp/function-params.expect.txt @@ -0,0 +1,7 @@ +int f( + int a = 1, + char* b = "2", // Line comment + double c = 3.0, /* Block comment */ + ARRAY(int, 5) d, + void* e __attribute__((unused)) +); diff --git a/highlight-js/test/markup/cpp/function-params.txt b/highlight-js/test/markup/cpp/function-params.txt new file mode 100644 index 0000000..6053675 --- /dev/null +++ b/highlight-js/test/markup/cpp/function-params.txt @@ -0,0 +1,7 @@ +int f( + int a = 1, + char* b = "2", // Line comment + double c = 3.0, /* Block comment */ + ARRAY(int, 5) d, + void* e __attribute__((unused)) +); diff --git a/highlight-js/test/markup/cpp/function-title.expect.txt b/highlight-js/test/markup/cpp/function-title.expect.txt new file mode 100644 index 0000000..750081e --- /dev/null +++ b/highlight-js/test/markup/cpp/function-title.expect.txt @@ -0,0 +1,9 @@ +int main() { + A a = new A(); + int b = b * sum(1, 2); + if (a->check1()) + return 3; + else if (a->check2()) + return 4; + return a->result(); +} diff --git a/highlight-js/test/markup/cpp/function-title.txt b/highlight-js/test/markup/cpp/function-title.txt new file mode 100644 index 0000000..74c810a --- /dev/null +++ b/highlight-js/test/markup/cpp/function-title.txt @@ -0,0 +1,9 @@ +int main() { + A a = new A(); + int b = b * sum(1, 2); + if (a->check1()) + return 3; + else if (a->check2()) + return 4; + return a->result(); +} diff --git a/highlight-js/test/markup/cpp/number-literals.expect.txt b/highlight-js/test/markup/cpp/number-literals.expect.txt new file mode 100644 index 0000000..09e2d5a --- /dev/null +++ b/highlight-js/test/markup/cpp/number-literals.expect.txt @@ -0,0 +1,6 @@ +/* digit separators */ +int number = 2'555'555'555; // digit separators +float exponentFloat = .123'456e3'000; // digit separators in floats +float suffixed = 3.000'001'234f // digit separators in suffixed numbers +char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars +float negative = -123.0f; // negative floating point numbers diff --git a/highlight-js/test/markup/cpp/number-literals.txt b/highlight-js/test/markup/cpp/number-literals.txt new file mode 100644 index 0000000..ec02e50 --- /dev/null +++ b/highlight-js/test/markup/cpp/number-literals.txt @@ -0,0 +1,6 @@ +/* digit separators */ +int number = 2'555'555'555; // digit separators +float exponentFloat = .123'456e3'000; // digit separators in floats +float suffixed = 3.000'001'234f // digit separators in suffixed numbers +char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars +float negative = -123.0f; // negative floating point numbers diff --git a/highlight-js/test/markup/cpp/pointers-returns.expect.txt b/highlight-js/test/markup/cpp/pointers-returns.expect.txt new file mode 100644 index 0000000..a2333fe --- /dev/null +++ b/highlight-js/test/markup/cpp/pointers-returns.expect.txt @@ -0,0 +1,4 @@ +// These will all work: +char** foo_bar(); +char ** foo_bar(); +char **foo_bar(); diff --git a/highlight-js/test/markup/cpp/pointers-returns.txt b/highlight-js/test/markup/cpp/pointers-returns.txt new file mode 100644 index 0000000..f56cc4a --- /dev/null +++ b/highlight-js/test/markup/cpp/pointers-returns.txt @@ -0,0 +1,4 @@ +// These will all work: +char** foo_bar(); +char ** foo_bar(); +char **foo_bar(); diff --git a/highlight-js/test/markup/cpp/preprocessor.expect.txt b/highlight-js/test/markup/cpp/preprocessor.expect.txt new file mode 100644 index 0000000..62fff51 --- /dev/null +++ b/highlight-js/test/markup/cpp/preprocessor.expect.txt @@ -0,0 +1,13 @@ +#include <iostream> +#define foo 1<<16 + +#ifdef DEBUG +TYPE1 foo(void) +#else +int foo(void) +#endif +{ } + +#define x(v) ((v)) +# define x(v) ((v)) +# define x(v) ((v)) diff --git a/highlight-js/test/markup/cpp/preprocessor.txt b/highlight-js/test/markup/cpp/preprocessor.txt new file mode 100644 index 0000000..b1ad6a6 --- /dev/null +++ b/highlight-js/test/markup/cpp/preprocessor.txt @@ -0,0 +1,13 @@ +#include +#define foo 1<<16 + +#ifdef DEBUG +TYPE1 foo(void) +#else +int foo(void) +#endif +{ } + +#define x(v) ((v)) +# define x(v) ((v)) +# define x(v) ((v)) diff --git a/highlight-js/test/markup/cpp/primitive-types.expect.txt b/highlight-js/test/markup/cpp/primitive-types.expect.txt new file mode 100644 index 0000000..1ab0047 --- /dev/null +++ b/highlight-js/test/markup/cpp/primitive-types.expect.txt @@ -0,0 +1,3 @@ +const uint64_t MAX_INT_64; + +struct position_tag; diff --git a/highlight-js/test/markup/cpp/primitive-types.txt b/highlight-js/test/markup/cpp/primitive-types.txt new file mode 100644 index 0000000..86f1167 --- /dev/null +++ b/highlight-js/test/markup/cpp/primitive-types.txt @@ -0,0 +1,3 @@ +const uint64_t MAX_INT_64; + +struct position_tag; diff --git a/highlight-js/test/markup/cpp/string-literals.expect.txt b/highlight-js/test/markup/cpp/string-literals.expect.txt new file mode 100644 index 0000000..1210b01 --- /dev/null +++ b/highlight-js/test/markup/cpp/string-literals.expect.txt @@ -0,0 +1,30 @@ +// Unicode literals +auto str = "Hello regular string"; +auto utf8 = u8"Hello utf-8 string"; +auto utf16 = u"Hello utf-16 string"; +auto utf32 = U"Hello utf-32 string"; + +// Wide-character strings +auto wide_char = L"Hello wchar_t string"; + +// Raw string literals (multiline) +auto char_multi = R"(Hello +"normal" +muliline +string.)"; +auto utf8_multi = u8R"(Hello +"utf-8" +muliline +string)"; +auto utf16_multi = uR"(Hello +"utf-16" +muliline +string)"; +auto utf32_multi = UR"(Hello +"utf-32" +muliline +string)"; + +// Meta strings +#include <stdio> +#include "lib.h" diff --git a/highlight-js/test/markup/cpp/string-literals.txt b/highlight-js/test/markup/cpp/string-literals.txt new file mode 100644 index 0000000..68b8bd4 --- /dev/null +++ b/highlight-js/test/markup/cpp/string-literals.txt @@ -0,0 +1,30 @@ +// Unicode literals +auto str = "Hello regular string"; +auto utf8 = u8"Hello utf-8 string"; +auto utf16 = u"Hello utf-16 string"; +auto utf32 = U"Hello utf-32 string"; + +// Wide-character strings +auto wide_char = L"Hello wchar_t string"; + +// Raw string literals (multiline) +auto char_multi = R"(Hello +"normal" +muliline +string.)"; +auto utf8_multi = u8R"(Hello +"utf-8" +muliline +string)"; +auto utf16_multi = uR"(Hello +"utf-16" +muliline +string)"; +auto utf32_multi = UR"(Hello +"utf-32" +muliline +string)"; + +// Meta strings +#include +#include "lib.h" diff --git a/highlight-js/test/markup/crystal/literals.expect.txt b/highlight-js/test/markup/crystal/literals.expect.txt new file mode 100644 index 0000000..46d8aef --- /dev/null +++ b/highlight-js/test/markup/crystal/literals.expect.txt @@ -0,0 +1,98 @@ +nil +true +false + +1 + +1_i8 +1_i16 +1_i32 +1_i64 +1_i128 + +1_u8 +1_u16 +1_u32 +1_u64 + ++10 +-20 + +2147483648 +9223372036854775808 + +1_000_000 + +0b1101 + +0o123 + +0xFE012D +0xfe012d + +1_f64 +1.0 +1.0_f32 +1_f32 + +1e10 +1e10_f64 +1.5e10 +1.5e-7 + ++1.3 +-0.5 + +1_000_000.111_111 +1_000_000.111_111e12 + +'c' +'\\' +'\u{ABCD}' + +"string" +"\u{48 45 4C 4C 4F}" +"interpolated #{string}" +"interpolated #{"string"}" +%(string) +%q(string) +%Q(string) +%(hello ("world")) +%[hello ["world"]] +%{hello {"world"}} +%<hello <"world">> +%|hello "world"| +"hello + world" +"hello \ + world, \ + no newlines" +<<-STRING + Hello world + STRING + +<<-'HERE' + hello \n + HERE + +:unquoted_symbol +:"quoted symbol" +:question? +:exclamation! +:+ + +%i(foo(bar) baz) +%w(one two three) + +/foo|bar/ +/h(e+)llo/ +/\d+/ +/あ/ + +%r((/)) +%r[[/]] +%r{{/}} +%r<</>> +%r|/| + +`echo foo > foo.txt` diff --git a/highlight-js/test/markup/crystal/literals.txt b/highlight-js/test/markup/crystal/literals.txt new file mode 100644 index 0000000..9de2fed --- /dev/null +++ b/highlight-js/test/markup/crystal/literals.txt @@ -0,0 +1,98 @@ +nil +true +false + +1 + +1_i8 +1_i16 +1_i32 +1_i64 +1_i128 + +1_u8 +1_u16 +1_u32 +1_u64 + ++10 +-20 + +2147483648 +9223372036854775808 + +1_000_000 + +0b1101 + +0o123 + +0xFE012D +0xfe012d + +1_f64 +1.0 +1.0_f32 +1_f32 + +1e10 +1e10_f64 +1.5e10 +1.5e-7 + ++1.3 +-0.5 + +1_000_000.111_111 +1_000_000.111_111e12 + +'c' +'\\' +'\u{ABCD}' + +"string" +"\u{48 45 4C 4C 4F}" +"interpolated #{string}" +"interpolated #{"string"}" +%(string) +%q(string) +%Q(string) +%(hello ("world")) +%[hello ["world"]] +%{hello {"world"}} +%> +%|hello "world"| +"hello + world" +"hello \ + world, \ + no newlines" +<<-STRING + Hello world + STRING + +<<-'HERE' + hello \n + HERE + +:unquoted_symbol +:"quoted symbol" +:question? +:exclamation! +:+ + +%i(foo(bar) baz) +%w(one two three) + +/foo|bar/ +/h(e+)llo/ +/\d+/ +/あ/ + +%r((/)) +%r[[/]] +%r{{/}} +%r<> +%r|/| + +`echo foo > foo.txt` diff --git a/highlight-js/test/markup/crystal/macro.expect.txt b/highlight-js/test/markup/crystal/macro.expect.txt new file mode 100644 index 0000000..38b2447 --- /dev/null +++ b/highlight-js/test/markup/crystal/macro.expect.txt @@ -0,0 +1,9 @@ +puts {{ "hello world" }} + +{% verbatim %}{{ "bla".id }}{% end %} + +macro foo + {% verbatim %} + {{ "bla".id }} + {% end %} +end diff --git a/highlight-js/test/markup/crystal/macro.txt b/highlight-js/test/markup/crystal/macro.txt new file mode 100644 index 0000000..1039545 --- /dev/null +++ b/highlight-js/test/markup/crystal/macro.txt @@ -0,0 +1,9 @@ +puts {{ "hello world" }} + +{% verbatim %}{{ "bla".id }}{% end %} + +macro foo + {% verbatim %} + {{ "bla".id }} + {% end %} +end diff --git a/highlight-js/test/markup/crystal/operators.expect.txt b/highlight-js/test/markup/crystal/operators.expect.txt new file mode 100644 index 0000000..cd70109 --- /dev/null +++ b/highlight-js/test/markup/crystal/operators.expect.txt @@ -0,0 +1,34 @@ ++ +- +* +% +& +| +^ +** +<< +>> +== +!= +< +<= +> +>= +<=> +=== +// +//= +&+ +&- +&* +&** +&+= +&-= +&*= +! +~ +[] +[]? +[]= +/ + diff --git a/highlight-js/test/markup/crystal/operators.txt b/highlight-js/test/markup/crystal/operators.txt new file mode 100644 index 0000000..80bac44 --- /dev/null +++ b/highlight-js/test/markup/crystal/operators.txt @@ -0,0 +1,33 @@ ++ +- +* +% +& +| +^ +** +<< +>> +== +!= +< +<= +> +>= +<=> +=== +// +//= +&+ +&- +&* +&** +&+= +&-= +&*= +! +~ +[] +[]? +[]= +/ diff --git a/highlight-js/test/markup/crystal/regexes.expect.txt b/highlight-js/test/markup/crystal/regexes.expect.txt new file mode 100644 index 0000000..5c93fd3 --- /dev/null +++ b/highlight-js/test/markup/crystal/regexes.expect.txt @@ -0,0 +1,12 @@ +if /foo/ +unless /foo/ +case /foo/ +select /foo/ +when /foo/ +while /foo/ +until /foo/ ++/foo/ + +# NG +xif /foo/ +ifx /foo/ diff --git a/highlight-js/test/markup/crystal/regexes.txt b/highlight-js/test/markup/crystal/regexes.txt new file mode 100644 index 0000000..409627a --- /dev/null +++ b/highlight-js/test/markup/crystal/regexes.txt @@ -0,0 +1,12 @@ +if /foo/ +unless /foo/ +case /foo/ +select /foo/ +when /foo/ +while /foo/ +until /foo/ ++/foo/ + +# NG +xif /foo/ +ifx /foo/ diff --git a/highlight-js/test/markup/crystal/toplevel-keywords.expect.txt b/highlight-js/test/markup/crystal/toplevel-keywords.expect.txt new file mode 100644 index 0000000..7583a10 --- /dev/null +++ b/highlight-js/test/markup/crystal/toplevel-keywords.expect.txt @@ -0,0 +1,4 @@ +class Foo; end +struct Bar; end + +annotation JSON::Field; end diff --git a/highlight-js/test/markup/crystal/toplevel-keywords.txt b/highlight-js/test/markup/crystal/toplevel-keywords.txt new file mode 100644 index 0000000..4ca49d4 --- /dev/null +++ b/highlight-js/test/markup/crystal/toplevel-keywords.txt @@ -0,0 +1,4 @@ +class Foo; end +struct Bar; end + +annotation JSON::Field; end diff --git a/highlight-js/test/markup/cs/dotted-namespace.expect.txt b/highlight-js/test/markup/cs/dotted-namespace.expect.txt new file mode 100644 index 0000000..96108bd --- /dev/null +++ b/highlight-js/test/markup/cs/dotted-namespace.expect.txt @@ -0,0 +1,6 @@ +namespace Dotted.Namespace +{ + class MyClass + { + } +} diff --git a/highlight-js/test/markup/cs/dotted-namespace.txt b/highlight-js/test/markup/cs/dotted-namespace.txt new file mode 100644 index 0000000..68356f8 --- /dev/null +++ b/highlight-js/test/markup/cs/dotted-namespace.txt @@ -0,0 +1,6 @@ +namespace Dotted.Namespace +{ + class MyClass + { + } +} diff --git a/highlight-js/test/markup/cs/floats.expect.txt b/highlight-js/test/markup/cs/floats.expect.txt new file mode 100644 index 0000000..7935858 --- /dev/null +++ b/highlight-js/test/markup/cs/floats.expect.txt @@ -0,0 +1,4 @@ +float test = 1.0f; +float test2 = 1.f; +float test3 = 1.0; +float test4 = 1; \ No newline at end of file diff --git a/highlight-js/test/markup/cs/floats.txt b/highlight-js/test/markup/cs/floats.txt new file mode 100644 index 0000000..777bfc9 --- /dev/null +++ b/highlight-js/test/markup/cs/floats.txt @@ -0,0 +1,4 @@ +float test = 1.0f; +float test2 = 1.f; +float test3 = 1.0; +float test4 = 1; \ No newline at end of file diff --git a/highlight-js/test/markup/cs/functions.expect.txt b/highlight-js/test/markup/cs/functions.expect.txt new file mode 100644 index 0000000..7546f94 --- /dev/null +++ b/highlight-js/test/markup/cs/functions.expect.txt @@ -0,0 +1,16 @@ +public void ExampleFunction1() { +} + +public void ExampleFunction2() +{ +} + +void ExampleFunctionDeclaration1(); + +void ExampleFunctionDeclaration2() +; + +public string ExampleExpressionBodiedFunction1() => "dummy"; + +public string ExampleExpressionBodiedFunction2() + => "dummy"; \ No newline at end of file diff --git a/highlight-js/test/markup/cs/functions.txt b/highlight-js/test/markup/cs/functions.txt new file mode 100644 index 0000000..e370c2a --- /dev/null +++ b/highlight-js/test/markup/cs/functions.txt @@ -0,0 +1,16 @@ +public void ExampleFunction1() { +} + +public void ExampleFunction2() +{ +} + +void ExampleFunctionDeclaration1(); + +void ExampleFunctionDeclaration2() +; + +public string ExampleExpressionBodiedFunction1() => "dummy"; + +public string ExampleExpressionBodiedFunction2() + => "dummy"; \ No newline at end of file diff --git a/highlight-js/test/markup/cs/string-interpolation.expect.txt b/highlight-js/test/markup/cs/string-interpolation.expect.txt new file mode 100644 index 0000000..65e754a --- /dev/null +++ b/highlight-js/test/markup/cs/string-interpolation.expect.txt @@ -0,0 +1,9 @@ +var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; +var ivstr = $@"{{Hello}}, +{ +$"\"{nested}\"" + @" +and +" + $@" +""{nested}"" +" +/*comments*/ }"; diff --git a/highlight-js/test/markup/cs/string-interpolation.txt b/highlight-js/test/markup/cs/string-interpolation.txt new file mode 100644 index 0000000..42e1e95 --- /dev/null +++ b/highlight-js/test/markup/cs/string-interpolation.txt @@ -0,0 +1,9 @@ +var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; +var ivstr = $@"{{Hello}}, +{ +$"\"{nested}\"" + @" +and +" + $@" +""{nested}"" +" +/*comments*/ }"; diff --git a/highlight-js/test/markup/cs/titles.expect.txt b/highlight-js/test/markup/cs/titles.expect.txt new file mode 100644 index 0000000..185cb34 --- /dev/null +++ b/highlight-js/test/markup/cs/titles.expect.txt @@ -0,0 +1,19 @@ +namespace Foo // namespace +{ + public class Greet : Base, Other // class + { + public Greet(string who) // function + { + Who = who; + } + + int[] f(int val = 0) + { + new Type(); + return getType(); + throw getError(); + await Stuff(); + } + } + +} diff --git a/highlight-js/test/markup/cs/titles.txt b/highlight-js/test/markup/cs/titles.txt new file mode 100644 index 0000000..ee1d815 --- /dev/null +++ b/highlight-js/test/markup/cs/titles.txt @@ -0,0 +1,19 @@ +namespace Foo // namespace +{ + public class Greet : Base, Other // class + { + public Greet(string who) // function + { + Who = who; + } + + int[] f(int val = 0) + { + new Type(); + return getType(); + throw getError(); + await Stuff(); + } + } + +} diff --git a/highlight-js/test/markup/css/pseudo-selector.expect.txt b/highlight-js/test/markup/css/pseudo-selector.expect.txt new file mode 100644 index 0000000..0749771 --- /dev/null +++ b/highlight-js/test/markup/css/pseudo-selector.expect.txt @@ -0,0 +1,2 @@ +li:not(.red){} +li:not(.red):not(.green){} diff --git a/highlight-js/test/markup/css/pseudo-selector.txt b/highlight-js/test/markup/css/pseudo-selector.txt new file mode 100644 index 0000000..4508da1 --- /dev/null +++ b/highlight-js/test/markup/css/pseudo-selector.txt @@ -0,0 +1,2 @@ +li:not(.red){} +li:not(.red):not(.green){} diff --git a/highlight-js/test/markup/css/url.expect.txt b/highlight-js/test/markup/css/url.expect.txt new file mode 100644 index 0000000..b9ca8ff --- /dev/null +++ b/highlight-js/test/markup/css/url.expect.txt @@ -0,0 +1,6 @@ +div { background: url("foo/bar/baz.jpg") } +div { background: url('foo/bar/baz.jpg') } +div { background: url(foo/bar/baz.jpg) } +div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } +div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } +div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } diff --git a/highlight-js/test/markup/css/url.txt b/highlight-js/test/markup/css/url.txt new file mode 100644 index 0000000..7a91d04 --- /dev/null +++ b/highlight-js/test/markup/css/url.txt @@ -0,0 +1,6 @@ +div { background: url("foo/bar/baz.jpg") } +div { background: url('foo/bar/baz.jpg') } +div { background: url(foo/bar/baz.jpg) } +div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } +div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } +div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } \ No newline at end of file diff --git a/highlight-js/test/markup/delphi/compiler-directive.expect.txt b/highlight-js/test/markup/delphi/compiler-directive.expect.txt new file mode 100644 index 0000000..e3ad344 --- /dev/null +++ b/highlight-js/test/markup/delphi/compiler-directive.expect.txt @@ -0,0 +1,4 @@ +{ Compiler directives } +{$I} (*$I*) +procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); +begin end; diff --git a/highlight-js/test/markup/delphi/compiler-directive.txt b/highlight-js/test/markup/delphi/compiler-directive.txt new file mode 100644 index 0000000..c62b1a2 --- /dev/null +++ b/highlight-js/test/markup/delphi/compiler-directive.txt @@ -0,0 +1,4 @@ +{ Compiler directives } +{$I} (*$I*) +procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); +begin end; diff --git a/highlight-js/test/markup/diff/comments.expect.txt b/highlight-js/test/markup/diff/comments.expect.txt new file mode 100644 index 0000000..5477ae7 --- /dev/null +++ b/highlight-js/test/markup/diff/comments.expect.txt @@ -0,0 +1,10 @@ +Index: languages/demo.js +=================================================================== +--- languages/demo.js (revision 199) ++++ languages/demo.js (revision 200) +@@ -1,8 +1,7 @@ ++ Here we highlight correctly +==== ++ Here too +===== ++ Here we don't anymore after five '=' next to each other diff --git a/highlight-js/test/markup/diff/comments.txt b/highlight-js/test/markup/diff/comments.txt new file mode 100644 index 0000000..f79bb67 --- /dev/null +++ b/highlight-js/test/markup/diff/comments.txt @@ -0,0 +1,10 @@ +Index: languages/demo.js +=================================================================== +--- languages/demo.js (revision 199) ++++ languages/demo.js (revision 200) +@@ -1,8 +1,7 @@ ++ Here we highlight correctly +==== ++ Here too +===== ++ Here we don't anymore after five '=' next to each other diff --git a/highlight-js/test/markup/dockerfile/default.expect.txt b/highlight-js/test/markup/dockerfile/default.expect.txt new file mode 100644 index 0000000..3d7b03d --- /dev/null +++ b/highlight-js/test/markup/dockerfile/default.expect.txt @@ -0,0 +1,23 @@ +FROM ubuntu + +MAINTAINER laurent@docker.com + +ARG debug=0 + +COPY www.conf /etc/php5/fpm/pool.d/ + +RUN apt-get update \ + && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql +RUN mkdir /tmp/sessions + +ENV APPLICATION_ENV dev + +USER www-data + +EXPOSE 80 + +VOLUME ["/var/www/html"] + +WORKDIR "/var/www/html" + +CMD [ "/usr/sbin/php5-fpm", "-F" ] diff --git a/highlight-js/test/markup/dockerfile/default.txt b/highlight-js/test/markup/dockerfile/default.txt new file mode 100644 index 0000000..bfeeaef --- /dev/null +++ b/highlight-js/test/markup/dockerfile/default.txt @@ -0,0 +1,23 @@ +FROM ubuntu + +MAINTAINER laurent@docker.com + +ARG debug=0 + +COPY www.conf /etc/php5/fpm/pool.d/ + +RUN apt-get update \ + && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql +RUN mkdir /tmp/sessions + +ENV APPLICATION_ENV dev + +USER www-data + +EXPOSE 80 + +VOLUME ["/var/www/html"] + +WORKDIR "/var/www/html" + +CMD [ "/usr/sbin/php5-fpm", "-F" ] diff --git a/highlight-js/test/markup/dos/comments.expect.txt b/highlight-js/test/markup/dos/comments.expect.txt new file mode 100644 index 0000000..3f00626 --- /dev/null +++ b/highlight-js/test/markup/dos/comments.expect.txt @@ -0,0 +1,3 @@ +rem comment + rem comment +copy a.txt b.txt > rem not_a_comment diff --git a/highlight-js/test/markup/dos/comments.txt b/highlight-js/test/markup/dos/comments.txt new file mode 100644 index 0000000..6456884 --- /dev/null +++ b/highlight-js/test/markup/dos/comments.txt @@ -0,0 +1,3 @@ +rem comment + rem comment +copy a.txt b.txt > rem not_a_comment diff --git a/highlight-js/test/markup/dsconfig/default.expect.txt b/highlight-js/test/markup/dsconfig/default.expect.txt new file mode 100644 index 0000000..cfb2fba --- /dev/null +++ b/highlight-js/test/markup/dsconfig/default.expect.txt @@ -0,0 +1,24 @@ +# Quoted and unquoted properties +dsconfig create-client-connection-policy \ + --policy-name "Restrictive Client Connection Policy" \ + --set "description:Restrictive Client Connection Policy" \ + --set enabled:true --set evaluation-order-index:1000 \ + --set "connection-criteria:User.0 Connection Criteria" \ + --set maximum-concurrent-connections:2 \ + --set "maximum-connection-duration:1 s" \ + --set "maximum-idle-connection-duration:1 s" \ + --set maximum-operation-count-per-connection:1000 +# dsconfig keyword is optional +create-client-connection-policy \ + --policy-name "Another Client Connection Policy" \ + --set enabled:true --set evaluation-order-index:100 \ + --set 'connection-criteria:User.1 Connection Criteria' \ +# Property without value + --reset maximum-concurrent-connections +# Unquoted property, quoted property value +dsconfig set-access-control-handler-prop \ + --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' +# No continuation +dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" diff --git a/highlight-js/test/markup/dsconfig/default.txt b/highlight-js/test/markup/dsconfig/default.txt new file mode 100644 index 0000000..430bda6 --- /dev/null +++ b/highlight-js/test/markup/dsconfig/default.txt @@ -0,0 +1,24 @@ +# Quoted and unquoted properties +dsconfig create-client-connection-policy \ + --policy-name "Restrictive Client Connection Policy" \ + --set "description:Restrictive Client Connection Policy" \ + --set enabled:true --set evaluation-order-index:1000 \ + --set "connection-criteria:User.0 Connection Criteria" \ + --set maximum-concurrent-connections:2 \ + --set "maximum-connection-duration:1 s" \ + --set "maximum-idle-connection-duration:1 s" \ + --set maximum-operation-count-per-connection:1000 +# dsconfig keyword is optional +create-client-connection-policy \ + --policy-name "Another Client Connection Policy" \ + --set enabled:true --set evaluation-order-index:100 \ + --set 'connection-criteria:User.1 Connection Criteria' \ +# Property without value + --reset maximum-concurrent-connections +# Unquoted property, quoted property value +dsconfig set-access-control-handler-prop \ + --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ + --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' +# No continuation +dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" diff --git a/highlight-js/test/markup/elixir/function-title.expect.txt b/highlight-js/test/markup/elixir/function-title.expect.txt new file mode 100644 index 0000000..c4d01de --- /dev/null +++ b/highlight-js/test/markup/elixir/function-title.expect.txt @@ -0,0 +1,15 @@ +def f do + :ok +end + +def f(list) do + :ok +end + +def f :clear, list do + :ok +end + +def f!, do: IO.puts "hello world" + +x = 5 diff --git a/highlight-js/test/markup/elixir/function-title.txt b/highlight-js/test/markup/elixir/function-title.txt new file mode 100644 index 0000000..9f950a6 --- /dev/null +++ b/highlight-js/test/markup/elixir/function-title.txt @@ -0,0 +1,15 @@ +def f do + :ok +end + +def f(list) do + :ok +end + +def f :clear, list do + :ok +end + +def f!, do: IO.puts "hello world" + +x = 5 diff --git a/highlight-js/test/markup/excel/comments.expect.txt b/highlight-js/test/markup/excel/comments.expect.txt new file mode 100644 index 0000000..596c4f2 --- /dev/null +++ b/highlight-js/test/markup/excel/comments.expect.txt @@ -0,0 +1 @@ +=(N4 + N5)*0.055 + N("This is a comment.") diff --git a/highlight-js/test/markup/excel/comments.txt b/highlight-js/test/markup/excel/comments.txt new file mode 100644 index 0000000..ab6e3db --- /dev/null +++ b/highlight-js/test/markup/excel/comments.txt @@ -0,0 +1 @@ +=(N4 + N5)*0.055 + N("This is a comment.") diff --git a/highlight-js/test/markup/fortran/numbers.expect.txt b/highlight-js/test/markup/fortran/numbers.expect.txt new file mode 100644 index 0000000..f90b246 --- /dev/null +++ b/highlight-js/test/markup/fortran/numbers.expect.txt @@ -0,0 +1,15 @@ +1.d0 +-1.d0 +1.d-5 +-1.D5 +342.e+12 +12. +12 +.23 +-.23 +1.E4 +1E4 +1D-4 +var1 +va1r +mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4))) \ No newline at end of file diff --git a/highlight-js/test/markup/fortran/numbers.txt b/highlight-js/test/markup/fortran/numbers.txt new file mode 100644 index 0000000..49ad3bb --- /dev/null +++ b/highlight-js/test/markup/fortran/numbers.txt @@ -0,0 +1,15 @@ +1.d0 +-1.d0 +1.d-5 +-1.D5 +342.e+12 +12. +12 +.23 +-.23 +1.E4 +1E4 +1D-4 +var1 +va1r +mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4))) \ No newline at end of file diff --git a/highlight-js/test/markup/fsharp/bang-keywords.expect.txt b/highlight-js/test/markup/fsharp/bang-keywords.expect.txt new file mode 100644 index 0000000..9aff5df --- /dev/null +++ b/highlight-js/test/markup/fsharp/bang-keywords.expect.txt @@ -0,0 +1 @@ +let! (result2 : byte[]) = stream.AsyncRead(bufferSize) diff --git a/highlight-js/test/markup/fsharp/bang-keywords.txt b/highlight-js/test/markup/fsharp/bang-keywords.txt new file mode 100644 index 0000000..5824ca8 --- /dev/null +++ b/highlight-js/test/markup/fsharp/bang-keywords.txt @@ -0,0 +1 @@ +let! (result2 : byte[]) = stream.AsyncRead(bufferSize) diff --git a/highlight-js/test/markup/gauss/function_defs.expect.txt b/highlight-js/test/markup/gauss/function_defs.expect.txt new file mode 100644 index 0000000..5203af0 --- /dev/null +++ b/highlight-js/test/markup/gauss/function_defs.expect.txt @@ -0,0 +1,7 @@ +proc (1) = foo(if, endif, 10); +proc foo; +proc (1) = calc(local__row, fin, ...); +fn /* inline */ twopi=pi*2; +fn _n_pi(n /* inline comment */) = pi*n; +keyword add(str, struct plotControl myPlot); +keyword sub; diff --git a/highlight-js/test/markup/gauss/function_defs.txt b/highlight-js/test/markup/gauss/function_defs.txt new file mode 100644 index 0000000..401af60 --- /dev/null +++ b/highlight-js/test/markup/gauss/function_defs.txt @@ -0,0 +1,7 @@ +proc (1) = foo(if, endif, 10); +proc foo; +proc (1) = calc(local__row, fin, ...); +fn /* inline */ twopi=pi*2; +fn _n_pi(n /* inline comment */) = pi*n; +keyword add(str, struct plotControl myPlot); +keyword sub; diff --git a/highlight-js/test/markup/gauss/function_refs.expect.txt b/highlight-js/test/markup/gauss/function_refs.expect.txt new file mode 100644 index 0000000..795eb54 --- /dev/null +++ b/highlight-js/test/markup/gauss/function_refs.expect.txt @@ -0,0 +1,5 @@ +k = colsf(fin); +nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); +call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); +ols("", csvReadM("test.csv")); +if myfn(10) == 20; diff --git a/highlight-js/test/markup/gauss/function_refs.txt b/highlight-js/test/markup/gauss/function_refs.txt new file mode 100644 index 0000000..d87911d --- /dev/null +++ b/highlight-js/test/markup/gauss/function_refs.txt @@ -0,0 +1,5 @@ +k = colsf(fin); +nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); +call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); +ols("", csvReadM("test.csv")); +if myfn(10) == 20; diff --git a/highlight-js/test/markup/gauss/keywords.expect.txt b/highlight-js/test/markup/gauss/keywords.expect.txt new file mode 100644 index 0000000..b02f6ef --- /dev/null +++ b/highlight-js/test/markup/gauss/keywords.expect.txt @@ -0,0 +1,7 @@ +for i(start, stop, bar(5)); +if (i-1 % 5 == 0 .and some_flag); +elseif i % 2 .eqv 0; +external string _olsrnam; +external proc indices2,indexcat; +myPlot.axes.and.for.if.endif.text = "hey"; +local f:proc; diff --git a/highlight-js/test/markup/gauss/keywords.txt b/highlight-js/test/markup/gauss/keywords.txt new file mode 100644 index 0000000..a39a18f --- /dev/null +++ b/highlight-js/test/markup/gauss/keywords.txt @@ -0,0 +1,7 @@ +for i(start, stop, bar(5)); +if (i-1 % 5 == 0 .and some_flag); +elseif i % 2 .eqv 0; +external string _olsrnam; +external proc indices2,indexcat; +myPlot.axes.and.for.if.endif.text = "hey"; +local f:proc; diff --git a/highlight-js/test/markup/go/numbers.expect.txt b/highlight-js/test/markup/go/numbers.expect.txt new file mode 100644 index 0000000..c7d4d2a --- /dev/null +++ b/highlight-js/test/markup/go/numbers.expect.txt @@ -0,0 +1,2 @@ +float_var := 1.0e10f +complex_var := 1.2e5+2.3i \ No newline at end of file diff --git a/highlight-js/test/markup/go/numbers.txt b/highlight-js/test/markup/go/numbers.txt new file mode 100644 index 0000000..f3b4a79 --- /dev/null +++ b/highlight-js/test/markup/go/numbers.txt @@ -0,0 +1,2 @@ +float_var := 1.0e10f +complex_var := 1.2e5+2.3i \ No newline at end of file diff --git a/highlight-js/test/markup/golo/default.expect.txt b/highlight-js/test/markup/golo/default.expect.txt new file mode 100644 index 0000000..7492208 --- /dev/null +++ b/highlight-js/test/markup/golo/default.expect.txt @@ -0,0 +1,15 @@ +module hello + +function dyno = -> DynamicObject() + +struct human = { name } + +@annotated +function main = |args| { + let a = 1 + var b = 2 + + println("hello") + + let john = human("John Doe") +} diff --git a/highlight-js/test/markup/golo/default.txt b/highlight-js/test/markup/golo/default.txt new file mode 100644 index 0000000..0c0f62c --- /dev/null +++ b/highlight-js/test/markup/golo/default.txt @@ -0,0 +1,15 @@ +module hello + +function dyno = -> DynamicObject() + +struct human = { name } + +@annotated +function main = |args| { + let a = 1 + var b = 2 + + println("hello") + + let john = human("John Doe") +} diff --git a/highlight-js/test/markup/haskell/infix.expect.txt b/highlight-js/test/markup/haskell/infix.expect.txt new file mode 100644 index 0000000..0ce07f7 --- /dev/null +++ b/highlight-js/test/markup/haskell/infix.expect.txt @@ -0,0 +1,3 @@ +infix 3 `foo` +infixl 6 `bar` +infixr 9 `baz` diff --git a/highlight-js/test/markup/haskell/infix.txt b/highlight-js/test/markup/haskell/infix.txt new file mode 100644 index 0000000..55f679a --- /dev/null +++ b/highlight-js/test/markup/haskell/infix.txt @@ -0,0 +1,3 @@ +infix 3 `foo` +infixl 6 `bar` +infixr 9 `baz` diff --git a/highlight-js/test/markup/haskell/nested-comments.expect.txt b/highlight-js/test/markup/haskell/nested-comments.expect.txt new file mode 100644 index 0000000..564c142 --- /dev/null +++ b/highlight-js/test/markup/haskell/nested-comments.expect.txt @@ -0,0 +1 @@ +{- this is a {- nested -} comment -} diff --git a/highlight-js/test/markup/haskell/nested-comments.txt b/highlight-js/test/markup/haskell/nested-comments.txt new file mode 100644 index 0000000..b716623 --- /dev/null +++ b/highlight-js/test/markup/haskell/nested-comments.txt @@ -0,0 +1 @@ +{- this is a {- nested -} comment -} diff --git a/highlight-js/test/markup/http/default.expect.txt b/highlight-js/test/markup/http/default.expect.txt new file mode 100644 index 0000000..dafe8dc --- /dev/null +++ b/highlight-js/test/markup/http/default.expect.txt @@ -0,0 +1,7 @@ +POST /task?id=1 HTTP/1.1 +Host: example.org +Content-Type: application/json; charset=utf-8 +Content-Length: 19 + +{"status": "ok", "extended": true} + diff --git a/highlight-js/test/markup/http/default.txt b/highlight-js/test/markup/http/default.txt new file mode 100644 index 0000000..34631a1 --- /dev/null +++ b/highlight-js/test/markup/http/default.txt @@ -0,0 +1,6 @@ +POST /task?id=1 HTTP/1.1 +Host: example.org +Content-Type: application/json; charset=utf-8 +Content-Length: 19 + +{"status": "ok", "extended": true} diff --git a/highlight-js/test/markup/index.js b/highlight-js/test/markup/index.js new file mode 100644 index 0000000..e80fedc --- /dev/null +++ b/highlight-js/test/markup/index.js @@ -0,0 +1,39 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let fs = bluebird.promisifyAll(require('fs')); +let glob = require('glob'); +let hljs = require('../../build'); +let path = require('path'); +let utility = require('../utility'); + +function testLanguage(language) { + describe(language, function() { + const filePath = utility.buildPath('markup', language, '*.expect.txt'), + filenames = glob.sync(filePath); + + _.each(filenames, function(filename) { + const testName = path.basename(filename, '.expect.txt'), + sourceName = filename.replace(/\.expect/, ''); + + it(`should markup ${testName}`, function(done) { + const sourceFile = fs.readFileAsync(sourceName, 'utf-8'), + expectedFile = fs.readFileAsync(filename, 'utf-8'); + + bluebird.join(sourceFile, expectedFile, function(source, expected) { + const actual = hljs.highlight(language, source).value; + + actual.trim().should.equal(expected.trim()); + done(); + }); + }); + }); + }); +} + +describe('hljs.highlight()', function() { + let markupPath = utility.buildPath('markup'); + + return fs.readdirAsync(markupPath).each(testLanguage); +}); diff --git a/highlight-js/test/markup/java/gh1031.expect.txt b/highlight-js/test/markup/java/gh1031.expect.txt new file mode 100644 index 0000000..43879d3 --- /dev/null +++ b/highlight-js/test/markup/java/gh1031.expect.txt @@ -0,0 +1,7 @@ +public class DefaultDataDaoImpl { + private List<AbstractCmrDataProcessor> cmrDataProcessors; +} + +public class DefaultDataDaoImpl { + private List<AbstractCmrDataProcessor, AbstractCmrDataProcessor> cmrDataProcessors; +} diff --git a/highlight-js/test/markup/java/gh1031.txt b/highlight-js/test/markup/java/gh1031.txt new file mode 100644 index 0000000..2e7e2e1 --- /dev/null +++ b/highlight-js/test/markup/java/gh1031.txt @@ -0,0 +1,7 @@ +public class DefaultDataDaoImpl { + private List cmrDataProcessors; +} + +public class DefaultDataDaoImpl { + private List cmrDataProcessors; +} diff --git a/highlight-js/test/markup/java/numbers.expect.txt b/highlight-js/test/markup/java/numbers.expect.txt new file mode 100644 index 0000000..713579c --- /dev/null +++ b/highlight-js/test/markup/java/numbers.expect.txt @@ -0,0 +1,9 @@ +long creditCardNumber = 1234_5678_9012_3456L; +long socialSecurityNumber = 999_99_9999L; +float pi = 3.14_15F; +long hexBytes = 0xFF_EC_DE_5E; +long hexWords = 0xCAFE_BABE; +long maxLong = 0x7fff_ffff_ffff_ffffL; +byte nybbles = 0b0010_0101; +long bytes = 0b11010010_01101001_10010100_10010010; +int n = 1234 + Contacts._ID; diff --git a/highlight-js/test/markup/java/numbers.txt b/highlight-js/test/markup/java/numbers.txt new file mode 100644 index 0000000..f68a40c --- /dev/null +++ b/highlight-js/test/markup/java/numbers.txt @@ -0,0 +1,9 @@ +long creditCardNumber = 1234_5678_9012_3456L; +long socialSecurityNumber = 999_99_9999L; +float pi = 3.14_15F; +long hexBytes = 0xFF_EC_DE_5E; +long hexWords = 0xCAFE_BABE; +long maxLong = 0x7fff_ffff_ffff_ffffL; +byte nybbles = 0b0010_0101; +long bytes = 0b11010010_01101001_10010100_10010010; +int n = 1234 + Contacts._ID; diff --git a/highlight-js/test/markup/java/titles.expect.txt b/highlight-js/test/markup/java/titles.expect.txt new file mode 100644 index 0000000..cc0a41b --- /dev/null +++ b/highlight-js/test/markup/java/titles.expect.txt @@ -0,0 +1,10 @@ +public class Greet { + public Either<Integer, String> f(int val) { + new Type(); + if (val) { + return getType(); + } else if (!val) { + throw getError(); + } + } +} diff --git a/highlight-js/test/markup/java/titles.txt b/highlight-js/test/markup/java/titles.txt new file mode 100644 index 0000000..c43f696 --- /dev/null +++ b/highlight-js/test/markup/java/titles.txt @@ -0,0 +1,10 @@ +public class Greet { + public Either f(int val) { + new Type(); + if (val) { + return getType(); + } else if (!val) { + throw getError(); + } + } +} diff --git a/highlight-js/test/markup/javascript/arrow-function.expect.txt b/highlight-js/test/markup/javascript/arrow-function.expect.txt new file mode 100644 index 0000000..7a4faaf --- /dev/null +++ b/highlight-js/test/markup/javascript/arrow-function.expect.txt @@ -0,0 +1,3 @@ +var f = x => x; +f(x => x + (y=2, z=undefined, ...rest) => y); +() => null; diff --git a/highlight-js/test/markup/javascript/arrow-function.txt b/highlight-js/test/markup/javascript/arrow-function.txt new file mode 100644 index 0000000..0d39f38 --- /dev/null +++ b/highlight-js/test/markup/javascript/arrow-function.txt @@ -0,0 +1,3 @@ +var f = x => x; +f(x => x + (y=2, z=undefined, ...rest) => y); +() => null; diff --git a/highlight-js/test/markup/javascript/class.expect.txt b/highlight-js/test/markup/javascript/class.expect.txt new file mode 100644 index 0000000..31a8507 --- /dev/null +++ b/highlight-js/test/markup/javascript/class.expect.txt @@ -0,0 +1,11 @@ +class Car extends Vehicle { + constructor(speed, cost) { + super(speed); + + var c = Symbol('cost'); + this[c] = cost; + + this.intro = `This is a car runs at + ${speed}.`; + } +} diff --git a/highlight-js/test/markup/javascript/class.txt b/highlight-js/test/markup/javascript/class.txt new file mode 100644 index 0000000..47fa67c --- /dev/null +++ b/highlight-js/test/markup/javascript/class.txt @@ -0,0 +1,11 @@ +class Car extends Vehicle { + constructor(speed, cost) { + super(speed); + + var c = Symbol('cost'); + this[c] = cost; + + this.intro = `This is a car runs at + ${speed}.`; + } +} diff --git a/highlight-js/test/markup/javascript/default-parameters.expect.txt b/highlight-js/test/markup/javascript/default-parameters.expect.txt new file mode 100644 index 0000000..d433ced --- /dev/null +++ b/highlight-js/test/markup/javascript/default-parameters.expect.txt @@ -0,0 +1 @@ +function visibleTodoFilter(state = 'watch', action) {} diff --git a/highlight-js/test/markup/javascript/default-parameters.txt b/highlight-js/test/markup/javascript/default-parameters.txt new file mode 100644 index 0000000..12fb144 --- /dev/null +++ b/highlight-js/test/markup/javascript/default-parameters.txt @@ -0,0 +1 @@ +function visibleTodoFilter(state = 'watch', action) {} diff --git a/highlight-js/test/markup/javascript/jsx.expect.txt b/highlight-js/test/markup/javascript/jsx.expect.txt new file mode 100644 index 0000000..7044949 --- /dev/null +++ b/highlight-js/test/markup/javascript/jsx.expect.txt @@ -0,0 +1,6 @@ +var jsx = <node/>; +var jsx = <node><child/></node>; +var jsx = <node>...<child>...</child></node>; +var jsx = <div><span><br /></span></div>; +var x = 5; +return (<node attr="value"></node>); diff --git a/highlight-js/test/markup/javascript/jsx.txt b/highlight-js/test/markup/javascript/jsx.txt new file mode 100644 index 0000000..2b3db72 --- /dev/null +++ b/highlight-js/test/markup/javascript/jsx.txt @@ -0,0 +1,6 @@ +var jsx = ; +var jsx = ; +var jsx = ......; +var jsx =

    ; +var x = 5; +return (); diff --git a/highlight-js/test/markup/javascript/keywords.expect.txt b/highlight-js/test/markup/javascript/keywords.expect.txt new file mode 100644 index 0000000..66edf9f --- /dev/null +++ b/highlight-js/test/markup/javascript/keywords.expect.txt @@ -0,0 +1,13 @@ +function $initHighlight(block, cls) { + try { + if (cls.search(/\bno\-highlight\b/) != -1) + return process(block, true, 0x0F) + + ' class=""'; + } catch (e) { + /* handle exception */ + } + for (var i = 0 / 2; i < classes.length; i++) { + if (checkCondition(classes[i]) === undefined) + return /\d+[\s/]/g; + } +} diff --git a/highlight-js/test/markup/javascript/keywords.txt b/highlight-js/test/markup/javascript/keywords.txt new file mode 100644 index 0000000..39b3f20 --- /dev/null +++ b/highlight-js/test/markup/javascript/keywords.txt @@ -0,0 +1,13 @@ +function $initHighlight(block, cls) { + try { + if (cls.search(/\bno\-highlight\b/) != -1) + return process(block, true, 0x0F) + + ' class=""'; + } catch (e) { + /* handle exception */ + } + for (var i = 0 / 2; i < classes.length; i++) { + if (checkCondition(classes[i]) === undefined) + return /\d+[\s/]/g; + } +} diff --git a/highlight-js/test/markup/javascript/method-call.expect.txt b/highlight-js/test/markup/javascript/method-call.expect.txt new file mode 100644 index 0000000..25b4a6a --- /dev/null +++ b/highlight-js/test/markup/javascript/method-call.expect.txt @@ -0,0 +1 @@ +x.continue(0); diff --git a/highlight-js/test/markup/javascript/method-call.txt b/highlight-js/test/markup/javascript/method-call.txt new file mode 100644 index 0000000..e4e6cc4 --- /dev/null +++ b/highlight-js/test/markup/javascript/method-call.txt @@ -0,0 +1 @@ +x.continue(0); diff --git a/highlight-js/test/markup/javascript/modules.expect.txt b/highlight-js/test/markup/javascript/modules.expect.txt new file mode 100644 index 0000000..0f83909 --- /dev/null +++ b/highlight-js/test/markup/javascript/modules.expect.txt @@ -0,0 +1,8 @@ +//------ underscore.js ------ +export default function (obj) {}; +export function each(obj, iterator, context) {}; +export { each as forEach }; +export function something() {}; + +//------ main.js ------ +import _, { each, something as otherthing } from 'underscore'; diff --git a/highlight-js/test/markup/javascript/modules.txt b/highlight-js/test/markup/javascript/modules.txt new file mode 100644 index 0000000..c0c8e35 --- /dev/null +++ b/highlight-js/test/markup/javascript/modules.txt @@ -0,0 +1,8 @@ +//------ underscore.js ------ +export default function (obj) {}; +export function each(obj, iterator, context) {}; +export { each as forEach }; +export function something() {}; + +//------ main.js ------ +import _, { each, something as otherthing } from 'underscore'; diff --git a/highlight-js/test/markup/javascript/object-attr.expect.txt b/highlight-js/test/markup/javascript/object-attr.expect.txt new file mode 100644 index 0000000..092d8d7 --- /dev/null +++ b/highlight-js/test/markup/javascript/object-attr.expect.txt @@ -0,0 +1,6 @@ +{ + key: value, + key2: value, + 'key-3': value, + key4: false ? undefined : true +} diff --git a/highlight-js/test/markup/javascript/object-attr.txt b/highlight-js/test/markup/javascript/object-attr.txt new file mode 100644 index 0000000..852dbdf --- /dev/null +++ b/highlight-js/test/markup/javascript/object-attr.txt @@ -0,0 +1,6 @@ +{ + key: value, + key2: value, + 'key-3': value, + key4: false ? undefined : true +} diff --git a/highlight-js/test/markup/javascript/shebang.expect.txt b/highlight-js/test/markup/javascript/shebang.expect.txt new file mode 100644 index 0000000..0bd20fa --- /dev/null +++ b/highlight-js/test/markup/javascript/shebang.expect.txt @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +var a = 1; diff --git a/highlight-js/test/markup/javascript/shebang.txt b/highlight-js/test/markup/javascript/shebang.txt new file mode 100644 index 0000000..5ea5ac0 --- /dev/null +++ b/highlight-js/test/markup/javascript/shebang.txt @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +var a = 1; diff --git a/highlight-js/test/markup/javascript/template-strings.expect.txt b/highlight-js/test/markup/javascript/template-strings.expect.txt new file mode 100644 index 0000000..74dddc1 --- /dev/null +++ b/highlight-js/test/markup/javascript/template-strings.expect.txt @@ -0,0 +1 @@ +`string ${foo + `str${undefined}ing`}`; diff --git a/highlight-js/test/markup/javascript/template-strings.txt b/highlight-js/test/markup/javascript/template-strings.txt new file mode 100644 index 0000000..a713e0a --- /dev/null +++ b/highlight-js/test/markup/javascript/template-strings.txt @@ -0,0 +1 @@ +`string ${foo + `str${undefined}ing`}`; diff --git a/highlight-js/test/markup/kotlin/class.expect.txt b/highlight-js/test/markup/kotlin/class.expect.txt new file mode 100644 index 0000000..583c2de --- /dev/null +++ b/highlight-js/test/markup/kotlin/class.expect.txt @@ -0,0 +1,16 @@ +class A { +} + +class B() + +class C() {} + +public class D + +class E1<T> +class E2<T, R> +class E3<T,R> + +class F1 : A +class F2 : A, B +class F3 : A<T> \ No newline at end of file diff --git a/highlight-js/test/markup/kotlin/class.txt b/highlight-js/test/markup/kotlin/class.txt new file mode 100644 index 0000000..cb7a911 --- /dev/null +++ b/highlight-js/test/markup/kotlin/class.txt @@ -0,0 +1,16 @@ +class A { +} + +class B() + +class C() {} + +public class D + +class E1 +class E2 +class E3 + +class F1 : A +class F2 : A, B +class F3 : A \ No newline at end of file diff --git a/highlight-js/test/markup/kotlin/function.expect.txt b/highlight-js/test/markup/kotlin/function.expect.txt new file mode 100644 index 0000000..62e3c83 --- /dev/null +++ b/highlight-js/test/markup/kotlin/function.expect.txt @@ -0,0 +1,13 @@ +fun a() = 1 +fun /* b1 */ b(/*b2*/ a : Int /*b3*/) /*b4*/ = a // b5 + + +fun <T> c() : String = "1" +inline fun <reified T> d() { return } + + +fun e( + a : Int, /*a*/ + b : String //b +) +{} diff --git a/highlight-js/test/markup/kotlin/function.txt b/highlight-js/test/markup/kotlin/function.txt new file mode 100644 index 0000000..1bc2a1a --- /dev/null +++ b/highlight-js/test/markup/kotlin/function.txt @@ -0,0 +1,13 @@ +fun a() = 1 +fun /* b1 */ b(/*b2*/ a : Int /*b3*/) /*b4*/ = a // b5 + + +fun c() : String = "1" +inline fun d() { return } + + +fun e( + a : Int, /*a*/ + b : String //b +) +{} \ No newline at end of file diff --git a/highlight-js/test/markup/lasso/delimiters.expect.txt b/highlight-js/test/markup/lasso/delimiters.expect.txt new file mode 100644 index 0000000..c3cab91 --- /dev/null +++ b/highlight-js/test/markup/lasso/delimiters.expect.txt @@ -0,0 +1,7 @@ +<div> +[local(y::decimal = .57721)] +[noprocess] <?lasso delimiters?> [until] [/noprocess] +[no_square_brackets] skip subsequent [square brackets] +<!--ignore <?LassoScript in HTML comments ?>--> +<?=!#y ? true | `string`?> +</div> diff --git a/highlight-js/test/markup/lasso/delimiters.txt b/highlight-js/test/markup/lasso/delimiters.txt new file mode 100644 index 0000000..375ac58 --- /dev/null +++ b/highlight-js/test/markup/lasso/delimiters.txt @@ -0,0 +1,7 @@ +
    +[local(y::decimal = .57721)] +[noprocess] [until] [/noprocess] +[no_square_brackets] skip subsequent [square brackets] + + +
    diff --git a/highlight-js/test/markup/ldif/ldapmodify.expect.txt b/highlight-js/test/markup/ldif/ldapmodify.expect.txt new file mode 100644 index 0000000..c3ba8ab --- /dev/null +++ b/highlight-js/test/markup/ldif/ldapmodify.expect.txt @@ -0,0 +1,7 @@ +dn: uid=user.0,ou=People,dc=example,dc=com +changeType: modify +add: cn +cn: Morris Day +- +add: mobile +mobile: (408) 555-7844 diff --git a/highlight-js/test/markup/ldif/ldapmodify.txt b/highlight-js/test/markup/ldif/ldapmodify.txt new file mode 100644 index 0000000..022b0eb --- /dev/null +++ b/highlight-js/test/markup/ldif/ldapmodify.txt @@ -0,0 +1,7 @@ +dn: uid=user.0,ou=People,dc=example,dc=com +changeType: modify +add: cn +cn: Morris Day +- +add: mobile +mobile: (408) 555-7844 diff --git a/highlight-js/test/markup/ldif/schema.expect.txt b/highlight-js/test/markup/ldif/schema.expect.txt new file mode 100644 index 0000000..0229806 --- /dev/null +++ b/highlight-js/test/markup/ldif/schema.expect.txt @@ -0,0 +1,15 @@ +dn: cn=schema +objectClass: top +objectClass: ldapSubentry +objectClass: subschema +# Single-valued JSON attribute +attributeTypes: ( example-json1-oid NAME 'json1' + EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 + SINGLE-VALUE X-ORIGIN 'custom attribute' ) +# Multi-valued JSON attribute +attributeTypes: ( example-mjson1-oid NAME 'mjson1' + EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 + X-ORIGIN 'custom attribute' ) +objectClasses: ( example-application-oc-oid NAME 'example-application-oc' + SUP top AUXILIARY MAY ( json1 $ mjson1 ) + X-ORIGIN 'custom auxiliary object class' ) diff --git a/highlight-js/test/markup/ldif/schema.txt b/highlight-js/test/markup/ldif/schema.txt new file mode 100644 index 0000000..02a620e --- /dev/null +++ b/highlight-js/test/markup/ldif/schema.txt @@ -0,0 +1,15 @@ +dn: cn=schema +objectClass: top +objectClass: ldapSubentry +objectClass: subschema +# Single-valued JSON attribute +attributeTypes: ( example-json1-oid NAME 'json1' + EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 + SINGLE-VALUE X-ORIGIN 'custom attribute' ) +# Multi-valued JSON attribute +attributeTypes: ( example-mjson1-oid NAME 'mjson1' + EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 + X-ORIGIN 'custom attribute' ) +objectClasses: ( example-application-oc-oid NAME 'example-application-oc' + SUP top AUXILIARY MAY ( json1 $ mjson1 ) + X-ORIGIN 'custom auxiliary object class' ) diff --git a/highlight-js/test/markup/less/selectors.expect.txt b/highlight-js/test/markup/less/selectors.expect.txt new file mode 100644 index 0000000..425530e --- /dev/null +++ b/highlight-js/test/markup/less/selectors.expect.txt @@ -0,0 +1,8 @@ +#foo { + tag #bar {} + > #bar {} + #bar {} + &#bar {} + &:hover {} + height: ~"@{height}px"; +} diff --git a/highlight-js/test/markup/less/selectors.txt b/highlight-js/test/markup/less/selectors.txt new file mode 100644 index 0000000..8a5ed6e --- /dev/null +++ b/highlight-js/test/markup/less/selectors.txt @@ -0,0 +1,8 @@ +#foo { + tag #bar {} + > #bar {} + #bar {} + &#bar {} + &:hover {} + height: ~"@{height}px"; +} diff --git a/highlight-js/test/markup/lisp/mec.expect.txt b/highlight-js/test/markup/lisp/mec.expect.txt new file mode 100644 index 0000000..a1e680d --- /dev/null +++ b/highlight-js/test/markup/lisp/mec.expect.txt @@ -0,0 +1,4 @@ +; MEC: Multiple Escape Characters. See https://github.com/highlightjs/highlight.js/issues/615 +(|spaces and +newlines| x) +(x '|quoted|) diff --git a/highlight-js/test/markup/lisp/mec.txt b/highlight-js/test/markup/lisp/mec.txt new file mode 100644 index 0000000..2a05b15 --- /dev/null +++ b/highlight-js/test/markup/lisp/mec.txt @@ -0,0 +1,4 @@ +; MEC: Multiple Escape Characters. See https://github.com/highlightjs/highlight.js/issues/615 +(|spaces and +newlines| x) +(x '|quoted|) diff --git a/highlight-js/test/markup/markdown/code.expect.txt b/highlight-js/test/markup/markdown/code.expect.txt new file mode 100644 index 0000000..881ec44 --- /dev/null +++ b/highlight-js/test/markup/markdown/code.expect.txt @@ -0,0 +1,8 @@ + var code = true; + + +```javascript +var code = true; +``` + +Inline `code`, and `more code`. diff --git a/highlight-js/test/markup/markdown/code.txt b/highlight-js/test/markup/markdown/code.txt new file mode 100644 index 0000000..d9bed99 --- /dev/null +++ b/highlight-js/test/markup/markdown/code.txt @@ -0,0 +1,8 @@ + var code = true; + + +```javascript +var code = true; +``` + +Inline `code`, and `more code`. diff --git a/highlight-js/test/markup/matlab/block_comment.expect.txt b/highlight-js/test/markup/matlab/block_comment.expect.txt new file mode 100644 index 0000000..2f08800 --- /dev/null +++ b/highlight-js/test/markup/matlab/block_comment.expect.txt @@ -0,0 +1,27 @@ +%{ evaluate_this = false; % Evaluated as regular single-line comment +evaluate_this = true; +%} + +evaluate_this = true; + +%{ +This is a multi-line comment +evaluate_this = false; +%{ +%} + +evaluate_this = true; + +%{ +Opening (%{) and closing (%}) block comment markers can be within a comment block +%} + +evaluate_this = true; + + %{ + Indented block comments can be indented +or not +and whitespace can be added before or after the %{ and %} + %} + +evaluate_this = true; diff --git a/highlight-js/test/markup/matlab/block_comment.txt b/highlight-js/test/markup/matlab/block_comment.txt new file mode 100644 index 0000000..92127cd --- /dev/null +++ b/highlight-js/test/markup/matlab/block_comment.txt @@ -0,0 +1,27 @@ +%{ evaluate_this = false; % Evaluated as regular single-line comment +evaluate_this = true; +%} + +evaluate_this = true; + +%{ +This is a multi-line comment +evaluate_this = false; +%{ +%} + +evaluate_this = true; + +%{ +Opening (%{) and closing (%}) block comment markers can be within a comment block +%} + +evaluate_this = true; + + %{ + Indented block comments can be indented +or not +and whitespace can be added before or after the %{ and %} + %} + +evaluate_this = true; diff --git a/highlight-js/test/markup/matlab/transpose.expect.txt b/highlight-js/test/markup/matlab/transpose.expect.txt new file mode 100644 index 0000000..26fe7f7 --- /dev/null +++ b/highlight-js/test/markup/matlab/transpose.expect.txt @@ -0,0 +1,40 @@ +% This use of ' is for transpose: +mat2x2 = [1 2; 3 4]'; % transpose of a matrix +cell2x2 = {1 2; 3 4}'; % transpose of a cell +v=mat2x2'; % transpose of a variable +v2 = (v')'; % two transpose operations +foo = 1.'; % transpose of scalar 1. + +% Nonconjugate transpose uses .' +mat2x2 = [1 2; 3 4].'; % of a matrix +cell2x2 = {1 2; 3 4}.'; % of a cell +v=mat2x2.'; % of a variable +v2 = (v.').'; % two operations +foo = 1..'; % of scalar 1. +bar = v.''.'.''; % mix of transpose operations + +% single quote strings: +sq1 = 'a single quote string'; +sq2 = ... +' abcd '; % single quote string starting at column 1 +sq3 = ['a','bc']; % array of single quote strings +sq4 = {'a','bc'}; % cell of single quote strings + +% double quote strings +dq1 = "a double string"; +dq2 = ... +" abcd "; % double quote string starting at column 1 +dq3 = ["a","bc"]; % array of double quote strings + +% Mixture of strings and transpose +c2 = {'a','bc'}'; % transpose of a cell of strings +s = ['a','bc']'; % you can transpose vectors of strings (they are really 'char' arrays) +s = s'; % and transpose back +% (s')' is a double transpose of a string +x = [(s')', ' xyz ', 'a single quote in a string'', escape \', two quotes in a string''''']; + +s2 = "abc\"def""ghi"; % newer versions of MATLAB support double quoted strings +s3 = (["abc", "defg"]')'; % transpose a vectors of quoted string twice +s4 = "abc"!; % transpose a quoted string + +b = true' + false'; % boolean constants diff --git a/highlight-js/test/markup/matlab/transpose.txt b/highlight-js/test/markup/matlab/transpose.txt new file mode 100644 index 0000000..d1da28e --- /dev/null +++ b/highlight-js/test/markup/matlab/transpose.txt @@ -0,0 +1,40 @@ +% This use of ' is for transpose: +mat2x2 = [1 2; 3 4]'; % transpose of a matrix +cell2x2 = {1 2; 3 4}'; % transpose of a cell +v=mat2x2'; % transpose of a variable +v2 = (v')'; % two transpose operations +foo = 1.'; % transpose of scalar 1. + +% Nonconjugate transpose uses .' +mat2x2 = [1 2; 3 4].'; % of a matrix +cell2x2 = {1 2; 3 4}.'; % of a cell +v=mat2x2.'; % of a variable +v2 = (v.').'; % two operations +foo = 1..'; % of scalar 1. +bar = v.''.'.''; % mix of transpose operations + +% single quote strings: +sq1 = 'a single quote string'; +sq2 = ... +' abcd '; % single quote string starting at column 1 +sq3 = ['a','bc']; % array of single quote strings +sq4 = {'a','bc'}; % cell of single quote strings + +% double quote strings +dq1 = "a double string"; +dq2 = ... +" abcd "; % double quote string starting at column 1 +dq3 = ["a","bc"]; % array of double quote strings + +% Mixture of strings and transpose +c2 = {'a','bc'}'; % transpose of a cell of strings +s = ['a','bc']'; % you can transpose vectors of strings (they are really 'char' arrays) +s = s'; % and transpose back +% (s')' is a double transpose of a string +x = [(s')', ' xyz ', 'a single quote in a string'', escape \', two quotes in a string''''']; + +s2 = "abc\"def""ghi"; % newer versions of MATLAB support double quoted strings +s3 = (["abc", "defg"]')'; % transpose a vectors of quoted string twice +s4 = "abc"!; % transpose a quoted string + +b = true' + false'; % boolean constants diff --git a/highlight-js/test/markup/maxima/example.expect.txt b/highlight-js/test/markup/maxima/example.expect.txt new file mode 100644 index 0000000..0e23890 --- /dev/null +++ b/highlight-js/test/markup/maxima/example.expect.txt @@ -0,0 +1,42 @@ +/* Maxima computer algebra system */ + +print ("mumble"); + +/* this + /* this is + /* this is a nested comment */ nested comment + */ comment + */ + +sin(%pi); /* should be highlighted again */ + +/* programming keywords */ + +if a then b elseif c then d else f; +for x:1 thru 10 step 2 do print(x); +for z:-2 while z < 0 do print(z); +for m:0 unless m > 10 do print(m); +for x in [1, 2, 3] do print(x); +foo and bar or not baz; + +/* different kinds of integers */ + +ibase : 18 $ +[0, 1234, 1234., 0abcdefgh]; +reset (ibase) $ + +/* strings */ + +s1 : "\"now\" is"; +s2 : "the 'time' for all good men"; +print (s1, s2, "to come to the aid", + "of their country"); + +/* expressions */ + +foo (x, y, z) := + if x > 1 + y + then z - x*y + elseif y <= 100! + then x/(y + z)^2 + else z - y . x . y; diff --git a/highlight-js/test/markup/maxima/example.txt b/highlight-js/test/markup/maxima/example.txt new file mode 100644 index 0000000..206f969 --- /dev/null +++ b/highlight-js/test/markup/maxima/example.txt @@ -0,0 +1,42 @@ +/* Maxima computer algebra system */ + +print ("mumble"); + +/* this + /* this is + /* this is a nested comment */ nested comment + */ comment + */ + +sin(%pi); /* should be highlighted again */ + +/* programming keywords */ + +if a then b elseif c then d else f; +for x:1 thru 10 step 2 do print(x); +for z:-2 while z < 0 do print(z); +for m:0 unless m > 10 do print(m); +for x in [1, 2, 3] do print(x); +foo and bar or not baz; + +/* different kinds of integers */ + +ibase : 18 $ +[0, 1234, 1234., 0abcdefgh]; +reset (ibase) $ + +/* strings */ + +s1 : "\"now\" is"; +s2 : "the 'time' for all good men"; +print (s1, s2, "to come to the aid", + "of their country"); + +/* expressions */ + +foo (x, y, z) := + if x > 1 + y + then z - x*y + elseif y <= 100! + then x/(y + z)^2 + else z - y . x . y; diff --git a/highlight-js/test/markup/maxima/numbers.expect.txt b/highlight-js/test/markup/maxima/numbers.expect.txt new file mode 100644 index 0000000..61fc9dd --- /dev/null +++ b/highlight-js/test/markup/maxima/numbers.expect.txt @@ -0,0 +1,24 @@ +0 +0. +12345. +12345 +0.0 +123.45 +0e0 +0b0 +12345e0 +12345e123 +12345e-123 +12345e+123 +12345b0 +12345b123 +12345b-123 +12345b+123 +1.2345e0 +1.2345e123 +1.2345e-123 +1.2345e+123 +1.2345b0 +1.2345b123 +1.2345b-123 +1.2345b+123 diff --git a/highlight-js/test/markup/maxima/numbers.txt b/highlight-js/test/markup/maxima/numbers.txt new file mode 100644 index 0000000..b93e4d5 --- /dev/null +++ b/highlight-js/test/markup/maxima/numbers.txt @@ -0,0 +1,24 @@ +0 +0. +12345. +12345 +0.0 +123.45 +0e0 +0b0 +12345e0 +12345e123 +12345e-123 +12345e+123 +12345b0 +12345b123 +12345b-123 +12345b+123 +1.2345e0 +1.2345e123 +1.2345e-123 +1.2345e+123 +1.2345b0 +1.2345b123 +1.2345b-123 +1.2345b+123 diff --git a/highlight-js/test/markup/maxima/symbols.expect.txt b/highlight-js/test/markup/maxima/symbols.expect.txt new file mode 100644 index 0000000..de72666 --- /dev/null +++ b/highlight-js/test/markup/maxima/symbols.expect.txt @@ -0,0 +1,18 @@ +/* symbolic constants */ + +[true, false, unknown, inf, minf, ind, + und, %e, %i, %pi, %phi, %gamma]; + +/* built-in variables */ + +[_, __, %, %%, linel, simp, dispflag, + stringdisp, lispdisp, %edispflag]; + +/* built-in functions */ + +[sin, cosh, exp, atan2, sqrt, log, struve_h, + sublist_indices, read_array]; + +/* user-defined symbols */ + +[foo, ?bar, baz%, quux_mumble_blurf]; diff --git a/highlight-js/test/markup/maxima/symbols.txt b/highlight-js/test/markup/maxima/symbols.txt new file mode 100644 index 0000000..e22b0c2 --- /dev/null +++ b/highlight-js/test/markup/maxima/symbols.txt @@ -0,0 +1,18 @@ +/* symbolic constants */ + +[true, false, unknown, inf, minf, ind, + und, %e, %i, %pi, %phi, %gamma]; + +/* built-in variables */ + +[_, __, %, %%, linel, simp, dispflag, + stringdisp, lispdisp, %edispflag]; + +/* built-in functions */ + +[sin, cosh, exp, atan2, sqrt, log, struve_h, + sublist_indices, read_array]; + +/* user-defined symbols */ + +[foo, ?bar, baz%, quux_mumble_blurf]; diff --git a/highlight-js/test/markup/ocaml/literals.expect.txt b/highlight-js/test/markup/ocaml/literals.expect.txt new file mode 100644 index 0000000..d0c95be --- /dev/null +++ b/highlight-js/test/markup/ocaml/literals.expect.txt @@ -0,0 +1,29 @@ +let i = 14 +let i = -14 +let i = 1_000 +let i = 0b100 +let i = 0x1FF +let i = 0o777 +let i64 = 128L +let i64 = 0b10L +let i32 = 32l +let i32 = 0x12l +let nat = 10n +let nat = 0o644n +let f = 5. +let f = 5.1 +let f = 1e+1 +let f = 1e1 +let f = 1e-1 +let f = 1_024e12 +let f = 1L + +let b = true || false +let l = [] +let a = [||] +let () = ignore (b) + +let c = 'a' +let c = '\xFF' +let c = '\128' +let c = '\n' diff --git a/highlight-js/test/markup/ocaml/literals.txt b/highlight-js/test/markup/ocaml/literals.txt new file mode 100644 index 0000000..d9d3632 --- /dev/null +++ b/highlight-js/test/markup/ocaml/literals.txt @@ -0,0 +1,29 @@ +let i = 14 +let i = -14 +let i = 1_000 +let i = 0b100 +let i = 0x1FF +let i = 0o777 +let i64 = 128L +let i64 = 0b10L +let i32 = 32l +let i32 = 0x12l +let nat = 10n +let nat = 0o644n +let f = 5. +let f = 5.1 +let f = 1e+1 +let f = 1e1 +let f = 1e-1 +let f = 1_024e12 +let f = 1L + +let b = true || false +let l = [] +let a = [||] +let () = ignore (b) + +let c = 'a' +let c = '\xFF' +let c = '\128' +let c = '\n' diff --git a/highlight-js/test/markup/ocaml/types.expect.txt b/highlight-js/test/markup/ocaml/types.expect.txt new file mode 100644 index 0000000..1c28405 --- /dev/null +++ b/highlight-js/test/markup/ocaml/types.expect.txt @@ -0,0 +1,17 @@ +(* type variables *) +type 'a t = 'a list +let f (a : 'a list) : 'a = List.hd a + +(* polymorphic variants *) +type t = [ `A | `B ] + +(* variants *) +type result = Sat | Unsat | Unknown + +(* module and module types *) +module type S = sig + val compute : unit -> unit +end +module Impl : S = struct + let compute () = () +end diff --git a/highlight-js/test/markup/ocaml/types.txt b/highlight-js/test/markup/ocaml/types.txt new file mode 100644 index 0000000..c18ed56 --- /dev/null +++ b/highlight-js/test/markup/ocaml/types.txt @@ -0,0 +1,17 @@ +(* type variables *) +type 'a t = 'a list +let f (a : 'a list) : 'a = List.hd a + +(* polymorphic variants *) +type t = [ `A | `B ] + +(* variants *) +type result = Sat | Unsat | Unknown + +(* module and module types *) +module type S = sig + val compute : unit -> unit +end +module Impl : S = struct + let compute () = () +end diff --git a/highlight-js/test/markup/pgsql/clauses.expect.txt b/highlight-js/test/markup/pgsql/clauses.expect.txt new file mode 100644 index 0000000..736d57e --- /dev/null +++ b/highlight-js/test/markup/pgsql/clauses.expect.txt @@ -0,0 +1,67 @@ +-- clauses + +ADD, ADD COLUMN, +ALTER, +DROP, DROP COLUMN, +SET, SET ( .. ), +ON, + ACCESS METHOD, + AGGREGATE, + ATTRIBUTE, + CASCADE, + COLLATION, + COLUMN, + CONFLICT, + CONSTRAINT, + CONVERSION, + DATABASE, + DEFAULT, + DOMAIN, + EVENT TRIGGER, + EXTENSION, + EVENT TRIGGER, + FOREIGN DATA WRAPPER, + FOREIGN TABLE, + FROM CURRENT, + FUNCTION, + IDENTITY, + INDEX, + ISOLATION LEVEL SERIALIZABLE, ISOLATION LEVEL REPEATABLE READ, + ISOLATION LEVEL READ COMMITTED, ISOLATION LEVEL READ UNCOMMITTED, + LARGE OBJECT, + LOGGED, UNLOGGED, + MAPPING FOR .. WITH .., MAPPING REPLACE .. WITH .., + MATERIALIZED VIEW, + NOT VALID, + OPERATOR, + OPERATOR CLASS .. USING .., + OPERATOR FAMILY .. USING .., + POLICY, + PROCEDURAL LANGUAGE, + PROCEDURE, + PUBLICATION, + READ WRITE, READ ONLY, + RESTRICT, + ROLE, + ROUTINE, + RULE, + SCHEMA, + SEQUENCE, + SERVER, + STATISTICS, + STORAGE PLAIN, STORAGE EXTERNAL, STORAGE EXTENDED, STORAGE MAIN, + SUBSCRIPTION, + TABLE, + TABLESPACE, + TEXT SEARCH CONFIGURATION, + TEXT SEARCH DICTIONARY, + TEXT SEARCH PARSER, + TEXT SEARCH TEMPLATE, + TRANSFORM FOR .. LANGUAGE SQL, + TRIGGER, + TYPE, + VALUE, + VIEW, + WITH OIDS, WITHOUT OIDS, + WITHOUT CLUSTER, +SET DATA TYPE; diff --git a/highlight-js/test/markup/pgsql/clauses.txt b/highlight-js/test/markup/pgsql/clauses.txt new file mode 100644 index 0000000..283429f --- /dev/null +++ b/highlight-js/test/markup/pgsql/clauses.txt @@ -0,0 +1,67 @@ +-- clauses + +ADD, ADD COLUMN, +ALTER, +DROP, DROP COLUMN, +SET, SET ( .. ), +ON, + ACCESS METHOD, + AGGREGATE, + ATTRIBUTE, + CASCADE, + COLLATION, + COLUMN, + CONFLICT, + CONSTRAINT, + CONVERSION, + DATABASE, + DEFAULT, + DOMAIN, + EVENT TRIGGER, + EXTENSION, + EVENT TRIGGER, + FOREIGN DATA WRAPPER, + FOREIGN TABLE, + FROM CURRENT, + FUNCTION, + IDENTITY, + INDEX, + ISOLATION LEVEL SERIALIZABLE, ISOLATION LEVEL REPEATABLE READ, + ISOLATION LEVEL READ COMMITTED, ISOLATION LEVEL READ UNCOMMITTED, + LARGE OBJECT, + LOGGED, UNLOGGED, + MAPPING FOR .. WITH .., MAPPING REPLACE .. WITH .., + MATERIALIZED VIEW, + NOT VALID, + OPERATOR, + OPERATOR CLASS .. USING .., + OPERATOR FAMILY .. USING .., + POLICY, + PROCEDURAL LANGUAGE, + PROCEDURE, + PUBLICATION, + READ WRITE, READ ONLY, + RESTRICT, + ROLE, + ROUTINE, + RULE, + SCHEMA, + SEQUENCE, + SERVER, + STATISTICS, + STORAGE PLAIN, STORAGE EXTERNAL, STORAGE EXTENDED, STORAGE MAIN, + SUBSCRIPTION, + TABLE, + TABLESPACE, + TEXT SEARCH CONFIGURATION, + TEXT SEARCH DICTIONARY, + TEXT SEARCH PARSER, + TEXT SEARCH TEMPLATE, + TRANSFORM FOR .. LANGUAGE SQL, + TRIGGER, + TYPE, + VALUE, + VIEW, + WITH OIDS, WITHOUT OIDS, + WITHOUT CLUSTER, +SET DATA TYPE; diff --git a/highlight-js/test/markup/pgsql/clauses2.expect.txt b/highlight-js/test/markup/pgsql/clauses2.expect.txt new file mode 100644 index 0000000..9988ed9 --- /dev/null +++ b/highlight-js/test/markup/pgsql/clauses2.expect.txt @@ -0,0 +1,160 @@ +-- clauses (part 2) + +ADMIN OPTION, +ALL, +ANALYZE, ANALYZE ( .. ), +AS ASSIGNMENT, AS IMPLICIT, +AS PERMISSIVE, AS RESTRICTIVE, +AS ENUM, AS RANGE, +AS ( .. ), -- select +ASC, DESC, +ATTACH PARTITION, +AUTHORIZATION, +BEFORE, AFTER, INSTEAD OF, +CACHE 100, NO CYCLE, +CALLED ON NULL INPUT, RETURNS NULL ON NULL INPUT, +COLLATE, +CONCURRENTLY, +CONNECTION '..', +CONSTRAINT, +COST 100, +CLUSTER ON, +CURSOR, +DEPENDS ON EXTENSION, +DISABLE, ENABLE + REPLICA, ALWAYS, + TRIGGER, TRIGGER USER, REPLICA TRIGGER, ALWAYS TRIGGER, TRIGGER ALL, + RULE, REPLICA RULE, ALWAYS RULE, + ROW LEVEL SECURITY, FORCE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY, +DISCARD PLANS, +DISTINCT, DISTINCT ON ( .. ), -- select +DO ALSO .., DO INSTEAD .., DO ALSO NOTHING, DO INSTEAD NOTHING, +DO NOTHING, DO UPDATE, +EXCEPT, +EXECUTE PROCEDURE, +EXPLAIN ( .. ), +EXTERNAL, +FAMILY, +FOR ROLE .. IN SCHEMA, +FOR USER, +FOR SEARCH, FOR ORDER BY, +FOR TABLE, FOR ALL TABLES, +FOR VALUES, FOR VALUES FROM .. TO, FOR VALUES IN ( .. ), +FOR ROW, FOR EACH ROW, FOR STATEMENT, FOR EACH STATEMENT, +FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE, FOR KEY SHARE, +FROM, +FROM '..', FROM PROGRAM, FROM STDIN, +FROM SQL WITH FUNCTION, TO SQL WITH FUNCTION, +FROM ( .. ), -- select +FUNCTION, FUNCTIONS, +GLOBAL, -- create global table +GROUP BY, +HAVING, +SELECT, + INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, USAGE, EXECUTE, ALL PRIVILEGES, + CONNECT, TEMPORARY, TEMP, +HANDLER, NO HANDLER +IF EXISTS, IF NOT EXISTS, +IMMUTABLE, +IN + ACCESS SHARE MODE, ROW SHARE MODE, ROW EXCLUSIVE MODE, SHARE UPDATE EXCLUSIVE MODE, + SHARE MODE, SHARE ROW EXCLUSIVE MODE, EXCLUSIVE MODE, ACCESS EXCLUSIVE MODE, +INCREMENT 100, INCREMENT BY 100, +INHERIT, NO INHERIT, +INHERITS ( .. ), +INLINE, +INTO, +JOIN, INNER JOIN, LEFT OUTER JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, +LANGUAGE, +LATERAL, +LEAKPROOF, NOT LEAKPROOF, +LIMIT, LIMIT TO, +LOCAL, -- create local table, set +LOCATION, +MAXVALUE 100, NO MAXVALUE, +MINVALUE 100, NO MINVALUE, +NATURAL, +FETCH NEXT, FETCH PRIOR, FETCH FIRST, FETCH LAST, FETCH ABSOLUTE 10, FETCH RELATIVE 10, + FETCH ALL, FETCH FORWARD, FETCH FORWARD 10, FETCH FORWARD ALL, + FETCH BACKWARD, FETCH BACKWARD 10, FETCH BACKWARD ALL, +NOWAIT, +NULLS FIRST, NULLS LAST, +OFFSET 10 ROW, OFFSET 10 ROWS, -- select +ON TABLES, ON SEQUENCES, ON FUNCTIONS, ON ROUTINES, ON TYPES, ON SCHEMAS, +ON COMMIT PRESERVE ROWS, ON COMMIT DELETE ROWS, ON COMMIT DROP, +ONLY, +OPTIONS ( .. ), +OPERATOR, +OR REPLACE, +OVERRIDING SYSTEM VALUE, OVERRIDING USER VALUE, +OWNER TO .., OWNER TO CURRENT_USER, OWNER TO SESSION_USER, +OWNED BY, +PARALLEL UNSAFE, PARALLEL RESTRICTED, PARALLEL SAFE, +PARTITION BY RANGE (), PARTITION BY LIST (), PARTITION BY HASH (), +PARTITION OF .., +PREPARE, +PROCEDURAL, +PROCEDURES, +RECURSIVE, -- create view +REFERENCING OLD TABLE, REFERENCING NEW TABLE, +REFRESH VERSION, REFRESH PUBLICATION ( .. ), +REINDEX ( .. ), +REPEATABLE ( .. ), -- select +REPLICA IDENTITY + DEFAULT, USING INDEX, FULL, NOTHING, +RENAME + CONSTRAINT .. TO, TO, COLUMN .. TO, +RESET, RESET ALL, RESET ( .. ), +RESTART 100, RESTART WITH 100, +RESTART IDENTITY, CONTINUE IDENTITY, -- truncate +RETURNS, RETURNS TABLE ( .. ), +RETURNING, +ROLLUP ( .. ), CUBE ( .. ), GROUPING SETS ( .. ), +ROUTINES, +ROW, ROW ( .. ), +GRANT OPTION, +ROWS 100, +SCROLL CURSOR, NO SCROLL CURSOR, BINARY CURSOR, INSENSITIVE CURSOR, -- declare +SEQUENCES, +SECURITY INVOKER, SECURITY DEFINER, +SERVER, +SESSION, -- set +SKIP LOCKED, -- select +SNAPSHOT, -- set transaction +STABLE, +START 100, START WITH 100, +STORAGE, +STRICT, +SYSTEM, -- reindex +TABLES, +TABLESAMPLE, +TEMPORARY, TEMP, -- create sequence/table/view, discard +TO GROUP, PUBLIC WITH GRANT OPTION, +TO '..', TO PROGRAM, TO STDOUT, +TRANSFORM FOR TYPE, +TRUSTED, +TYPE, +UNIQUE, +UNION, INTERSECT, EXCEPT, -- select +UNLOGGED, +UPDATE TO, +USING .., USING ( .. ), +VACUUM ( .. ), +VALIDATE CONSTRAINT, +VALIDATOR, NO VALIDATOR, +VALUES, VALUES ( .. ), +VERBOSE, +VOLATILE, +WHEN ( .. ), +WHERE, WHERE CURRENT OF, +WINDOW, +WITH, WITH RECURSIVE, +WITH ALLOW_CONNECTIONS 10 CONNECTION LIMIT 1 IS_TEMPLATE true, +WITH CHECK ( .. ), +WITH DATA, WITH NO DATA, +WITH FUNCTION, WITHOUT FUNCTION, WITH INOUT, +WITH OPTIONS, +WITH ORDINALITY, -- select +WITH CASCADED CHECK OPTION, WITH LOCAL CHECK OPTION, +WITH HOLD, WITHOUT HOLD, -- declare +WITH, WITH ( .. ), (); diff --git a/highlight-js/test/markup/pgsql/clauses2.txt b/highlight-js/test/markup/pgsql/clauses2.txt new file mode 100644 index 0000000..f9e55fb --- /dev/null +++ b/highlight-js/test/markup/pgsql/clauses2.txt @@ -0,0 +1,160 @@ +-- clauses (part 2) + +ADMIN OPTION, +ALL, +ANALYZE, ANALYZE ( .. ), +AS ASSIGNMENT, AS IMPLICIT, +AS PERMISSIVE, AS RESTRICTIVE, +AS ENUM, AS RANGE, +AS ( .. ), -- select +ASC, DESC, +ATTACH PARTITION, +AUTHORIZATION, +BEFORE, AFTER, INSTEAD OF, +CACHE 100, NO CYCLE, +CALLED ON NULL INPUT, RETURNS NULL ON NULL INPUT, +COLLATE, +CONCURRENTLY, +CONNECTION '..', +CONSTRAINT, +COST 100, +CLUSTER ON, +CURSOR, +DEPENDS ON EXTENSION, +DISABLE, ENABLE + REPLICA, ALWAYS, + TRIGGER, TRIGGER USER, REPLICA TRIGGER, ALWAYS TRIGGER, TRIGGER ALL, + RULE, REPLICA RULE, ALWAYS RULE, + ROW LEVEL SECURITY, FORCE ROW LEVEL SECURITY, NO FORCE ROW LEVEL SECURITY, +DISCARD PLANS, +DISTINCT, DISTINCT ON ( .. ), -- select +DO ALSO .., DO INSTEAD .., DO ALSO NOTHING, DO INSTEAD NOTHING, +DO NOTHING, DO UPDATE, +EXCEPT, +EXECUTE PROCEDURE, +EXPLAIN ( .. ), +EXTERNAL, +FAMILY, +FOR ROLE .. IN SCHEMA, +FOR USER, +FOR SEARCH, FOR ORDER BY, +FOR TABLE, FOR ALL TABLES, +FOR VALUES, FOR VALUES FROM .. TO, FOR VALUES IN ( .. ), +FOR ROW, FOR EACH ROW, FOR STATEMENT, FOR EACH STATEMENT, +FOR UPDATE, FOR NO KEY UPDATE, FOR SHARE, FOR KEY SHARE, +FROM, +FROM '..', FROM PROGRAM, FROM STDIN, +FROM SQL WITH FUNCTION, TO SQL WITH FUNCTION, +FROM ( .. ), -- select +FUNCTION, FUNCTIONS, +GLOBAL, -- create global table +GROUP BY, +HAVING, +SELECT, + INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, USAGE, EXECUTE, ALL PRIVILEGES, + CONNECT, TEMPORARY, TEMP, +HANDLER, NO HANDLER +IF EXISTS, IF NOT EXISTS, +IMMUTABLE, +IN + ACCESS SHARE MODE, ROW SHARE MODE, ROW EXCLUSIVE MODE, SHARE UPDATE EXCLUSIVE MODE, + SHARE MODE, SHARE ROW EXCLUSIVE MODE, EXCLUSIVE MODE, ACCESS EXCLUSIVE MODE, +INCREMENT 100, INCREMENT BY 100, +INHERIT, NO INHERIT, +INHERITS ( .. ), +INLINE, +INTO, +JOIN, INNER JOIN, LEFT OUTER JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN, +LANGUAGE, +LATERAL, +LEAKPROOF, NOT LEAKPROOF, +LIMIT, LIMIT TO, +LOCAL, -- create local table, set +LOCATION, +MAXVALUE 100, NO MAXVALUE, +MINVALUE 100, NO MINVALUE, +NATURAL, +FETCH NEXT, FETCH PRIOR, FETCH FIRST, FETCH LAST, FETCH ABSOLUTE 10, FETCH RELATIVE 10, + FETCH ALL, FETCH FORWARD, FETCH FORWARD 10, FETCH FORWARD ALL, + FETCH BACKWARD, FETCH BACKWARD 10, FETCH BACKWARD ALL, +NOWAIT, +NULLS FIRST, NULLS LAST, +OFFSET 10 ROW, OFFSET 10 ROWS, -- select +ON TABLES, ON SEQUENCES, ON FUNCTIONS, ON ROUTINES, ON TYPES, ON SCHEMAS, +ON COMMIT PRESERVE ROWS, ON COMMIT DELETE ROWS, ON COMMIT DROP, +ONLY, +OPTIONS ( .. ), +OPERATOR, +OR REPLACE, +OVERRIDING SYSTEM VALUE, OVERRIDING USER VALUE, +OWNER TO .., OWNER TO CURRENT_USER, OWNER TO SESSION_USER, +OWNED BY, +PARALLEL UNSAFE, PARALLEL RESTRICTED, PARALLEL SAFE, +PARTITION BY RANGE (), PARTITION BY LIST (), PARTITION BY HASH (), +PARTITION OF .., +PREPARE, +PROCEDURAL, +PROCEDURES, +RECURSIVE, -- create view +REFERENCING OLD TABLE, REFERENCING NEW TABLE, +REFRESH VERSION, REFRESH PUBLICATION ( .. ), +REINDEX ( .. ), +REPEATABLE ( .. ), -- select +REPLICA IDENTITY + DEFAULT, USING INDEX, FULL, NOTHING, +RENAME + CONSTRAINT .. TO, TO, COLUMN .. TO, +RESET, RESET ALL, RESET ( .. ), +RESTART 100, RESTART WITH 100, +RESTART IDENTITY, CONTINUE IDENTITY, -- truncate +RETURNS, RETURNS TABLE ( .. ), +RETURNING, +ROLLUP ( .. ), CUBE ( .. ), GROUPING SETS ( .. ), +ROUTINES, +ROW, ROW ( .. ), +GRANT OPTION, +ROWS 100, +SCROLL CURSOR, NO SCROLL CURSOR, BINARY CURSOR, INSENSITIVE CURSOR, -- declare +SEQUENCES, +SECURITY INVOKER, SECURITY DEFINER, +SERVER, +SESSION, -- set +SKIP LOCKED, -- select +SNAPSHOT, -- set transaction +STABLE, +START 100, START WITH 100, +STORAGE, +STRICT, +SYSTEM, -- reindex +TABLES, +TABLESAMPLE, +TEMPORARY, TEMP, -- create sequence/table/view, discard +TO GROUP, PUBLIC WITH GRANT OPTION, +TO '..', TO PROGRAM, TO STDOUT, +TRANSFORM FOR TYPE, +TRUSTED, +TYPE, +UNIQUE, +UNION, INTERSECT, EXCEPT, -- select +UNLOGGED, +UPDATE TO, +USING .., USING ( .. ), +VACUUM ( .. ), +VALIDATE CONSTRAINT, +VALIDATOR, NO VALIDATOR, +VALUES, VALUES ( .. ), +VERBOSE, +VOLATILE, +WHEN ( .. ), +WHERE, WHERE CURRENT OF, +WINDOW, +WITH, WITH RECURSIVE, +WITH ALLOW_CONNECTIONS 10 CONNECTION LIMIT 1 IS_TEMPLATE true, +WITH CHECK ( .. ), +WITH DATA, WITH NO DATA, +WITH FUNCTION, WITHOUT FUNCTION, WITH INOUT, +WITH OPTIONS, +WITH ORDINALITY, -- select +WITH CASCADED CHECK OPTION, WITH LOCAL CHECK OPTION, +WITH HOLD, WITHOUT HOLD, -- declare +WITH, WITH ( .. ), (); diff --git a/highlight-js/test/markup/pgsql/constraints.expect.txt b/highlight-js/test/markup/pgsql/constraints.expect.txt new file mode 100644 index 0000000..56d273a --- /dev/null +++ b/highlight-js/test/markup/pgsql/constraints.expect.txt @@ -0,0 +1,21 @@ +-- column_constraint, table_constraint: + +CONSTRAINT, +NOT NULL, NULL, +CHECK ( .. ) NO INHERIT, +DEFAULT .., +EXCLUDE USING .. ( .. WITH .. ) .. WHERE ( .. ), +GENERATED ALWAYS AS IDENTITY, +GENERATED ALWAYS AS IDENTITY ( .. ), +GENERATED BY DEFAULT AS IDENTITY, +UNIQUE .., UNIQUE ( .. ), +PRIMARY KEY .., PRIMARY KEY ( .. ), +REFERENCES, REFERENCES .. ( .. ), +MATCH FULL, MATCH PARTIAL, MATCH SIMPLE, +ON DELETE .., ON UPDATE .., +DEFERRABLE, NOT DEFERRABLE, INITIALLY DEFERRED, INITIALLY IMMEDIATE, +FOREIGN KEY ( .. ) REFERENCES, +USING INDEX bar, +INCLUDE ( .. ), +WITH ( .. ), +USING INDEX TABLESPACE; diff --git a/highlight-js/test/markup/pgsql/constraints.txt b/highlight-js/test/markup/pgsql/constraints.txt new file mode 100644 index 0000000..6f0fdb5 --- /dev/null +++ b/highlight-js/test/markup/pgsql/constraints.txt @@ -0,0 +1,21 @@ +-- column_constraint, table_constraint: + +CONSTRAINT, +NOT NULL, NULL, +CHECK ( .. ) NO INHERIT, +DEFAULT .., +EXCLUDE USING .. ( .. WITH .. ) .. WHERE ( .. ), +GENERATED ALWAYS AS IDENTITY, +GENERATED ALWAYS AS IDENTITY ( .. ), +GENERATED BY DEFAULT AS IDENTITY, +UNIQUE .., UNIQUE ( .. ), +PRIMARY KEY .., PRIMARY KEY ( .. ), +REFERENCES, REFERENCES .. ( .. ), +MATCH FULL, MATCH PARTIAL, MATCH SIMPLE, +ON DELETE .., ON UPDATE .., +DEFERRABLE, NOT DEFERRABLE, INITIALLY DEFERRED, INITIALLY IMMEDIATE, +FOREIGN KEY ( .. ) REFERENCES, +USING INDEX bar, +INCLUDE ( .. ), +WITH ( .. ), +USING INDEX TABLESPACE; diff --git a/highlight-js/test/markup/pgsql/options.expect.txt b/highlight-js/test/markup/pgsql/options.expect.txt new file mode 100644 index 0000000..d9b4414 --- /dev/null +++ b/highlight-js/test/markup/pgsql/options.expect.txt @@ -0,0 +1,44 @@ +-- options of some commands + +WITH, WITH ( .. ), (), + -- alter/create role + SUPERUSER, NOSUPERUSER, CREATEDB, NOCREATEDB, CREATEROLE, NOCREATEROLE, INHERIT, NOINHERIT, + LOGIN, NOLOGIN, REPLICATION, NOREPLICATION, BYPASSRLS, NOBYPASSRLS, CONNECTION LIMIT 100, + ENCRYPTED PASSWORD, UNENCRYPTED PASSWORD, VALID UNTIL '2020-01-01', + IN ROLE, IN GROUP, ROLE, ADMIN, USER, SYSID; + -- copy + FORMAT, OIDS, FREEZE, DELIMITER, NULL '..', HEADER, QUOTE, ESCAPE, FORCE_QUOTE, + FORCE_NOT_NULL, FORCE_NULL, ENCODING; + -- create aggregate + BASETYPE=, SFUNC=, STYPE=, SSPACE=, FINALFUNC=, FINALFUNC_EXTRA=, + FINALFUNC_MODIFY=, COMBINEFUNC=, SERIALFUNC=, DESERIALFUNC=, + INITCOND=, MSFUNC=, MINVFUNC=, MSTYPE=, MSSPACE=, MFINALFUNC=, MFINALFUNC_EXTRA=, + MFINALFUNC_MODIFY=, MINITCOND=, SORTOP=, PARALLEL=; + -- create collation + LOCALE=, LC_COLLATE=, LC_CTYPE=, PROVIDER=, VERSION=; + -- create dataase + OWNER=, TEMPLATE=, ENCODING=, LC_COLLATE=, LC_CTYPE=, TABLESPACE=, ALLOW_CONNECTIONS=, + CONNECTION LIMIT=, IS_TEMPLATE=; + -- create extension + SCHEMA, VERSION, FROM, CASCADE; + -- create operator + PROCEDURE=, LEFTARG=, RIGHTARG=, COMMUTATOR=, NEGATOR=, RESTRICT=, JOIN=, HASHES=, MERGES= + -- create text search configuration + PARSER=, COPY=; + -- create text search dictionary + TEMPLATE=; + -- create text search parser + START=, GETTOKEN=, END=, LEXTYPES=, HEADLINE=; + -- create text search template + INIT=, LEXIZE=; + -- create type + SUBTYPE=, SUBTYPE_OPCLASS=, COLLATION=, CANONICAL=, SUBTYPE_DIFF=, + INPUT=, OUTPUT=, RECEIVE=, SEND=, TYPMOD_IN=, TYPMOD_OUT=, ANALYZE=, INTERNALLENGTH=, PASSEDBYVALUE=, + ALIGNMENT=, STORAGE=, LIKE=, CATEGORY=, PREFERRED=, DEFAULT=, ELEMENT=, DELIMITER=, COLLATABLE=; + -- analyze/explain/vacuum + ANALYZE, VERBOSE, COSTS, BUFFERS, TIMING, SUMMARY, FORMAT TEXT, FORMAT XML, FORMAT JSON, + FORMAT YAML, FREEZE, FULL, DISABLE_PAGE_SKIPPING; + +-- table like options + +TABLE t1(LIKE t1 INCLUDING COMMENTS INCLUDING CONSTRAINTS EXCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE EXCLUDING ALL); diff --git a/highlight-js/test/markup/pgsql/options.txt b/highlight-js/test/markup/pgsql/options.txt new file mode 100644 index 0000000..17627c7 --- /dev/null +++ b/highlight-js/test/markup/pgsql/options.txt @@ -0,0 +1,44 @@ +-- options of some commands + +WITH, WITH ( .. ), (), + -- alter/create role + SUPERUSER, NOSUPERUSER, CREATEDB, NOCREATEDB, CREATEROLE, NOCREATEROLE, INHERIT, NOINHERIT, + LOGIN, NOLOGIN, REPLICATION, NOREPLICATION, BYPASSRLS, NOBYPASSRLS, CONNECTION LIMIT 100, + ENCRYPTED PASSWORD, UNENCRYPTED PASSWORD, VALID UNTIL '2020-01-01', + IN ROLE, IN GROUP, ROLE, ADMIN, USER, SYSID; + -- copy + FORMAT, OIDS, FREEZE, DELIMITER, NULL '..', HEADER, QUOTE, ESCAPE, FORCE_QUOTE, + FORCE_NOT_NULL, FORCE_NULL, ENCODING; + -- create aggregate + BASETYPE=, SFUNC=, STYPE=, SSPACE=, FINALFUNC=, FINALFUNC_EXTRA=, + FINALFUNC_MODIFY=, COMBINEFUNC=, SERIALFUNC=, DESERIALFUNC=, + INITCOND=, MSFUNC=, MINVFUNC=, MSTYPE=, MSSPACE=, MFINALFUNC=, MFINALFUNC_EXTRA=, + MFINALFUNC_MODIFY=, MINITCOND=, SORTOP=, PARALLEL=; + -- create collation + LOCALE=, LC_COLLATE=, LC_CTYPE=, PROVIDER=, VERSION=; + -- create dataase + OWNER=, TEMPLATE=, ENCODING=, LC_COLLATE=, LC_CTYPE=, TABLESPACE=, ALLOW_CONNECTIONS=, + CONNECTION LIMIT=, IS_TEMPLATE=; + -- create extension + SCHEMA, VERSION, FROM, CASCADE; + -- create operator + PROCEDURE=, LEFTARG=, RIGHTARG=, COMMUTATOR=, NEGATOR=, RESTRICT=, JOIN=, HASHES=, MERGES= + -- create text search configuration + PARSER=, COPY=; + -- create text search dictionary + TEMPLATE=; + -- create text search parser + START=, GETTOKEN=, END=, LEXTYPES=, HEADLINE=; + -- create text search template + INIT=, LEXIZE=; + -- create type + SUBTYPE=, SUBTYPE_OPCLASS=, COLLATION=, CANONICAL=, SUBTYPE_DIFF=, + INPUT=, OUTPUT=, RECEIVE=, SEND=, TYPMOD_IN=, TYPMOD_OUT=, ANALYZE=, INTERNALLENGTH=, PASSEDBYVALUE=, + ALIGNMENT=, STORAGE=, LIKE=, CATEGORY=, PREFERRED=, DEFAULT=, ELEMENT=, DELIMITER=, COLLATABLE=; + -- analyze/explain/vacuum + ANALYZE, VERBOSE, COSTS, BUFFERS, TIMING, SUMMARY, FORMAT TEXT, FORMAT XML, FORMAT JSON, + FORMAT YAML, FREEZE, FULL, DISABLE_PAGE_SKIPPING; + +-- table like options + +TABLE t1(LIKE t1 INCLUDING COMMENTS INCLUDING CONSTRAINTS EXCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE EXCLUDING ALL); diff --git a/highlight-js/test/markup/pgsql/plpgsql.expect.txt b/highlight-js/test/markup/pgsql/plpgsql.expect.txt new file mode 100644 index 0000000..5b1c494 --- /dev/null +++ b/highlight-js/test/markup/pgsql/plpgsql.expect.txt @@ -0,0 +1,61 @@ +-- PL/pgSQL + +<< outerblock >> +DECLARE + quantity integer := 30; + subtotal ALIAS FOR $1; + prior ALIAS FOR old; + arow record; + curs1 refcursor; + curs2 CURSOR FOR SELECT * FROM tenk1; +BEGIN + DECLARE + quantity CONSTANT integer := 80; + myrow tablename%ROWTYPE; + myfield tablename.columnname%TYPE; + BEGIN + PERFORM pg_sleep(1); + RAISE NOTICE 'Quantity here is %', quantity; + END; + + SELECT * INTO myrec FROM emp WHERE empname = myname; + + IF NOT FOUND THEN + EXIT <<outer_block>>; + ELSIF quantity < 0 THEN + ASSERT a > b, 'Bad luck'; + END IF; + + FOR r IN SELECT * FROM foo LOOP + CONTINUE WHEN count < 50; + END LOOP; + + FOR i IN REVERSE 10..1 LOOP + FOREACH x IN ARRAY $1 + LOOP + s := s + x; + END LOOP; + END LOOP; + + WHILE NOT done LOOP + CASE x + WHEN 1, 2 THEN RETURN NEXT r; + ELSE RETURN QUERY SELECT * FROM sales; + END CASE; + END LOOP; + + EXECUTE 'SELECT count(*) FROM mytable WHERE inserted_by = $1' INTO c USING checked_user; + + OPEN curs1 SCROLL FOR SELECT * FROM foo WHERE key = mykey; + FETCH LAST FROM curs1 INTO x, y; + MOVE RELATIVE -2 FROM curs1; + UPDATE foo SET dataval = myval WHERE CURRENT OF curs1; + CLOSE curs1; + + RETURN quantity; +EXCEPTION + WHEN NO_DATA_FOUND THEN + GET DIAGNOSTICS integer_var = ROW_COUNT; + WHEN SQLSTATE '22012' THEN + NULL; +END; diff --git a/highlight-js/test/markup/pgsql/plpgsql.txt b/highlight-js/test/markup/pgsql/plpgsql.txt new file mode 100644 index 0000000..fcb22d1 --- /dev/null +++ b/highlight-js/test/markup/pgsql/plpgsql.txt @@ -0,0 +1,61 @@ +-- PL/pgSQL + +<< outerblock >> +DECLARE + quantity integer := 30; + subtotal ALIAS FOR $1; + prior ALIAS FOR old; + arow record; + curs1 refcursor; + curs2 CURSOR FOR SELECT * FROM tenk1; +BEGIN + DECLARE + quantity CONSTANT integer := 80; + myrow tablename%ROWTYPE; + myfield tablename.columnname%TYPE; + BEGIN + PERFORM pg_sleep(1); + RAISE NOTICE 'Quantity here is %', quantity; + END; + + SELECT * INTO myrec FROM emp WHERE empname = myname; + + IF NOT FOUND THEN + EXIT <>; + ELSIF quantity < 0 THEN + ASSERT a > b, 'Bad luck'; + END IF; + + FOR r IN SELECT * FROM foo LOOP + CONTINUE WHEN count < 50; + END LOOP; + + FOR i IN REVERSE 10..1 LOOP + FOREACH x IN ARRAY $1 + LOOP + s := s + x; + END LOOP; + END LOOP; + + WHILE NOT done LOOP + CASE x + WHEN 1, 2 THEN RETURN NEXT r; + ELSE RETURN QUERY SELECT * FROM sales; + END CASE; + END LOOP; + + EXECUTE 'SELECT count(*) FROM mytable WHERE inserted_by = $1' INTO c USING checked_user; + + OPEN curs1 SCROLL FOR SELECT * FROM foo WHERE key = mykey; + FETCH LAST FROM curs1 INTO x, y; + MOVE RELATIVE -2 FROM curs1; + UPDATE foo SET dataval = myval WHERE CURRENT OF curs1; + CLOSE curs1; + + RETURN quantity; +EXCEPTION + WHEN NO_DATA_FOUND THEN + GET DIAGNOSTICS integer_var = ROW_COUNT; + WHEN SQLSTATE '22012' THEN + NULL; +END; diff --git a/highlight-js/test/markup/pgsql/sql-commands.expect.txt b/highlight-js/test/markup/pgsql/sql-commands.expect.txt new file mode 100644 index 0000000..1b48f4f --- /dev/null +++ b/highlight-js/test/markup/pgsql/sql-commands.expect.txt @@ -0,0 +1,99 @@ +-- SQL Commands + +ABORT WORK, ABORT TRANSACTION, +ANALYZE, +BEGIN WORK, BEGIN TRANSACTION, +CALL, +CHECKPOINT, +CLOSE, +CLUSTER, +COMMENT, +COMMIT WORK, COMMIT TRANSACTION, +COMMIT PREPARED, +COPY, +CREATE, ALTER, DROP + ACCESS METHOD, + AGGREGATE, + CAST, + COLLATION, + CONVERSION, + DATABASE, + DOMAIN, + EVENT TRIGGER, + EXTENSION, + FOREIGN DATA WRAPPER, + FOREIGN TABLE, + FUNCTION, + GROUP, + INDEX, + LANGUAGE, + MATERIALIZED VIEW, + OPERATOR, + OPERATOR CLASS, + OPERATOR FAMILY, + POLICY, + PROCEDURE, + PUBLICATION, + ROLE, + ROUTINE, + RULE, + SCHEMA, + SEQUENCE, + SERVER, + STATISTICS, + SUBSCRIPTION, + TABLE, + TABLESPACE, + TEXT SEARCH CONFIGURATION, + TEXT SEARCH DICTIONARY, + TEXT SEARCH PARSER, + TEXT SEARCH TEMPLATE, + TRANSFORM, + TRIGGER, + TYPE, + USER, + USER MAPPING, + VIEW, +DEALLOCATE, +DECLARE, +DELETE, +DISCARD, +DO, +END WORK, END TRANSACTION, +EXECUTE, +EXPLAIN, +FETCH, +GRANT, +IMPORT FOREIGN SCHEMA, +INSERT, +LISTEN, +LOAD, +LOCK, +MOVE, +NOTIFY, +PREPARE, +PREPARE TRANSACTION, +REASSIGN OWNED, +REFRESH MATERIALIZED VIEW, +REINDEX, +RELEASE SAVEPOINT, +RESET, +REVOKE, +ROLLBACK WORK, ROLLBACK TRANSACTION, +ROLLBACK PREPARED, +ROLLBACK TO SAVEPOINT, +SAVEPOINT, +SECURITY LABEL, +SELECT, +SET, +SET CONSTRAINTS, +SET ROLE, RESET ROLE, +SET SESSION AUTHORIZATION, RESET SESSION AUTHORIZATION, +SET TRANSACTION, SET SESSION CHARACTERISTICS AS TRANSACTION, +SHOW, +START TRANSACTION, +TRUNCATE, +UNLISTEN, +UPDATE, +VACUUM, +VALUES; diff --git a/highlight-js/test/markup/pgsql/sql-commands.txt b/highlight-js/test/markup/pgsql/sql-commands.txt new file mode 100644 index 0000000..7f8ae69 --- /dev/null +++ b/highlight-js/test/markup/pgsql/sql-commands.txt @@ -0,0 +1,99 @@ +-- SQL Commands + +ABORT WORK, ABORT TRANSACTION, +ANALYZE, +BEGIN WORK, BEGIN TRANSACTION, +CALL, +CHECKPOINT, +CLOSE, +CLUSTER, +COMMENT, +COMMIT WORK, COMMIT TRANSACTION, +COMMIT PREPARED, +COPY, +CREATE, ALTER, DROP + ACCESS METHOD, + AGGREGATE, + CAST, + COLLATION, + CONVERSION, + DATABASE, + DOMAIN, + EVENT TRIGGER, + EXTENSION, + FOREIGN DATA WRAPPER, + FOREIGN TABLE, + FUNCTION, + GROUP, + INDEX, + LANGUAGE, + MATERIALIZED VIEW, + OPERATOR, + OPERATOR CLASS, + OPERATOR FAMILY, + POLICY, + PROCEDURE, + PUBLICATION, + ROLE, + ROUTINE, + RULE, + SCHEMA, + SEQUENCE, + SERVER, + STATISTICS, + SUBSCRIPTION, + TABLE, + TABLESPACE, + TEXT SEARCH CONFIGURATION, + TEXT SEARCH DICTIONARY, + TEXT SEARCH PARSER, + TEXT SEARCH TEMPLATE, + TRANSFORM, + TRIGGER, + TYPE, + USER, + USER MAPPING, + VIEW, +DEALLOCATE, +DECLARE, +DELETE, +DISCARD, +DO, +END WORK, END TRANSACTION, +EXECUTE, +EXPLAIN, +FETCH, +GRANT, +IMPORT FOREIGN SCHEMA, +INSERT, +LISTEN, +LOAD, +LOCK, +MOVE, +NOTIFY, +PREPARE, +PREPARE TRANSACTION, +REASSIGN OWNED, +REFRESH MATERIALIZED VIEW, +REINDEX, +RELEASE SAVEPOINT, +RESET, +REVOKE, +ROLLBACK WORK, ROLLBACK TRANSACTION, +ROLLBACK PREPARED, +ROLLBACK TO SAVEPOINT, +SAVEPOINT, +SECURITY LABEL, +SELECT, +SET, +SET CONSTRAINTS, +SET ROLE, RESET ROLE, +SET SESSION AUTHORIZATION, RESET SESSION AUTHORIZATION, +SET TRANSACTION, SET SESSION CHARACTERISTICS AS TRANSACTION, +SHOW, +START TRANSACTION, +TRUNCATE, +UNLISTEN, +UPDATE, +VACUUM, +VALUES; diff --git a/highlight-js/test/markup/pgsql/window-functions.expect.txt b/highlight-js/test/markup/pgsql/window-functions.expect.txt new file mode 100644 index 0000000..ef85a33 --- /dev/null +++ b/highlight-js/test/markup/pgsql/window-functions.expect.txt @@ -0,0 +1,35 @@ +-- window functions + +-- frame clause: + +RANGE UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +RANGE 10 PRECEDING EXCLUDE GROUP, +RANGE CURRENT ROW EXCLUDE TIES, +RANGE 10 FOLLOWING EXCLUDE NO OTHERS, +RANGE UNBOUNDED FOLLOWING, +RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +ROWS UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +ROWS 10 PRECEDING EXCLUDE GROUP, +ROWS CURRENT ROW EXCLUDE TIES, +ROWS 10 FOLLOWING EXCLUDE NO OTHERS, +ROWS UNBOUNDED FOLLOWING, +ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +GROUPS UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +GROUPS 10 PRECEDING EXCLUDE GROUP, +GROUPS CURRENT ROW EXCLUDE TIES, +GROUPS 10 FOLLOWING EXCLUDE NO OTHERS, +GROUPS UNBOUNDED FOLLOWING, +GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +-- examples + +SELECT string_agg(empno, ',' ORDER BY a) FROM empsalary; +SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households; +SELECT count(*) FILTER (WHERE i < 5) FROM generate_series(1,10) AS s(i); +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary; +SELECT salary, sum(salary) OVER (ORDER BY salary) FROM empsalary; +SELECT sum(salary) OVER w, avg(salary) OVER w + FROM empsalary + WINDOW w AS (PARTITION BY depname ORDER BY salary DESC); diff --git a/highlight-js/test/markup/pgsql/window-functions.txt b/highlight-js/test/markup/pgsql/window-functions.txt new file mode 100644 index 0000000..8050fea --- /dev/null +++ b/highlight-js/test/markup/pgsql/window-functions.txt @@ -0,0 +1,35 @@ +-- window functions + +-- frame clause: + +RANGE UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +RANGE 10 PRECEDING EXCLUDE GROUP, +RANGE CURRENT ROW EXCLUDE TIES, +RANGE 10 FOLLOWING EXCLUDE NO OTHERS, +RANGE UNBOUNDED FOLLOWING, +RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +ROWS UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +ROWS 10 PRECEDING EXCLUDE GROUP, +ROWS CURRENT ROW EXCLUDE TIES, +ROWS 10 FOLLOWING EXCLUDE NO OTHERS, +ROWS UNBOUNDED FOLLOWING, +ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +GROUPS UNBOUNDED PRECEDING EXCLUDE CURRENT ROW, +GROUPS 10 PRECEDING EXCLUDE GROUP, +GROUPS CURRENT ROW EXCLUDE TIES, +GROUPS 10 FOLLOWING EXCLUDE NO OTHERS, +GROUPS UNBOUNDED FOLLOWING, +GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW; + +-- examples + +SELECT string_agg(empno, ',' ORDER BY a) FROM empsalary; +SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households; +SELECT count(*) FILTER (WHERE i < 5) FROM generate_series(1,10) AS s(i); +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary; +SELECT salary, sum(salary) OVER (ORDER BY salary) FROM empsalary; +SELECT sum(salary) OVER w, avg(salary) OVER w + FROM empsalary + WINDOW w AS (PARTITION BY depname ORDER BY salary DESC); diff --git a/highlight-js/test/markup/pgsql/xml.expect.txt b/highlight-js/test/markup/pgsql/xml.expect.txt new file mode 100644 index 0000000..93ca3f6 --- /dev/null +++ b/highlight-js/test/markup/pgsql/xml.expect.txt @@ -0,0 +1,47 @@ +-- xml + +XMLPARSE (DOCUMENT '...' PRESERVE WHITESPACE) +XMLPARSE (CONTENT '...' STRIP WHITESPACE) +XMLSERIALIZE ( DOCUMENT '...' AS text ) +XMLSERIALIZE ( CONTENT '...' AS text ) + +SET XML OPTION DOCUMENT; +SET XML OPTION CONTENT; + +SELECT xmlcomment('...'); +SELECT xmlconcat('...', '...'); +SELECT xmlelement(name foo, xmlattributes('...' as bar)); +SELECT xmlforest('...' AS foo, 123 AS bar); +SELECT xmlpi(name php, '...'); +SELECT xmlroot(xmlparse(document '...'), version '...', standalone yes); +SELECT xmlagg(x ORDER BY y DESC) FROM test; + +SELECT xmlexists('...' PASSING BY REF '...'); + +SELECT xpath('...', '...', ARRAY[ARRAY['...', '...']]); +SELECT xpath_exists('...', '...', ARRAY[ARRAY['...', '...']]); + +SELECT XMLTABLE('...' PASSING data COLUMNS id int PATH '...' DEFAULT '...', ordinality FOR ORDINALITY) ; + +SELECT XMLTABLE(XMLNAMESPACES('...' AS x, '...' AS "B"), '...' PASSING (SELECT data FROM xmldata) COLUMNS foo int PATH '...'); + +foo IS DOCUMENT +foo IS NOT DOCUMENT + +xml_is_well_formed(..) +xml_is_well_formed_document(..) +xml_is_well_formed_content(..) +table_to_xml(..) +query_to_xml(..) +cursor_to_xml(..) +table_to_xmlschema(..) +query_to_xmlschema(..) +cursor_to_xmlschema(..) +table_to_xml_and_xmlschema(..) +query_to_xml_and_xmlschema(..) +schema_to_xml(..) +schema_to_xmlschema(..) +schema_to_xml_and_xmlschema(..) +database_to_xml(..) +database_to_xmlschema(..) +database_to_xml_and_xmlschema(..) diff --git a/highlight-js/test/markup/pgsql/xml.txt b/highlight-js/test/markup/pgsql/xml.txt new file mode 100644 index 0000000..f925216 --- /dev/null +++ b/highlight-js/test/markup/pgsql/xml.txt @@ -0,0 +1,47 @@ +-- xml + +XMLPARSE (DOCUMENT '...' PRESERVE WHITESPACE) +XMLPARSE (CONTENT '...' STRIP WHITESPACE) +XMLSERIALIZE ( DOCUMENT '...' AS text ) +XMLSERIALIZE ( CONTENT '...' AS text ) + +SET XML OPTION DOCUMENT; +SET XML OPTION CONTENT; + +SELECT xmlcomment('...'); +SELECT xmlconcat('...', '...'); +SELECT xmlelement(name foo, xmlattributes('...' as bar)); +SELECT xmlforest('...' AS foo, 123 AS bar); +SELECT xmlpi(name php, '...'); +SELECT xmlroot(xmlparse(document '...'), version '...', standalone yes); +SELECT xmlagg(x ORDER BY y DESC) FROM test; + +SELECT xmlexists('...' PASSING BY REF '...'); + +SELECT xpath('...', '...', ARRAY[ARRAY['...', '...']]); +SELECT xpath_exists('...', '...', ARRAY[ARRAY['...', '...']]); + +SELECT XMLTABLE('...' PASSING data COLUMNS id int PATH '...' DEFAULT '...', ordinality FOR ORDINALITY) ; + +SELECT XMLTABLE(XMLNAMESPACES('...' AS x, '...' AS "B"), '...' PASSING (SELECT data FROM xmldata) COLUMNS foo int PATH '...'); + +foo IS DOCUMENT +foo IS NOT DOCUMENT + +xml_is_well_formed(..) +xml_is_well_formed_document(..) +xml_is_well_formed_content(..) +table_to_xml(..) +query_to_xml(..) +cursor_to_xml(..) +table_to_xmlschema(..) +query_to_xmlschema(..) +cursor_to_xmlschema(..) +table_to_xml_and_xmlschema(..) +query_to_xml_and_xmlschema(..) +schema_to_xml(..) +schema_to_xmlschema(..) +schema_to_xml_and_xmlschema(..) +database_to_xml(..) +database_to_xmlschema(..) +database_to_xml_and_xmlschema(..) diff --git a/highlight-js/test/markup/php/comments.expect.txt b/highlight-js/test/markup/php/comments.expect.txt new file mode 100644 index 0000000..a9e3312 --- /dev/null +++ b/highlight-js/test/markup/php/comments.expect.txt @@ -0,0 +1,19 @@ +<?php + +/** + * @param int $a + * @return bool + */ +function isEven($a) { + return ($a % 2) === 0; +} + +/** + * TODO: Rely on isEven, but do not highlight bug. + * + * @param int $a + * @return bool + */ +function isOdd($a) { + return ($a % 2) === 1; +} diff --git a/highlight-js/test/markup/php/comments.txt b/highlight-js/test/markup/php/comments.txt new file mode 100644 index 0000000..f709f20 --- /dev/null +++ b/highlight-js/test/markup/php/comments.txt @@ -0,0 +1,19 @@ +echo <<<EOT +String with $var and {$foo->bar[1]}. +EOT; + +echo <<<EOT + string + EOT + still string +EOT; + +array(<<<EOD +foobar! +EOD +); diff --git a/highlight-js/test/markup/php/heredoc.txt b/highlight-js/test/markup/php/heredoc.txt new file mode 100644 index 0000000..443d5fa --- /dev/null +++ b/highlight-js/test/markup/php/heredoc.txt @@ -0,0 +1,14 @@ +echo <<bar[1]}. +EOT; + +echo <<new create(name': String) => + name = name' + 'a' diff --git a/highlight-js/test/markup/pony/prime.txt b/highlight-js/test/markup/pony/prime.txt new file mode 100644 index 0000000..fdea080 --- /dev/null +++ b/highlight-js/test/markup/pony/prime.txt @@ -0,0 +1,2 @@ +new create(name': String) => + name = name' + 'a' diff --git a/highlight-js/test/markup/powershell/apos-herestring.expect.txt b/highlight-js/test/markup/powershell/apos-herestring.expect.txt new file mode 100644 index 0000000..8323231 --- /dev/null +++ b/highlight-js/test/markup/powershell/apos-herestring.expect.txt @@ -0,0 +1,11 @@ +@' The wild cat jumped over the $height-tall fence. + He did so with grace. +'@ + +This SHOULDNT be a part of the above strings span. + +@' The wild cat jumped over the $height-tall fence. + He did so with grace. +break-end-of-string'@ + +This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/highlight-js/test/markup/powershell/apos-herestring.txt b/highlight-js/test/markup/powershell/apos-herestring.txt new file mode 100644 index 0000000..704be67 --- /dev/null +++ b/highlight-js/test/markup/powershell/apos-herestring.txt @@ -0,0 +1,11 @@ +@' The wild cat jumped over the $height-tall fence. + He did so with grace. +'@ + +This SHOULDNT be a part of the above strings span. + +@' The wild cat jumped over the $height-tall fence. + He did so with grace. +break-end-of-string'@ + +This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/highlight-js/test/markup/powershell/quote-herestring.expect.txt b/highlight-js/test/markup/powershell/quote-herestring.expect.txt new file mode 100644 index 0000000..3095015 --- /dev/null +++ b/highlight-js/test/markup/powershell/quote-herestring.expect.txt @@ -0,0 +1,11 @@ +@" The wild cat jumped over the $height-tall fence. + He did so with grace. +"@ + +This SHOULDNT be a part of the above strings span. + +@" The wild cat jumped over the $height-tall fence. + He did so with grace. +break-end-of-string"@ + +This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/highlight-js/test/markup/powershell/quote-herestring.txt b/highlight-js/test/markup/powershell/quote-herestring.txt new file mode 100644 index 0000000..5f352dc --- /dev/null +++ b/highlight-js/test/markup/powershell/quote-herestring.txt @@ -0,0 +1,11 @@ +@" The wild cat jumped over the $height-tall fence. + He did so with grace. +"@ + +This SHOULDNT be a part of the above strings span. + +@" The wild cat jumped over the $height-tall fence. + He did so with grace. +break-end-of-string"@ + +This SHOULD be a part of the above strings span. \ No newline at end of file diff --git a/highlight-js/test/markup/properties/syntax.expect.txt b/highlight-js/test/markup/properties/syntax.expect.txt new file mode 100644 index 0000000..45b473a --- /dev/null +++ b/highlight-js/test/markup/properties/syntax.expect.txt @@ -0,0 +1,14 @@ +# comment + # comment +! comment + ! comment +key=val +key = val +key:val +key : val +key val +key val +key = val\ + val +key\ key\:\= val +key diff --git a/highlight-js/test/markup/properties/syntax.txt b/highlight-js/test/markup/properties/syntax.txt new file mode 100644 index 0000000..76a4a2b --- /dev/null +++ b/highlight-js/test/markup/properties/syntax.txt @@ -0,0 +1,14 @@ +# comment + # comment +! comment + ! comment +key=val +key = val +key:val +key : val +key val +key val +key = val\ + val +key\ key\:\= val +key diff --git a/highlight-js/test/markup/protobuf/message-message.expect.txt b/highlight-js/test/markup/protobuf/message-message.expect.txt new file mode 100644 index 0000000..a2d827b --- /dev/null +++ b/highlight-js/test/markup/protobuf/message-message.expect.txt @@ -0,0 +1,7 @@ +message Container { + message Message { + required int64 id = 1; + } + repeated Message messages = 1; + optional int32 number = 2; +} diff --git a/highlight-js/test/markup/protobuf/message-message.txt b/highlight-js/test/markup/protobuf/message-message.txt new file mode 100644 index 0000000..c4b6667 --- /dev/null +++ b/highlight-js/test/markup/protobuf/message-message.txt @@ -0,0 +1,7 @@ +message Container { + message Message { + required int64 id = 1; + } + repeated Message messages = 1; + optional int32 number = 2; +} diff --git a/highlight-js/test/markup/python/escaped-quotes.expect.txt b/highlight-js/test/markup/python/escaped-quotes.expect.txt new file mode 100644 index 0000000..baabb66 --- /dev/null +++ b/highlight-js/test/markup/python/escaped-quotes.expect.txt @@ -0,0 +1,43 @@ +'''text \''' text''' +u'''text \''' text''' +b'''text \''' text''' +r'''text \''' text''' +ur'''text \''' text''' +br'''text \''' text''' + +"""text \""" text""" +u"""text \""" text""" +b"""text \""" text""" +r"""text \""" text""" +ur"""text \""" text""" +br"""text \""" text""" + +f'''text \''' text''' +fr'''text \''' text''' +rf'''text \''' text''' + +f"""text \""" text""" +fr"""text \""" text""" +rf"""text \""" text""" + +u'text \' text' +r'text \' text' +ur'text \' text' + +u"text \" text" +r"text \" text" +ur"text \" text" + +b'text \' text' +br'text \' text' + +b"text \" text" +br"text \" text" + +f'text \' text' +fr'text \' text' +rf'text \' text' + +f"text \" text" +fr"text \" text" +rf"text \" text" \ No newline at end of file diff --git a/highlight-js/test/markup/python/escaped-quotes.txt b/highlight-js/test/markup/python/escaped-quotes.txt new file mode 100644 index 0000000..68040c9 --- /dev/null +++ b/highlight-js/test/markup/python/escaped-quotes.txt @@ -0,0 +1,43 @@ +'''text \''' text''' +u'''text \''' text''' +b'''text \''' text''' +r'''text \''' text''' +ur'''text \''' text''' +br'''text \''' text''' + +"""text \""" text""" +u"""text \""" text""" +b"""text \""" text""" +r"""text \""" text""" +ur"""text \""" text""" +br"""text \""" text""" + +f'''text \''' text''' +fr'''text \''' text''' +rf'''text \''' text''' + +f"""text \""" text""" +fr"""text \""" text""" +rf"""text \""" text""" + +u'text \' text' +r'text \' text' +ur'text \' text' + +u"text \" text" +r"text \" text" +ur"text \" text" + +b'text \' text' +br'text \' text' + +b"text \" text" +br"text \" text" + +f'text \' text' +fr'text \' text' +rf'text \' text' + +f"text \" text" +fr"text \" text" +rf"text \" text" \ No newline at end of file diff --git a/highlight-js/test/markup/python/f-strings.expect.txt b/highlight-js/test/markup/python/f-strings.expect.txt new file mode 100644 index 0000000..7453e27 --- /dev/null +++ b/highlight-js/test/markup/python/f-strings.expect.txt @@ -0,0 +1,10 @@ +f'{name}' +f"{name + 5}" +>>> f""" +... { +... name +... } +... """ +rf"{name}" +fr"{name}" +f"{name + f'{name}'}" diff --git a/highlight-js/test/markup/python/f-strings.txt b/highlight-js/test/markup/python/f-strings.txt new file mode 100644 index 0000000..cc28a84 --- /dev/null +++ b/highlight-js/test/markup/python/f-strings.txt @@ -0,0 +1,10 @@ +f'{name}' +f"{name + 5}" +>>> f""" +... { +... name +... } +... """ +rf"{name}" +fr"{name}" +f"{name + f'{name}'}" diff --git a/highlight-js/test/markup/python/function-header.expect.txt b/highlight-js/test/markup/python/function-header.expect.txt new file mode 100644 index 0000000..cf3c8e5 --- /dev/null +++ b/highlight-js/test/markup/python/function-header.expect.txt @@ -0,0 +1,2 @@ +def f(x: int) -> None: + pass diff --git a/highlight-js/test/markup/python/function-header.txt b/highlight-js/test/markup/python/function-header.txt new file mode 100644 index 0000000..793e3be --- /dev/null +++ b/highlight-js/test/markup/python/function-header.txt @@ -0,0 +1,2 @@ +def f(x: int) -> None: + pass diff --git a/highlight-js/test/markup/python/matrix-multiplication.expect.txt b/highlight-js/test/markup/python/matrix-multiplication.expect.txt new file mode 100644 index 0000000..97323a1 --- /dev/null +++ b/highlight-js/test/markup/python/matrix-multiplication.expect.txt @@ -0,0 +1,7 @@ +@meta +class C: + + @decorator + def f(self, H, V, beta, r): + S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) + return S diff --git a/highlight-js/test/markup/python/matrix-multiplication.txt b/highlight-js/test/markup/python/matrix-multiplication.txt new file mode 100644 index 0000000..1dfff4c --- /dev/null +++ b/highlight-js/test/markup/python/matrix-multiplication.txt @@ -0,0 +1,7 @@ +@meta +class C: + + @decorator + def f(self, H, V, beta, r): + S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) + return S diff --git a/highlight-js/test/markup/reasonml/functions.expect.txt b/highlight-js/test/markup/reasonml/functions.expect.txt new file mode 100644 index 0000000..bd4ad81 --- /dev/null +++ b/highlight-js/test/markup/reasonml/functions.expect.txt @@ -0,0 +1,22 @@ +/* This is a simple function */ +let greet = (name) => "Hello World"; + +let body = `Plain("uploaded " ++ cacheServiceConfig.desc ++ "configuration data into cache on S3"); + +let getCacheConfigByEnv = + ( + environment: environment, + cacheServiceConfig: Js.Dict.t(cachingServiceConfig) + ) => + switch (cacheServiceConfig) { + | Some(config) => config + | None => + raise(InvalidEnvironment("Caching Service Coinfiguration is missing")) + }; + +let readCacheServiceConfigAndDecode = (configJson) => + switch (configJson |> Js.Json.decodeObject) { + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | Some(data) => + data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) + }; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/functions.txt b/highlight-js/test/markup/reasonml/functions.txt new file mode 100644 index 0000000..f03ce9e --- /dev/null +++ b/highlight-js/test/markup/reasonml/functions.txt @@ -0,0 +1,22 @@ +/* This is a simple function */ +let greet = (name) => "Hello World"; + +let body = `Plain("uploaded " ++ cacheServiceConfig.desc ++ "configuration data into cache on S3"); + +let getCacheConfigByEnv = + ( + environment: environment, + cacheServiceConfig: Js.Dict.t(cachingServiceConfig) + ) => + switch (cacheServiceConfig) { + | Some(config) => config + | None => + raise(InvalidEnvironment("Caching Service Coinfiguration is missing")) + }; + +let readCacheServiceConfigAndDecode = (configJson) => + switch (configJson |> Js.Json.decodeObject) { + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | Some(data) => + data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) + }; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/literals.expect.txt b/highlight-js/test/markup/reasonml/literals.expect.txt new file mode 100644 index 0000000..ac88232 --- /dev/null +++ b/highlight-js/test/markup/reasonml/literals.expect.txt @@ -0,0 +1,41 @@ +let i = 14; +let i = (-14); +let i = 1000; +let i = 0b100; +let i = 0x1FF; +let i = 0o777; +let i64 = 128L; +let i64 = 0b10L; +let i32 = 32l; +let i32 = 0x12l; +let nat = 10n; +let nat = 0o644n; +let f = 5.; +let f = 5.1; +let f = 1e+1; +let f = 1e1; +let f = 1e-1; +let f = 1024e12; +let f = 1L; + +let f = 23.0 +. 1.0; +let f = 2 / 23 * 1; +let f = 2.0 /. 23.0 *. 1.0; +let exp = 2.0 ** 2.0; + +let structual = true == false; +let reference = true === false; + +let b = true || false; +let l = []; +let a = [||]; +let arr = [|1, 2, 3|]; +let b = [item1, item2, ...theRest]; +let () = ignore(b); + +let str = "a" ++ "b"; + +let c = 'a'; +let c = '\xFF'; +let c = '\128'; +let c = '\n'; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/literals.txt b/highlight-js/test/markup/reasonml/literals.txt new file mode 100644 index 0000000..d0f624d --- /dev/null +++ b/highlight-js/test/markup/reasonml/literals.txt @@ -0,0 +1,41 @@ +let i = 14; +let i = (-14); +let i = 1000; +let i = 0b100; +let i = 0x1FF; +let i = 0o777; +let i64 = 128L; +let i64 = 0b10L; +let i32 = 32l; +let i32 = 0x12l; +let nat = 10n; +let nat = 0o644n; +let f = 5.; +let f = 5.1; +let f = 1e+1; +let f = 1e1; +let f = 1e-1; +let f = 1024e12; +let f = 1L; + +let f = 23.0 +. 1.0; +let f = 2 / 23 * 1; +let f = 2.0 /. 23.0 *. 1.0; +let exp = 2.0 ** 2.0; + +let structual = true == false; +let reference = true === false; + +let b = true || false; +let l = []; +let a = [||]; +let arr = [|1, 2, 3|]; +let b = [item1, item2, ...theRest]; +let () = ignore(b); + +let str = "a" ++ "b"; + +let c = 'a'; +let c = '\xFF'; +let c = '\128'; +let c = '\n'; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/modules.expect.txt b/highlight-js/test/markup/reasonml/modules.expect.txt new file mode 100644 index 0000000..cff5a61 --- /dev/null +++ b/highlight-js/test/markup/reasonml/modules.expect.txt @@ -0,0 +1,19 @@ +let decode = json => + Json.Decode.{ + query: json |> field("query", string), + cacheKey: json |> field("cacheKey", string), + desc: json |> field("desc", string), + lambda: json |> field("lambda", string), + }; + +Some.Bucket.Of.( + let value = stuff(); +); + +let value = Some.Bucket.Of.stuff(); + +module type RewiredModule = { + type t = { + name: string + }; +}; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/modules.txt b/highlight-js/test/markup/reasonml/modules.txt new file mode 100644 index 0000000..014ac4e --- /dev/null +++ b/highlight-js/test/markup/reasonml/modules.txt @@ -0,0 +1,19 @@ +let decode = json => + Json.Decode.{ + query: json |> field("query", string), + cacheKey: json |> field("cacheKey", string), + desc: json |> field("desc", string), + lambda: json |> field("lambda", string), + }; + +Some.Bucket.Of.( + let value = stuff(); +); + +let value = Some.Bucket.Of.stuff(); + +module type RewiredModule = { + type t = { + name: string + }; +}; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/pattern-matching.expect.txt b/highlight-js/test/markup/reasonml/pattern-matching.expect.txt new file mode 100644 index 0000000..8ce0a3d --- /dev/null +++ b/highlight-js/test/markup/reasonml/pattern-matching.expect.txt @@ -0,0 +1,20 @@ +let message = + switch (person1) { + | School.Teacher => "Hello teacher!" + | School.Director => "Hello director!" + }; + +let message = + School.( + switch (person1) { + | Teacher => "Hello teacher!" + | Director => "Hello director!" + } + ); + +let readCacheServiceConfigAndDecode = (configJson) => + switch (configJson |> Js.Json.decodeObject) { + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | Some(data) => + data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) + }; \ No newline at end of file diff --git a/highlight-js/test/markup/reasonml/pattern-matching.txt b/highlight-js/test/markup/reasonml/pattern-matching.txt new file mode 100644 index 0000000..af87fa6 --- /dev/null +++ b/highlight-js/test/markup/reasonml/pattern-matching.txt @@ -0,0 +1,20 @@ +let message = + switch (person1) { + | School.Teacher => "Hello teacher!" + | School.Director => "Hello director!" + }; + +let message = + School.( + switch (person1) { + | Teacher => "Hello teacher!" + | Director => "Hello director!" + } + ); + +let readCacheServiceConfigAndDecode = (configJson) => + switch (configJson |> Js.Json.decodeObject) { + | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) + | Some(data) => + data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) + }; diff --git a/highlight-js/test/markup/ruby/gemfile.expect.txt b/highlight-js/test/markup/ruby/gemfile.expect.txt new file mode 100644 index 0000000..6051fc8 --- /dev/null +++ b/highlight-js/test/markup/ruby/gemfile.expect.txt @@ -0,0 +1,3 @@ +gem "gem_name1", ">= 4.1" + +gem "gem_name2", "~> 4.1" diff --git a/highlight-js/test/markup/ruby/gemfile.txt b/highlight-js/test/markup/ruby/gemfile.txt new file mode 100644 index 0000000..bab6a60 --- /dev/null +++ b/highlight-js/test/markup/ruby/gemfile.txt @@ -0,0 +1,3 @@ +gem "gem_name1", ">= 4.1" + +gem "gem_name2", "~> 4.1" diff --git a/highlight-js/test/markup/ruby/heredoc.expect.txt b/highlight-js/test/markup/ruby/heredoc.expect.txt new file mode 100644 index 0000000..18e27a5 --- /dev/null +++ b/highlight-js/test/markup/ruby/heredoc.expect.txt @@ -0,0 +1,8 @@ +def foo() + msg = <<-HTML + <div> + <h4>#{bar}</h4> + </div> + HTML + +def baz() diff --git a/highlight-js/test/markup/ruby/heredoc.txt b/highlight-js/test/markup/ruby/heredoc.txt new file mode 100644 index 0000000..15a8f08 --- /dev/null +++ b/highlight-js/test/markup/ruby/heredoc.txt @@ -0,0 +1,8 @@ +def foo() + msg = <<-HTML +
    +

    #{bar}

    +
    + HTML + +def baz() diff --git a/highlight-js/test/markup/ruby/prompt.expect.txt b/highlight-js/test/markup/ruby/prompt.expect.txt new file mode 100644 index 0000000..b4634e6 --- /dev/null +++ b/highlight-js/test/markup/ruby/prompt.expect.txt @@ -0,0 +1,23 @@ +2.0.0p0 :001 > ['some'] + => ["some"] +2.0.0p0 :002 > if true +2.0.0p0 :003?> "yop" +2.0.0p0 :004?> end + => "yop" + +jruby-1.7.16 :001 > "RVM-Format" + +>> obj = OpenStruct.new :integer => 987, :symbol => :so_great +=> #<OpenStruct integer=987, symbol=:so_great> +>> [obj,obj,obj] +=> [#<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>, #<OpenStruct integer=987, symbol=:so_great>] +>> {1 => obj, 2 => obj} +=> {1=>#<OpenStruct integer=987, symbol=:so_great>, 2=>#<OpenStruct integer=987, symbol=:so_great>} +>> if 10 > 20 +>> "YEAH" +>> else +?> "NO" +>> end +=> "NO" + +irb(main):002:0> test = 1 diff --git a/highlight-js/test/markup/ruby/prompt.txt b/highlight-js/test/markup/ruby/prompt.txt new file mode 100644 index 0000000..9ef7be6 --- /dev/null +++ b/highlight-js/test/markup/ruby/prompt.txt @@ -0,0 +1,23 @@ +2.0.0p0 :001 > ['some'] + => ["some"] +2.0.0p0 :002 > if true +2.0.0p0 :003?> "yop" +2.0.0p0 :004?> end + => "yop" + +jruby-1.7.16 :001 > "RVM-Format" + +>> obj = OpenStruct.new :integer => 987, :symbol => :so_great +=> # +>> [obj,obj,obj] +=> [#, #, #] +>> {1 => obj, 2 => obj} +=> {1=>#, 2=>#} +>> if 10 > 20 +>> "YEAH" +>> else +?> "NO" +>> end +=> "NO" + +irb(main):002:0> test = 1 diff --git a/highlight-js/test/markup/ruby/regexes.expect.txt b/highlight-js/test/markup/ruby/regexes.expect.txt new file mode 100644 index 0000000..0c10838 --- /dev/null +++ b/highlight-js/test/markup/ruby/regexes.expect.txt @@ -0,0 +1,5 @@ +str =~ /^(?:foo)$/ +str =~ %r{foo|bar|buz$} +str =~ %r!foo|bar$! +str =~ %r[foo|bar$] +str =~ %r(\(foo|bar\)$) diff --git a/highlight-js/test/markup/ruby/regexes.txt b/highlight-js/test/markup/ruby/regexes.txt new file mode 100644 index 0000000..9d31e03 --- /dev/null +++ b/highlight-js/test/markup/ruby/regexes.txt @@ -0,0 +1,5 @@ +str =~ /^(?:foo)$/ +str =~ %r{foo|bar|buz$} +str =~ %r!foo|bar$! +str =~ %r[foo|bar$] +str =~ %r(\(foo|bar\)$) diff --git a/highlight-js/test/markup/rust/comments.expect.txt b/highlight-js/test/markup/rust/comments.expect.txt new file mode 100644 index 0000000..bdc3090 --- /dev/null +++ b/highlight-js/test/markup/rust/comments.expect.txt @@ -0,0 +1,3 @@ +/* rust has +/* nested /* block */ */ +*/ comments diff --git a/highlight-js/test/markup/rust/comments.txt b/highlight-js/test/markup/rust/comments.txt new file mode 100644 index 0000000..d265d56 --- /dev/null +++ b/highlight-js/test/markup/rust/comments.txt @@ -0,0 +1,3 @@ +/* rust has +/* nested /* block */ */ +*/ comments diff --git a/highlight-js/test/markup/rust/numbers.expect.txt b/highlight-js/test/markup/rust/numbers.expect.txt new file mode 100644 index 0000000..64d7954 --- /dev/null +++ b/highlight-js/test/markup/rust/numbers.expect.txt @@ -0,0 +1,13 @@ +123; +123usize; +123_usize; +0xff00; +0xff_u8; +0b1111111110010000; +0b1111_1111_1001_0000_i32; +0o764317; +0o764317_u16; +123.0; +0.1; +0.1f32; +12E+99_f64; diff --git a/highlight-js/test/markup/rust/numbers.txt b/highlight-js/test/markup/rust/numbers.txt new file mode 100644 index 0000000..798e8b7 --- /dev/null +++ b/highlight-js/test/markup/rust/numbers.txt @@ -0,0 +1,13 @@ +123; +123usize; +123_usize; +0xff00; +0xff_u8; +0b1111111110010000; +0b1111_1111_1001_0000_i32; +0o764317; +0o764317_u16; +123.0; +0.1; +0.1f32; +12E+99_f64; diff --git a/highlight-js/test/markup/rust/strings.expect.txt b/highlight-js/test/markup/rust/strings.expect.txt new file mode 100644 index 0000000..c36dd7c --- /dev/null +++ b/highlight-js/test/markup/rust/strings.expect.txt @@ -0,0 +1,14 @@ +'a'; +'\n'; +'\x1A'; +'\u12AS'; +'\U1234ASDF'; +b'a'; + +"hello"; +b"hello"; + +r"hello"; +r###"world"###; +r##" "### +"# "##; diff --git a/highlight-js/test/markup/rust/strings.txt b/highlight-js/test/markup/rust/strings.txt new file mode 100644 index 0000000..5a3da73 --- /dev/null +++ b/highlight-js/test/markup/rust/strings.txt @@ -0,0 +1,14 @@ +'a'; +'\n'; +'\x1A'; +'\u12AS'; +'\U1234ASDF'; +b'a'; + +"hello"; +b"hello"; + +r"hello"; +r###"world"###; +r##" "### +"# "##; diff --git a/highlight-js/test/markup/rust/traits.expect.txt b/highlight-js/test/markup/rust/traits.expect.txt new file mode 100644 index 0000000..2a96d67 --- /dev/null +++ b/highlight-js/test/markup/rust/traits.expect.txt @@ -0,0 +1,3 @@ +fn sqr(i: i32) { i * i } +trait Minimum : Copy {} +pub trait Builder where Self: Sized + Iterator<Item=Event> {} diff --git a/highlight-js/test/markup/rust/traits.txt b/highlight-js/test/markup/rust/traits.txt new file mode 100644 index 0000000..1a5b20d --- /dev/null +++ b/highlight-js/test/markup/rust/traits.txt @@ -0,0 +1,3 @@ +fn sqr(i: i32) { i * i } +trait Minimum : Copy {} +pub trait Builder where Self: Sized + Iterator {} diff --git a/highlight-js/test/markup/rust/types.expect.txt b/highlight-js/test/markup/rust/types.expect.txt new file mode 100644 index 0000000..65ca8fd --- /dev/null +++ b/highlight-js/test/markup/rust/types.expect.txt @@ -0,0 +1,4 @@ +type A: Trait; +type A; +type A = B; +type R<T> = m::R<T, ConcreteError> diff --git a/highlight-js/test/markup/rust/types.txt b/highlight-js/test/markup/rust/types.txt new file mode 100644 index 0000000..b8644e4 --- /dev/null +++ b/highlight-js/test/markup/rust/types.txt @@ -0,0 +1,4 @@ +type A: Trait; +type A; +type A = B; +type R = m::R diff --git a/highlight-js/test/markup/rust/variables.expect.txt b/highlight-js/test/markup/rust/variables.expect.txt new file mode 100644 index 0000000..a601118 --- /dev/null +++ b/highlight-js/test/markup/rust/variables.expect.txt @@ -0,0 +1,3 @@ +let foo; +let mut bar; +let _foo_bar; diff --git a/highlight-js/test/markup/rust/variables.txt b/highlight-js/test/markup/rust/variables.txt new file mode 100644 index 0000000..26420c1 --- /dev/null +++ b/highlight-js/test/markup/rust/variables.txt @@ -0,0 +1,3 @@ +let foo; +let mut bar; +let _foo_bar; diff --git a/highlight-js/test/markup/scala/case-classes.expect.txt b/highlight-js/test/markup/scala/case-classes.expect.txt new file mode 100644 index 0000000..162499f --- /dev/null +++ b/highlight-js/test/markup/scala/case-classes.expect.txt @@ -0,0 +1,3 @@ +abstract class Vertical extends CaseJeu +case class Haut(name: String) extends Vertical +case class Bas(name: String) extends Vertical diff --git a/highlight-js/test/markup/scala/case-classes.txt b/highlight-js/test/markup/scala/case-classes.txt new file mode 100644 index 0000000..7b41555 --- /dev/null +++ b/highlight-js/test/markup/scala/case-classes.txt @@ -0,0 +1,3 @@ +abstract class Vertical extends CaseJeu +case class Haut(name: String) extends Vertical +case class Bas(name: String) extends Vertical diff --git a/highlight-js/test/markup/scheme/lambda.expect.txt b/highlight-js/test/markup/scheme/lambda.expect.txt new file mode 100644 index 0000000..12c5b8e --- /dev/null +++ b/highlight-js/test/markup/scheme/lambda.expect.txt @@ -0,0 +1 @@ +(lambda (x y z) (+ y z)) diff --git a/highlight-js/test/markup/scheme/lambda.txt b/highlight-js/test/markup/scheme/lambda.txt new file mode 100644 index 0000000..bcc4840 --- /dev/null +++ b/highlight-js/test/markup/scheme/lambda.txt @@ -0,0 +1 @@ +(lambda (x y z) (+ y z)) diff --git a/highlight-js/test/markup/scheme/quoted.expect.txt b/highlight-js/test/markup/scheme/quoted.expect.txt new file mode 100644 index 0000000..a5bb8a8 --- /dev/null +++ b/highlight-js/test/markup/scheme/quoted.expect.txt @@ -0,0 +1 @@ +(scheme 'a '(a quoted (list)) `(quoted)) diff --git a/highlight-js/test/markup/scheme/quoted.txt b/highlight-js/test/markup/scheme/quoted.txt new file mode 100644 index 0000000..8b44e05 --- /dev/null +++ b/highlight-js/test/markup/scheme/quoted.txt @@ -0,0 +1 @@ +(scheme 'a '(a quoted (list)) `(quoted)) diff --git a/highlight-js/test/markup/sql/interval.expect.txt b/highlight-js/test/markup/sql/interval.expect.txt new file mode 100644 index 0000000..77073bf --- /dev/null +++ b/highlight-js/test/markup/sql/interval.expect.txt @@ -0,0 +1,17 @@ +SELECT + CURRENT_TIMESTAMP + - INTERVAL 2 YEARS + + INTERVAL 1 MONTH + - INTERVAL 3 DAYS + + INTERVAL 10 HOURS + + interval 30 MINUTES + - INTERVAL 20 SECOND AS past_timestamp +FROM VALUES ("dummy"); + +WITH ts AS ( + SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy') + ) +SELECT + now - INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS AS LONG_VERSION, + now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION +FROM ts; diff --git a/highlight-js/test/markup/sql/interval.txt b/highlight-js/test/markup/sql/interval.txt new file mode 100644 index 0000000..9f1657d --- /dev/null +++ b/highlight-js/test/markup/sql/interval.txt @@ -0,0 +1,17 @@ +SELECT + CURRENT_TIMESTAMP + - INTERVAL 2 YEARS + + INTERVAL 1 MONTH + - INTERVAL 3 DAYS + + INTERVAL 10 HOURS + + interval 30 MINUTES + - INTERVAL 20 SECOND AS past_timestamp +FROM VALUES ("dummy"); + +WITH ts AS ( + SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy') + ) +SELECT + now - INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS AS LONG_VERSION, + now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION +FROM ts; diff --git a/highlight-js/test/markup/sql/join.expect.txt b/highlight-js/test/markup/sql/join.expect.txt new file mode 100644 index 0000000..2389a7c --- /dev/null +++ b/highlight-js/test/markup/sql/join.expect.txt @@ -0,0 +1,17 @@ +SELECT + left_table.col1 AS l_col1, + left_table.col2 AS l_col2 +FROM + VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table + ANTI JOIN + VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table + ON left_table.col1 = right_table.col1; + +SELECT + left_table.col1 AS l_col1, + left_table.col2 AS l_col2 +FROM + VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table + LEFT SEMI JOIN + VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table + ON left_table.col1 = right_table.col1; diff --git a/highlight-js/test/markup/sql/join.txt b/highlight-js/test/markup/sql/join.txt new file mode 100644 index 0000000..1383197 --- /dev/null +++ b/highlight-js/test/markup/sql/join.txt @@ -0,0 +1,17 @@ +SELECT + left_table.col1 AS l_col1, + left_table.col2 AS l_col2 +FROM + VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table + ANTI JOIN + VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table + ON left_table.col1 = right_table.col1; + +SELECT + left_table.col1 AS l_col1, + left_table.col2 AS l_col2 +FROM + VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table + LEFT SEMI JOIN + VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table + ON left_table.col1 = right_table.col1; diff --git a/highlight-js/test/markup/sql/keywords.expect.txt b/highlight-js/test/markup/sql/keywords.expect.txt new file mode 100644 index 0000000..b0e7270 --- /dev/null +++ b/highlight-js/test/markup/sql/keywords.expect.txt @@ -0,0 +1 @@ +select * from t where t.select is null; diff --git a/highlight-js/test/markup/sql/keywords.txt b/highlight-js/test/markup/sql/keywords.txt new file mode 100644 index 0000000..57ff166 --- /dev/null +++ b/highlight-js/test/markup/sql/keywords.txt @@ -0,0 +1 @@ +select * from t where t.select is null; diff --git a/highlight-js/test/markup/sql/lateral-view.expect.txt b/highlight-js/test/markup/sql/lateral-view.expect.txt new file mode 100644 index 0000000..006b309 --- /dev/null +++ b/highlight-js/test/markup/sql/lateral-view.expect.txt @@ -0,0 +1,7 @@ +SELECT + master_child.col1 AS master_id, + child_table.child_id +FROM VALUES + ( 1 , ARRAY(1,2,3)), + (2, ARRAY(4,5,6)) AS master_child +LATERAL VIEW EXPLODE(master_child.col2) child_table AS child_id; diff --git a/highlight-js/test/markup/sql/lateral-view.txt b/highlight-js/test/markup/sql/lateral-view.txt new file mode 100644 index 0000000..9a152f3 --- /dev/null +++ b/highlight-js/test/markup/sql/lateral-view.txt @@ -0,0 +1,7 @@ +SELECT + master_child.col1 AS master_id, + child_table.child_id +FROM VALUES + ( 1 , ARRAY(1,2,3)), + (2, ARRAY(4,5,6)) AS master_child +LATERAL VIEW EXPLODE(master_child.col2) child_table AS child_id; diff --git a/highlight-js/test/markup/sql/numeric-types.expect.txt b/highlight-js/test/markup/sql/numeric-types.expect.txt new file mode 100644 index 0000000..2f5e035 --- /dev/null +++ b/highlight-js/test/markup/sql/numeric-types.expect.txt @@ -0,0 +1 @@ +SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); diff --git a/highlight-js/test/markup/sql/numeric-types.txt b/highlight-js/test/markup/sql/numeric-types.txt new file mode 100644 index 0000000..ed7cec3 --- /dev/null +++ b/highlight-js/test/markup/sql/numeric-types.txt @@ -0,0 +1 @@ +SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); diff --git a/highlight-js/test/markup/sql/set-operator.expect.txt b/highlight-js/test/markup/sql/set-operator.expect.txt new file mode 100644 index 0000000..1c90ba5 --- /dev/null +++ b/highlight-js/test/markup/sql/set-operator.expect.txt @@ -0,0 +1 @@ +SELECT * FROM VALUES 1, 2 ,3 UNION ALL VALUES 1, 2, 3; diff --git a/highlight-js/test/markup/sql/set-operator.txt b/highlight-js/test/markup/sql/set-operator.txt new file mode 100644 index 0000000..2fce4ac --- /dev/null +++ b/highlight-js/test/markup/sql/set-operator.txt @@ -0,0 +1 @@ +SELECT * FROM VALUES 1, 2 ,3 UNION ALL VALUES 1, 2, 3; diff --git a/highlight-js/test/markup/sql/tablesample.expect.txt b/highlight-js/test/markup/sql/tablesample.expect.txt new file mode 100644 index 0000000..cb17d70 --- /dev/null +++ b/highlight-js/test/markup/sql/tablesample.expect.txt @@ -0,0 +1,5 @@ +SELECT * FROM orders TABLESAMPLE (500 ROWS); + +SELECT * FROM customers TABLESAMPLE (25 PERCENT); + +SELECT * FROM employees TABLESAMPLE (BUCKET 2 OUT OF 10); diff --git a/highlight-js/test/markup/sql/tablesample.txt b/highlight-js/test/markup/sql/tablesample.txt new file mode 100644 index 0000000..b9e50c1 --- /dev/null +++ b/highlight-js/test/markup/sql/tablesample.txt @@ -0,0 +1,5 @@ +SELECT * FROM orders TABLESAMPLE (500 ROWS); + +SELECT * FROM customers TABLESAMPLE (25 PERCENT); + +SELECT * FROM employees TABLESAMPLE (BUCKET 2 OUT OF 10); diff --git a/highlight-js/test/markup/sql/values-statement.expect.txt b/highlight-js/test/markup/sql/values-statement.expect.txt new file mode 100644 index 0000000..91a0d6f --- /dev/null +++ b/highlight-js/test/markup/sql/values-statement.expect.txt @@ -0,0 +1,7 @@ +VALUES 1, 2 , 3; + +VALUES + (1, 'Spock'), + (2,'Kirk') , + (3, 'McCoy'), + (4,'Scotty'); diff --git a/highlight-js/test/markup/sql/values-statement.txt b/highlight-js/test/markup/sql/values-statement.txt new file mode 100644 index 0000000..0245c70 --- /dev/null +++ b/highlight-js/test/markup/sql/values-statement.txt @@ -0,0 +1,7 @@ +VALUES 1, 2 , 3; + +VALUES + (1, 'Spock'), + (2,'Kirk') , + (3, 'McCoy'), + (4,'Scotty'); diff --git a/highlight-js/test/markup/sql/window-function.expect.txt b/highlight-js/test/markup/sql/window-function.expect.txt new file mode 100644 index 0000000..a6882aa --- /dev/null +++ b/highlight-js/test/markup/sql/window-function.expect.txt @@ -0,0 +1,23 @@ +SELECT * +FROM ( + SELECT + posts.col1 AS emp_id, + posts.col2 AS dept_id, + posts.col3 AS posts, + DENSE_RANK() OVER post_ranking AS rank + FROM VALUES + (1, 1 ,100), + (2, 1 ,50), + (8, 1 ,250), + (3, 2 ,200), + (4, 2 ,300), + (9, 2 ,1000), + (5, 3 ,300), + (6, 3 ,100), + (7, 3 ,400) AS posts + WINDOW post_ranking AS ( + PARTITION BY posts.col2 + ORDER BY posts.col3 DESC + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +) +WHERE rank <= 2; diff --git a/highlight-js/test/markup/sql/window-function.txt b/highlight-js/test/markup/sql/window-function.txt new file mode 100644 index 0000000..a3dbf70 --- /dev/null +++ b/highlight-js/test/markup/sql/window-function.txt @@ -0,0 +1,23 @@ +SELECT * +FROM ( + SELECT + posts.col1 AS emp_id, + posts.col2 AS dept_id, + posts.col3 AS posts, + DENSE_RANK() OVER post_ranking AS rank + FROM VALUES + (1, 1 ,100), + (2, 1 ,50), + (8, 1 ,250), + (3, 2 ,200), + (4, 2 ,300), + (9, 2 ,1000), + (5, 3 ,300), + (6, 3 ,100), + (7, 3 ,400) AS posts + WINDOW post_ranking AS ( + PARTITION BY posts.col2 + ORDER BY posts.col3 DESC + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +) +WHERE rank <= 2; diff --git a/highlight-js/test/markup/subunit/subunit-errorline.expect.txt b/highlight-js/test/markup/subunit/subunit-errorline.expect.txt new file mode 100644 index 0000000..bf91c68 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-errorline.expect.txt @@ -0,0 +1,2 @@ +error: test simplename +error: test simple name diff --git a/highlight-js/test/markup/subunit/subunit-errorline.txt b/highlight-js/test/markup/subunit/subunit-errorline.txt new file mode 100644 index 0000000..2203d79 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-errorline.txt @@ -0,0 +1,2 @@ +error: test simplename +error: test simple name diff --git a/highlight-js/test/markup/subunit/subunit-failureline.expect.txt b/highlight-js/test/markup/subunit/subunit-failureline.expect.txt new file mode 100644 index 0000000..b570feb --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-failureline.expect.txt @@ -0,0 +1,4 @@ +failure: test simplename1 +failure test simplename1 +failure: test simple name1 +failure test simple name1 diff --git a/highlight-js/test/markup/subunit/subunit-failureline.txt b/highlight-js/test/markup/subunit/subunit-failureline.txt new file mode 100644 index 0000000..495838c --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-failureline.txt @@ -0,0 +1,4 @@ +failure: test simplename1 +failure test simplename1 +failure: test simple name1 +failure test simple name1 diff --git a/highlight-js/test/markup/subunit/subunit-progressline.expect.txt b/highlight-js/test/markup/subunit/subunit-progressline.expect.txt new file mode 100644 index 0000000..d72d157 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-progressline.expect.txt @@ -0,0 +1,7 @@ +progress: +5 +progress: +12 +progress: 29 +progress: -3 +progress: -91 +progress: push +progress: pop diff --git a/highlight-js/test/markup/subunit/subunit-progressline.txt b/highlight-js/test/markup/subunit/subunit-progressline.txt new file mode 100644 index 0000000..157114c --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-progressline.txt @@ -0,0 +1,7 @@ +progress: +5 +progress: +12 +progress: 29 +progress: -3 +progress: -91 +progress: push +progress: pop diff --git a/highlight-js/test/markup/subunit/subunit-skipline.expect.txt b/highlight-js/test/markup/subunit/subunit-skipline.expect.txt new file mode 100644 index 0000000..7d34d4c --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-skipline.expect.txt @@ -0,0 +1,3 @@ +skip test simplename +skip: test simple name +skip test simple name diff --git a/highlight-js/test/markup/subunit/subunit-skipline.txt b/highlight-js/test/markup/subunit/subunit-skipline.txt new file mode 100644 index 0000000..e90c933 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-skipline.txt @@ -0,0 +1,3 @@ +skip test simplename +skip: test simple name +skip test simple name diff --git a/highlight-js/test/markup/subunit/subunit-successline.expect.txt b/highlight-js/test/markup/subunit/subunit-successline.expect.txt new file mode 100644 index 0000000..f3e3ea0 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-successline.expect.txt @@ -0,0 +1,8 @@ +success test simplename1 +success: test simplename2 +successful test simplename3 +successful: test simplename4 +success test simple name1 +success: test simple name2 +successful test simple name3 +successful: test simple name4 diff --git a/highlight-js/test/markup/subunit/subunit-successline.txt b/highlight-js/test/markup/subunit/subunit-successline.txt new file mode 100644 index 0000000..00b29e0 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-successline.txt @@ -0,0 +1,8 @@ +success test simplename1 +success: test simplename2 +successful test simplename3 +successful: test simplename4 +success test simple name1 +success: test simple name2 +successful test simple name3 +successful: test simple name4 diff --git a/highlight-js/test/markup/subunit/subunit-tagline.expect.txt b/highlight-js/test/markup/subunit/subunit-tagline.expect.txt new file mode 100644 index 0000000..cf91f36 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-tagline.expect.txt @@ -0,0 +1,5 @@ +tags: fuzz unit beta functional +tags: -functional basic -beta +tags: -unit +tags: unit +tags: ddd diff --git a/highlight-js/test/markup/subunit/subunit-tagline.txt b/highlight-js/test/markup/subunit/subunit-tagline.txt new file mode 100644 index 0000000..6e8d521 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-tagline.txt @@ -0,0 +1,5 @@ +tags: fuzz unit beta functional +tags: -functional basic -beta +tags: -unit +tags: unit +tags: ddd diff --git a/highlight-js/test/markup/subunit/subunit-testline.expect.txt b/highlight-js/test/markup/subunit/subunit-testline.expect.txt new file mode 100644 index 0000000..f60f1a8 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-testline.expect.txt @@ -0,0 +1,10 @@ +test: test basicsuite1 +testing: test basicsuite1 +test test basicsuite1 +testing test basicsuite1 +test: test basic suite1 +testing: test basic suite1 +test test basic suite1 +testing test basic suite1 +testing test basic +test test 222 diff --git a/highlight-js/test/markup/subunit/subunit-testline.txt b/highlight-js/test/markup/subunit/subunit-testline.txt new file mode 100644 index 0000000..c11fd6d --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-testline.txt @@ -0,0 +1,10 @@ +test: test basicsuite1 +testing: test basicsuite1 +test test basicsuite1 +testing test basicsuite1 +test: test basic suite1 +testing: test basic suite1 +test test basic suite1 +testing test basic suite1 +testing test basic +test test 222 diff --git a/highlight-js/test/markup/subunit/subunit-timeline.expect.txt b/highlight-js/test/markup/subunit/subunit-timeline.expect.txt new file mode 100644 index 0000000..897ca50 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-timeline.expect.txt @@ -0,0 +1,3 @@ +time: 2016-03-13 18:12:37.231080Z +time: 1917-10-25 09:05:37.231080Z +time: 1984-03-24 07:02:09.231080Z diff --git a/highlight-js/test/markup/subunit/subunit-timeline.txt b/highlight-js/test/markup/subunit/subunit-timeline.txt new file mode 100644 index 0000000..1bd6510 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-timeline.txt @@ -0,0 +1,3 @@ +time: 2016-03-13 18:12:37.231080Z +time: 1917-10-25 09:05:37.231080Z +time: 1984-03-24 07:02:09.231080Z diff --git a/highlight-js/test/markup/subunit/subunit-uxsuccessline.expect.txt b/highlight-js/test/markup/subunit/subunit-uxsuccessline.expect.txt new file mode 100644 index 0000000..e773e46 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-uxsuccessline.expect.txt @@ -0,0 +1,3 @@ +uxsuccess test simplename +uxsuccess: test simple name +uxsuccess test simple name diff --git a/highlight-js/test/markup/subunit/subunit-uxsuccessline.txt b/highlight-js/test/markup/subunit/subunit-uxsuccessline.txt new file mode 100644 index 0000000..399a254 --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-uxsuccessline.txt @@ -0,0 +1,3 @@ +uxsuccess test simplename +uxsuccess: test simple name +uxsuccess test simple name diff --git a/highlight-js/test/markup/subunit/subunit-xfailline.expect.txt b/highlight-js/test/markup/subunit/subunit-xfailline.expect.txt new file mode 100644 index 0000000..944c83f --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-xfailline.expect.txt @@ -0,0 +1,3 @@ +xfail test simplename +xfail: test simple name +xfail test simple name diff --git a/highlight-js/test/markup/subunit/subunit-xfailline.txt b/highlight-js/test/markup/subunit/subunit-xfailline.txt new file mode 100644 index 0000000..de0fabb --- /dev/null +++ b/highlight-js/test/markup/subunit/subunit-xfailline.txt @@ -0,0 +1,3 @@ +xfail test simplename +xfail: test simple name +xfail test simple name diff --git a/highlight-js/test/markup/swift/functions.expect.txt b/highlight-js/test/markup/swift/functions.expect.txt new file mode 100644 index 0000000..a83afdf --- /dev/null +++ b/highlight-js/test/markup/swift/functions.expect.txt @@ -0,0 +1,10 @@ +protocol Protocol { + func f1() + func f2() +} + +class MyClass { + func f() { + return true + } +} diff --git a/highlight-js/test/markup/swift/functions.txt b/highlight-js/test/markup/swift/functions.txt new file mode 100644 index 0000000..cfd64ae --- /dev/null +++ b/highlight-js/test/markup/swift/functions.txt @@ -0,0 +1,10 @@ +protocol Protocol { + func f1() + func f2() +} + +class MyClass { + func f() { + return true + } +} diff --git a/highlight-js/test/markup/swift/multiline-string.expect.txt b/highlight-js/test/markup/swift/multiline-string.expect.txt new file mode 100644 index 0000000..452c44b --- /dev/null +++ b/highlight-js/test/markup/swift/multiline-string.expect.txt @@ -0,0 +1,3 @@ +var string = """ + var a = not actually code +""" \ No newline at end of file diff --git a/highlight-js/test/markup/swift/multiline-string.txt b/highlight-js/test/markup/swift/multiline-string.txt new file mode 100644 index 0000000..56db376 --- /dev/null +++ b/highlight-js/test/markup/swift/multiline-string.txt @@ -0,0 +1,3 @@ +var string = """ + var a = not actually code +""" \ No newline at end of file diff --git a/highlight-js/test/markup/tap/basic.expect.txt b/highlight-js/test/markup/tap/basic.expect.txt new file mode 100644 index 0000000..b0788be --- /dev/null +++ b/highlight-js/test/markup/tap/basic.expect.txt @@ -0,0 +1,5 @@ +1..4 +ok 1 - Input file opened +not ok 2 - First line of the input valid +ok 3 - Read the rest of the file +not ok 4 - Summarized correctly # TODO Not written yet diff --git a/highlight-js/test/markup/tap/basic.txt b/highlight-js/test/markup/tap/basic.txt new file mode 100644 index 0000000..a0e46dd --- /dev/null +++ b/highlight-js/test/markup/tap/basic.txt @@ -0,0 +1,5 @@ +1..4 +ok 1 - Input file opened +not ok 2 - First line of the input valid +ok 3 - Read the rest of the file +not ok 4 - Summarized correctly # TODO Not written yet diff --git a/highlight-js/test/markup/tap/without-numbers.expect.txt b/highlight-js/test/markup/tap/without-numbers.expect.txt new file mode 100644 index 0000000..2df4830 --- /dev/null +++ b/highlight-js/test/markup/tap/without-numbers.expect.txt @@ -0,0 +1,6 @@ +1..6 +not ok +ok +not ok +ok +ok diff --git a/highlight-js/test/markup/tap/without-numbers.txt b/highlight-js/test/markup/tap/without-numbers.txt new file mode 100644 index 0000000..1b9be5a --- /dev/null +++ b/highlight-js/test/markup/tap/without-numbers.txt @@ -0,0 +1,6 @@ +1..6 +not ok +ok +not ok +ok +ok diff --git a/highlight-js/test/markup/tap/yaml-block.expect.txt b/highlight-js/test/markup/tap/yaml-block.expect.txt new file mode 100644 index 0000000..9ec1463 --- /dev/null +++ b/highlight-js/test/markup/tap/yaml-block.expect.txt @@ -0,0 +1,26 @@ +TAP version 13 +ok - created Board +ok +ok +ok +ok +ok +ok +ok + --- + message: "Board layout" + severity: comment + dump: + board: + - ' 16G 05C ' + - ' G N C C C G ' + - ' G C + ' + - '10C 01G 03C ' + - 'R N G G A G C C C ' + - ' R G C + ' + - ' 01G 17C 00C ' + - ' G A G G N R R N R ' + - ' G R G ' + ... +ok - board has 7 tiles + starter tile +1..9 diff --git a/highlight-js/test/markup/tap/yaml-block.txt b/highlight-js/test/markup/tap/yaml-block.txt new file mode 100644 index 0000000..23503b9 --- /dev/null +++ b/highlight-js/test/markup/tap/yaml-block.txt @@ -0,0 +1,26 @@ +TAP version 13 +ok - created Board +ok +ok +ok +ok +ok +ok +ok + --- + message: "Board layout" + severity: comment + dump: + board: + - ' 16G 05C ' + - ' G N C C C G ' + - ' G C + ' + - '10C 01G 03C ' + - 'R N G G A G C C C ' + - ' R G C + ' + - ' 01G 17C 00C ' + - ' G A G G N R R N R ' + - ' G R G ' + ... +ok - board has 7 tiles + starter tile +1..9 diff --git a/highlight-js/test/markup/twig/filter_with_underscore.expect.txt b/highlight-js/test/markup/twig/filter_with_underscore.expect.txt new file mode 100644 index 0000000..b08eb55 --- /dev/null +++ b/highlight-js/test/markup/twig/filter_with_underscore.expect.txt @@ -0,0 +1 @@ +{{ "string with spaces"|url_encode }} diff --git a/highlight-js/test/markup/twig/filter_with_underscore.txt b/highlight-js/test/markup/twig/filter_with_underscore.txt new file mode 100644 index 0000000..14f61f0 --- /dev/null +++ b/highlight-js/test/markup/twig/filter_with_underscore.txt @@ -0,0 +1 @@ +{{ "string with spaces"|url_encode }} \ No newline at end of file diff --git a/highlight-js/test/markup/twig/template_tags.expect.txt b/highlight-js/test/markup/twig/template_tags.expect.txt new file mode 100644 index 0000000..a4840a2 --- /dev/null +++ b/highlight-js/test/markup/twig/template_tags.expect.txt @@ -0,0 +1,12 @@ +{% if posts|length %} + {% for article in articles %} + &lt;div&gt; + {{ article.title|upper() }} + + {# outputs 'WELCOME' #} + &lt;/div&gt; + {% endfor %} +{% endif %} + +{% set user = json_encode(user) %} + diff --git a/highlight-js/test/markup/twig/template_tags.txt b/highlight-js/test/markup/twig/template_tags.txt new file mode 100644 index 0000000..23bd8ab --- /dev/null +++ b/highlight-js/test/markup/twig/template_tags.txt @@ -0,0 +1,11 @@ +{% if posts|length %} + {% for article in articles %} + <div> + {{ article.title|upper() }} + + {# outputs 'WELCOME' #} + </div> + {% endfor %} +{% endif %} + +{% set user = json_encode(user) %} diff --git a/highlight-js/test/markup/typescript/class.expect.txt b/highlight-js/test/markup/typescript/class.expect.txt new file mode 100644 index 0000000..ff99191 --- /dev/null +++ b/highlight-js/test/markup/typescript/class.expect.txt @@ -0,0 +1,11 @@ +class Car extends Vehicle { + constructor(speed, cost) { + super(speed); + + var c = Symbol('cost'); + this[c] = cost; + + this.intro = `This is a car runs at + ${speed}.`; + } +} diff --git a/highlight-js/test/markup/typescript/class.txt b/highlight-js/test/markup/typescript/class.txt new file mode 100644 index 0000000..47fa67c --- /dev/null +++ b/highlight-js/test/markup/typescript/class.txt @@ -0,0 +1,11 @@ +class Car extends Vehicle { + constructor(speed, cost) { + super(speed); + + var c = Symbol('cost'); + this[c] = cost; + + this.intro = `This is a car runs at + ${speed}.`; + } +} diff --git a/highlight-js/test/markup/typescript/decorator-factories.expect.txt b/highlight-js/test/markup/typescript/decorator-factories.expect.txt new file mode 100644 index 0000000..08582b3 --- /dev/null +++ b/highlight-js/test/markup/typescript/decorator-factories.expect.txt @@ -0,0 +1,13 @@ +@foo('foo') +export class MyClass { + @baz(123) + private myAttribute: string; + + constructor(@bar(true) private x, + @bar(qux(quux(true))) private y) { } + + @bar() + private myMethod(@bar() z) { + console.log('Hello world.'); + } +} \ No newline at end of file diff --git a/highlight-js/test/markup/typescript/decorator-factories.txt b/highlight-js/test/markup/typescript/decorator-factories.txt new file mode 100644 index 0000000..c8081c6 --- /dev/null +++ b/highlight-js/test/markup/typescript/decorator-factories.txt @@ -0,0 +1,13 @@ +@foo('foo') +export class MyClass { + @baz(123) + private myAttribute: string; + + constructor(@bar(true) private x, + @bar(qux(quux(true))) private y) { } + + @bar() + private myMethod(@bar() z) { + console.log('Hello world.'); + } +} \ No newline at end of file diff --git a/highlight-js/test/markup/typescript/functions.expect.txt b/highlight-js/test/markup/typescript/functions.expect.txt new file mode 100644 index 0000000..efff5b5 --- /dev/null +++ b/highlight-js/test/markup/typescript/functions.expect.txt @@ -0,0 +1,11 @@ +var noop = function() {}; + +var identity = function(foo) { + return foo; +}; + +function println(value: string); + +function getArray(): number[] { + return [1, 2]; +} \ No newline at end of file diff --git a/highlight-js/test/markup/typescript/functions.txt b/highlight-js/test/markup/typescript/functions.txt new file mode 100644 index 0000000..5e4f9a9 --- /dev/null +++ b/highlight-js/test/markup/typescript/functions.txt @@ -0,0 +1,11 @@ +var noop = function() {}; + +var identity = function(foo) { + return foo; +}; + +function println(value: string); + +function getArray(): number[] { + return [1, 2]; +} diff --git a/highlight-js/test/markup/typescript/jsx.expect.txt b/highlight-js/test/markup/typescript/jsx.expect.txt new file mode 100644 index 0000000..8d3c418 --- /dev/null +++ b/highlight-js/test/markup/typescript/jsx.expect.txt @@ -0,0 +1,41 @@ +export function getModuleInstanceState(node: Node): ModuleInstanceState { + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === SyntaxKind.InterfaceDeclaration || node.kind === SyntaxKind.TypeAliasDeclaration) { + return ModuleInstanceState.NonInstantiated; + } + // 2. const enum declarations + else if (isConstEnumDeclaration(node)) { + return ModuleInstanceState.ConstEnumOnly; + } + // 3. non-exported import declarations + else if ((node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) && !(node.flags & NodeFlags.Export)) { + return ModuleInstanceState.NonInstantiated; + } + // 4. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock) { + let state = ModuleInstanceState.NonInstantiated; + forEachChild(node, n => { + switch (getModuleInstanceState(n)) { + case ModuleInstanceState.NonInstantiated: + // child is non-instantiated - continue searching + return false; + case ModuleInstanceState.ConstEnumOnly: + // child is const enum only - record state and continue searching + state = ModuleInstanceState.ConstEnumOnly; + return false; + case ModuleInstanceState.Instantiated: + // child is instantiated - record state and stop + state = ModuleInstanceState.Instantiated; + return true; + } + }); + return state; + } + else if (node.kind === SyntaxKind.ModuleDeclaration) { + return getModuleInstanceState((<ModuleDeclaration>node).body); + } + else { + return ModuleInstanceState.Instantiated; + } +} diff --git a/highlight-js/test/markup/typescript/jsx.txt b/highlight-js/test/markup/typescript/jsx.txt new file mode 100644 index 0000000..72d8fe3 --- /dev/null +++ b/highlight-js/test/markup/typescript/jsx.txt @@ -0,0 +1,41 @@ +export function getModuleInstanceState(node: Node): ModuleInstanceState { + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === SyntaxKind.InterfaceDeclaration || node.kind === SyntaxKind.TypeAliasDeclaration) { + return ModuleInstanceState.NonInstantiated; + } + // 2. const enum declarations + else if (isConstEnumDeclaration(node)) { + return ModuleInstanceState.ConstEnumOnly; + } + // 3. non-exported import declarations + else if ((node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) && !(node.flags & NodeFlags.Export)) { + return ModuleInstanceState.NonInstantiated; + } + // 4. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock) { + let state = ModuleInstanceState.NonInstantiated; + forEachChild(node, n => { + switch (getModuleInstanceState(n)) { + case ModuleInstanceState.NonInstantiated: + // child is non-instantiated - continue searching + return false; + case ModuleInstanceState.ConstEnumOnly: + // child is const enum only - record state and continue searching + state = ModuleInstanceState.ConstEnumOnly; + return false; + case ModuleInstanceState.Instantiated: + // child is instantiated - record state and stop + state = ModuleInstanceState.Instantiated; + return true; + } + }); + return state; + } + else if (node.kind === SyntaxKind.ModuleDeclaration) { + return getModuleInstanceState((node).body); + } + else { + return ModuleInstanceState.Instantiated; + } +} diff --git a/highlight-js/test/markup/typescript/module-id.expect.txt b/highlight-js/test/markup/typescript/module-id.expect.txt new file mode 100644 index 0000000..ae1092f --- /dev/null +++ b/highlight-js/test/markup/typescript/module-id.expect.txt @@ -0,0 +1,14 @@ +@Component({ + selector: 'my-example', + directives: [SomeDirective], + templateUrl: './my-example.component.html', + moduleId: module.id, + styles: [` + .my-example { + padding: 5px; + } + `] +}) +export class MyExampleComponent { + someProp: string = "blah"; +} diff --git a/highlight-js/test/markup/typescript/module-id.txt b/highlight-js/test/markup/typescript/module-id.txt new file mode 100644 index 0000000..ed0ebbb --- /dev/null +++ b/highlight-js/test/markup/typescript/module-id.txt @@ -0,0 +1,14 @@ +@Component({ + selector: 'my-example', + directives: [SomeDirective], + templateUrl: './my-example.component.html', + moduleId: module.id, + styles: [` + .my-example { + padding: 5px; + } + `] +}) +export class MyExampleComponent { + someProp: string = "blah"; +} \ No newline at end of file diff --git a/highlight-js/test/markup/verilog/misc.expect.txt b/highlight-js/test/markup/verilog/misc.expect.txt new file mode 100644 index 0000000..e665ae1 --- /dev/null +++ b/highlight-js/test/markup/verilog/misc.expect.txt @@ -0,0 +1,37 @@ +`timescale 1ns / 1ps + +/** + * counter: a generic clearable up-counter + */ + +module counter + #(parameter WIDTH=64) + ( + input clk, + input ce, + input arst_n, + output reg [WIDTH-1:0] q + ); + + // some child + clock_buffer #(WIDTH) buffer_inst ( + .clk(clk), + .ce(ce), + .reset(arst_n) + ); + + // Simple gated up-counter with async clear + + always @(posedge clk or negedge arst_n) begin + if (arst_n == 1'b0) begin + q <= {WIDTH {1'b0}}; + end + else begin + q <= q; + if (ce == 1'b1) begin + q <= q + 1; + end + end + end + +endmodule diff --git a/highlight-js/test/markup/verilog/misc.txt b/highlight-js/test/markup/verilog/misc.txt new file mode 100644 index 0000000..5db8cfd --- /dev/null +++ b/highlight-js/test/markup/verilog/misc.txt @@ -0,0 +1,37 @@ +`timescale 1ns / 1ps + +/** + * counter: a generic clearable up-counter + */ + +module counter + #(parameter WIDTH=64) + ( + input clk, + input ce, + input arst_n, + output reg [WIDTH-1:0] q + ); + + // some child + clock_buffer #(WIDTH) buffer_inst ( + .clk(clk), + .ce(ce), + .reset(arst_n) + ); + + // Simple gated up-counter with async clear + + always @(posedge clk or negedge arst_n) begin + if (arst_n == 1'b0) begin + q <= {WIDTH {1'b0}}; + end + else begin + q <= q; + if (ce == 1'b1) begin + q <= q + 1; + end + end + end + +endmodule diff --git a/highlight-js/test/markup/verilog/numbers.expect.txt b/highlight-js/test/markup/verilog/numbers.expect.txt new file mode 100644 index 0000000..d29935f --- /dev/null +++ b/highlight-js/test/markup/verilog/numbers.expect.txt @@ -0,0 +1,8 @@ +a = 'hff; +A = 'HFF; +b = 8'h33; +B = 8'H33; +c = 12; +d = 'o755; +e = 8'b1001_0001; +f = 8'b1111zzzx; diff --git a/highlight-js/test/markup/verilog/numbers.txt b/highlight-js/test/markup/verilog/numbers.txt new file mode 100644 index 0000000..d8a2406 --- /dev/null +++ b/highlight-js/test/markup/verilog/numbers.txt @@ -0,0 +1,8 @@ +a = 'hff; +A = 'HFF; +b = 8'h33; +B = 8'H33; +c = 12; +d = 'o755; +e = 8'b1001_0001; +f = 8'b1111zzzx; diff --git a/highlight-js/test/markup/vim/strings-comments.expect.txt b/highlight-js/test/markup/vim/strings-comments.expect.txt new file mode 100644 index 0000000..77ba698 --- /dev/null +++ b/highlight-js/test/markup/vim/strings-comments.expect.txt @@ -0,0 +1,4 @@ +" comment +let one = "string" " comment +let two = "crazy +\ string with a \" quote" diff --git a/highlight-js/test/markup/vim/strings-comments.txt b/highlight-js/test/markup/vim/strings-comments.txt new file mode 100644 index 0000000..d0be92d --- /dev/null +++ b/highlight-js/test/markup/vim/strings-comments.txt @@ -0,0 +1,4 @@ +" comment +let one = "string" " comment +let two = "crazy +\ string with a \" quote" diff --git a/highlight-js/test/markup/x86asm/labels-directives.expect.txt b/highlight-js/test/markup/x86asm/labels-directives.expect.txt new file mode 100644 index 0000000..801d661 --- /dev/null +++ b/highlight-js/test/markup/x86asm/labels-directives.expect.txt @@ -0,0 +1,6 @@ + .cfi_startproc +_ZN3lib13is_whitespace17h28afa23272bf056bE: + .align 16, 0x90 + ja .Lfunc_end0 +.Lfunc_end0: + ret diff --git a/highlight-js/test/markup/x86asm/labels-directives.txt b/highlight-js/test/markup/x86asm/labels-directives.txt new file mode 100644 index 0000000..127e6e9 --- /dev/null +++ b/highlight-js/test/markup/x86asm/labels-directives.txt @@ -0,0 +1,6 @@ + .cfi_startproc +_ZN3lib13is_whitespace17h28afa23272bf056bE: + .align 16, 0x90 + ja .Lfunc_end0 +.Lfunc_end0: + ret diff --git a/highlight-js/test/markup/xml/space-attributes.expect.txt b/highlight-js/test/markup/xml/space-attributes.expect.txt new file mode 100644 index 0000000..560fc87 --- /dev/null +++ b/highlight-js/test/markup/xml/space-attributes.expect.txt @@ -0,0 +1,3 @@ +<img src ="/pics/foo.jpg"> +<img src= "/pics/foo.jpg"> +<img src = "/pics/foo.jpg"> diff --git a/highlight-js/test/markup/xml/space-attributes.txt b/highlight-js/test/markup/xml/space-attributes.txt new file mode 100644 index 0000000..fb633af --- /dev/null +++ b/highlight-js/test/markup/xml/space-attributes.txt @@ -0,0 +1,3 @@ + + + diff --git a/highlight-js/test/markup/xml/unquoted-attributes.expect.txt b/highlight-js/test/markup/xml/unquoted-attributes.expect.txt new file mode 100644 index 0000000..621a51f --- /dev/null +++ b/highlight-js/test/markup/xml/unquoted-attributes.expect.txt @@ -0,0 +1,9 @@ +<img src="/pics/foo.jpg"> +<img src='/pics/foo.jpg'> +<img src=/pics/foo.jpg> +<img src=/pics/> +<img src=/pics /> +<img alt=''/> +<img alt/> +<img alt=''> +<img alt> diff --git a/highlight-js/test/markup/xml/unquoted-attributes.txt b/highlight-js/test/markup/xml/unquoted-attributes.txt new file mode 100644 index 0000000..cd19065 --- /dev/null +++ b/highlight-js/test/markup/xml/unquoted-attributes.txt @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/highlight-js/test/markup/yaml/string.expect.txt b/highlight-js/test/markup/yaml/string.expect.txt new file mode 100644 index 0000000..4980e5c --- /dev/null +++ b/highlight-js/test/markup/yaml/string.expect.txt @@ -0,0 +1,7 @@ +key: value +key: 'some value' +key: "some value" +key: | + multi-string + value +key: true diff --git a/highlight-js/test/markup/yaml/string.txt b/highlight-js/test/markup/yaml/string.txt new file mode 100644 index 0000000..db9b389 --- /dev/null +++ b/highlight-js/test/markup/yaml/string.txt @@ -0,0 +1,7 @@ +key: value +key: 'some value' +key: "some value" +key: | + multi-string + value +key: true diff --git a/highlight-js/test/markup/yaml/tag.expect.txt b/highlight-js/test/markup/yaml/tag.expect.txt new file mode 100644 index 0000000..dbc5645 --- /dev/null +++ b/highlight-js/test/markup/yaml/tag.expect.txt @@ -0,0 +1,4 @@ +key: !!builtintagname test +key: !localtagname test +key: "!notatag" +key: '!!notatageither' diff --git a/highlight-js/test/markup/yaml/tag.txt b/highlight-js/test/markup/yaml/tag.txt new file mode 100644 index 0000000..35f3615 --- /dev/null +++ b/highlight-js/test/markup/yaml/tag.txt @@ -0,0 +1,4 @@ +key: !!builtintagname test +key: !localtagname test +key: "!notatag" +key: '!!notatageither' diff --git a/highlight-js/test/mocha.opts b/highlight-js/test/mocha.opts new file mode 100644 index 0000000..dcb2ddb --- /dev/null +++ b/highlight-js/test/mocha.opts @@ -0,0 +1,6 @@ +--require should +--reporter spec +--ui bdd +--bail +--check-leaks +--inline-diffs diff --git a/highlight-js/test/special/buildClassName.js b/highlight-js/test/special/buildClassName.js new file mode 100644 index 0000000..4915f59 --- /dev/null +++ b/highlight-js/test/special/buildClassName.js @@ -0,0 +1,39 @@ +'use strict'; + +let _ = require('lodash'); + +describe('block class names', function() { + before(function() { + const testHTML = document.querySelectorAll('#build-classname .hljs'); + + this.blocks = _.map(testHTML, 'className'); + }); + + it('should add language class name to block', function() { + const expected = 'some-class hljs xml', + actual = this.blocks[0]; + + actual.should.equal(expected); + }); + + it('should not clutter block class (first)', function () { + const expected = 'hljs some-class xml', + actual = this.blocks[1]; + + actual.should.equal(expected); + }); + + it('should not clutter block class (last)', function () { + const expected = 'some-class hljs xml', + actual = this.blocks[2]; + + actual.should.equal(expected); + }); + + it('should not clutter block class (spaces around)', function () { + const expected = 'hljs some-class xml', + actual = this.blocks[3]; + + actual.should.equal(expected); + }); +}); diff --git a/highlight-js/test/special/customMarkup.js b/highlight-js/test/special/customMarkup.js new file mode 100644 index 0000000..4ace5e7 --- /dev/null +++ b/highlight-js/test/special/customMarkup.js @@ -0,0 +1,43 @@ +'use strict'; + +let _ = require('lodash'); +let utility = require('../utility'); + +describe('custom markup', function() { + before(function() { + const testHTML = document.querySelectorAll('#custom-markup .hljs'); + + this.blocks = _.map(testHTML, 'innerHTML'); + }); + + it('should replace tabs', function() { + const filename = utility.buildPath('fixtures', 'expect', + 'tabreplace.txt'), + actual = this.blocks[0]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); + + it('should keep custom markup', function() { + const filename = utility.buildPath('fixtures', 'expect', + 'custommarkup.txt'), + actual = this.blocks[1]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); + + it('should keep custom markup and replace tabs', function() { + const filename = utility.buildPath('fixtures', 'expect', + 'customtabreplace.txt'), + actual = this.blocks[2]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); + + it('should keep the same amount of void elements (
    ,
    , ...)', function() { + const filename = utility.buildPath('fixtures', 'expect', 'brInPre.txt'), + actual = this.blocks[3]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); +}); diff --git a/highlight-js/test/special/endsWithParentVariants.js b/highlight-js/test/special/endsWithParentVariants.js new file mode 100644 index 0000000..ce222a9 --- /dev/null +++ b/highlight-js/test/special/endsWithParentVariants.js @@ -0,0 +1,19 @@ +'use strict'; + +let utility = require('../utility'); + +describe('ends with parent variants', function() { + before(function() { + const filename = utility.buildPath('fixtures', 'expect', 'endsWithParentVariants.txt'), + testHTML = document.querySelectorAll('#ends-with-parent-variants .hljs'); + + return utility.setupFile(filename, 'utf-8', this, testHTML); + }); + + it('should end on all variants', function() { + const actual = this.blocks[0]; + + actual.should.equal(this.expected); + }); + +}); diff --git a/highlight-js/test/special/explicitLanguage.js b/highlight-js/test/special/explicitLanguage.js new file mode 100644 index 0000000..e527879 --- /dev/null +++ b/highlight-js/test/special/explicitLanguage.js @@ -0,0 +1,44 @@ +'use strict'; + +let utility = require('../utility'); + +describe('explicit language class', function() { + before(function() { + const filename = utility.buildPath('fixtures', 'expect', 'explicit1.txt'), + testHTML = document.querySelectorAll('#explicit-language .hljs'); + + return utility.setupFile(filename, 'utf-8', this, testHTML); + }); + + it('should highlight block with language in code tag', function() { + const actual = this.blocks[0]; + + actual.should.equal(this.expected); + }); + + it('should highlight block with language in pre tag', function() { + const actual = this.blocks[1]; + + actual.should.equal(this.expected); + }); + + it('should highlight using html 5 style (language-*)', function() { + const actual = this.blocks[2]; + + actual.should.equal(this.expected); + }); + + it('should highlight with shortened prefix (lang-)', function() { + const filename = utility.buildPath('fixtures', 'expect', 'explicit2.txt'), + actual = this.blocks[3]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); + + it('should highlight if classname contains uppercase symbols', function() { + const filename = utility.buildPath('fixtures', 'expect', 'explicit2.txt'), + actual = this.blocks[4]; + + return utility.expectedFile(filename, 'utf-8', actual); + }); +}); diff --git a/highlight-js/test/special/index.js b/highlight-js/test/special/index.js new file mode 100644 index 0000000..3c158c5 --- /dev/null +++ b/highlight-js/test/special/index.js @@ -0,0 +1,45 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let hljs = require('../../build'); +let jsdomEnv = bluebird.promisify(require('jsdom').env); +let readFile = bluebird.promisify(require('fs').readFile); +let utility = require('../utility'); + +describe('special cases tests', function() { + before(function() { + const filename = utility.buildPath('fixtures', 'index.html'); + + return readFile(filename, 'utf-8') + .then(page => jsdomEnv(page)) + .then(window => { + let blocks; + + // Allows hljs to use document + global.document = window.document; + + // Special language to test endsWithParentVariants + hljs.registerLanguage('nested', require('../fixtures/nested.js')); + + // Setup hljs environment + hljs.configure({ tabReplace: ' ' }); + hljs.initHighlighting(); + + // Setup hljs for non-`
    ` tests
    +        hljs.configure({ useBR: true });
    +
    +        blocks = document.querySelectorAll('.code');
    +        _.each(blocks, hljs.highlightBlock);
    +      });
    +  });
    +
    +  require('./explicitLanguage');
    +  require('./customMarkup');
    +  require('./languageAlias');
    +  require('./noHighlight');
    +  require('./subLanguages');
    +  require('./buildClassName');
    +  require('./useBr');
    +  require('./endsWithParentVariants')
    +});
    diff --git a/highlight-js/test/special/languageAlias.js b/highlight-js/test/special/languageAlias.js
    new file mode 100644
    index 0000000..c2f9db2
    --- /dev/null
    +++ b/highlight-js/test/special/languageAlias.js
    @@ -0,0 +1,20 @@
    +'use strict';
    +
    +let _       = require('lodash');
    +let utility = require('../utility');
    +
    +describe('language alias', function() {
    +  before(function() {
    +    const testHTML = document.querySelectorAll('#language-alias .hljs');
    +
    +    this.blocks = _.map(testHTML, 'innerHTML');
    +  });
    +
    +  it('should highlight as aliased language', function() {
    +    const filename = utility.buildPath('fixtures', 'expect',
    +                                       'languagealias.txt'),
    +          actual   = this.blocks[0];
    +
    +    return utility.expectedFile(filename, 'utf-8', actual);
    +  });
    +});
    diff --git a/highlight-js/test/special/noHighlight.js b/highlight-js/test/special/noHighlight.js
    new file mode 100644
    index 0000000..9d51195
    --- /dev/null
    +++ b/highlight-js/test/special/noHighlight.js
    @@ -0,0 +1,88 @@
    +'use strict';
    +
    +let _ = require('lodash');
    +
    +describe('no highlighting', function() {
    +  before(function() {
    +    const testHTML = document.querySelectorAll('#no-highlight pre');
    +
    +    this.blocks   = _.map(testHTML, 'children[0].innerHTML');
    +    this.expected = {
    +      html:   '<div id="contents">\n  ' +
    +              '<p>Hello, World!\n</div>',
    +      python: 'for x in [1, 2, 3]: count(x)',
    +      javascript: 'var x = ' +
    +                  '\'foo\';'
    +    };
    +  });
    +
    +  it('should keep block unchanged (nohighlight)', function() {
    +    const expected = this.expected.html,
    +          actual   = this.blocks[0];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (no-highlight)', function() {
    +    const expected = this.expected.html,
    +          actual   = this.blocks[1];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (plain)', function() {
    +    const expected = this.expected.html,
    +          actual   = this.blocks[2];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (text)', function() {
    +    const expected = this.expected.html,
    +          actual   = this.blocks[3];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should skip pre tags without a child code tag', function() {
    +    const expected = 'Computer output',
    +          actual   = this.blocks[4];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (unsupported language)', function() {
    +    const expected = this.expected.python,
    +          actual   = this.blocks[5];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (unsupported lang)', function() {
    +    const expected = this.expected.python,
    +          actual   = this.blocks[6];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should keep block unchanged (unsupported prefixed language)', function() {
    +    const expected = this.expected.python,
    +          actual   = this.blocks[7];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should highlight class names containing text at the start', function() {
    +    const expected = this.expected.javascript,
    +          actual   = this.blocks[8];
    +
    +    actual.should.equal(expected);
    +  });
    +
    +  it('should highlight class names containing text at the end', function() {
    +    const expected = this.expected.javascript,
    +          actual   = this.blocks[9];
    +
    +    actual.should.equal(expected);
    +  });
    +});
    diff --git a/highlight-js/test/special/subLanguages.js b/highlight-js/test/special/subLanguages.js
    new file mode 100644
    index 0000000..c7e458a
    --- /dev/null
    +++ b/highlight-js/test/special/subLanguages.js
    @@ -0,0 +1,17 @@
    +'use strict';
    +
    +let utility = require('../utility');
    +
    +describe('sub-languages', function() {
    +  before(function() {
    +    this.block = document.querySelector('#sublanguages');
    +  });
    +
    +  it('should highlight XML with PHP and JavaScript', function() {
    +    const filename = utility.buildPath('fixtures', 'expect',
    +                                     'sublanguages.txt'),
    +          actual   = this.block.innerHTML;
    +
    +    return utility.expectedFile(filename, 'utf-8', actual);
    +  });
    +});
    diff --git a/highlight-js/test/special/useBr.js b/highlight-js/test/special/useBr.js
    new file mode 100644
    index 0000000..70e2cc3
    --- /dev/null
    +++ b/highlight-js/test/special/useBr.js
    @@ -0,0 +1,30 @@
    +'use strict';
    +
    +let utility = require('../utility');
    +
    +describe('use br', function() {
    +  before(function() {
    +    const filename = utility.buildPath('fixtures', 'expect', 'useBr.txt'),
    +          testHTML = document.querySelectorAll('#use-br .hljs');
    +
    +    return utility.setupFile(filename, 'utf-8', this, testHTML);
    +  });
    +
    +  it('should respect 
    tags', function() { + const actual = this.blocks[0]; + + actual.should.equal(this.expected); + }); + + it('should ignore literal new lines', function() { + const actual = this.blocks[1]; + + actual.should.equal(this.expected); + }); + + it('should recognize xml-style
    ', function() { + const actual = this.blocks[2]; + + actual.should.equal(this.expected); + }); +}); diff --git a/highlight-js/test/utility.js b/highlight-js/test/utility.js new file mode 100644 index 0000000..967b170 --- /dev/null +++ b/highlight-js/test/utility.js @@ -0,0 +1,29 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let readFile = bluebird.promisify(require('fs').readFile); +let path = require('path'); + +// Build a path relative to `test/` +exports.buildPath = function() { + const args = _.slice(arguments, 0), + paths = [__dirname].concat(args); + + return path.join.apply(this, paths); +}; + +exports.numberToString = _.method('toString'); + +exports.expectedFile = function(filename, encoding, actual) { + return readFile(filename, encoding) + .then(expected => actual.trim().should.equal(expected.trim())); +}; + +exports.setupFile = function(filename, encoding, that, testHTML) { + return readFile(filename, encoding) + .then(expected => { + that.expected = expected.trim(); + that.blocks = _.map(testHTML, 'innerHTML'); + }); +}; diff --git a/highlight-js/tools/all.js b/highlight-js/tools/all.js new file mode 100644 index 0000000..6168be0 --- /dev/null +++ b/highlight-js/tools/all.js @@ -0,0 +1,34 @@ +'use strict'; + +let _ = require('lodash'); +let path = require('path'); +let cdn = require('./cdn'); +let node = require('./node'); +let browser = require('./browser'); + +function newBuildDirectory(dir, subdir) { + const build = path.join(dir.build, subdir); + + return { build: build }; +} + +module.exports = function(commander, dir) { + let data = {}; + + _.each(['cdn', 'node', 'browser'], function(target) { + const newDirectory = newBuildDirectory(dir, target), + directory = _.defaults(newDirectory, dir), + options = _.defaults({ target: target }, commander); + + data[target] = { + directory: directory, + commander: options + }; + }); + + return [].concat( + cdn(data.cdn.commander, data.cdn.directory), + node(data.node.commander, data.node.directory), + browser(data.browser.commander, data.browser.directory) + ); +}; diff --git a/highlight-js/tools/browser.js b/highlight-js/tools/browser.js new file mode 100644 index 0000000..9eb8c71 --- /dev/null +++ b/highlight-js/tools/browser.js @@ -0,0 +1,160 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let readFile = bluebird.promisify(require('fs').readFile); +let path = require('path'); + +let registry = require('./tasks'); +let utility = require('./utility'); + +let directory; + +function templateAllFunc(blobs) { + const name = path.join('demo', 'index.html'); + + blobs = _.compact(blobs); + + return bluebird.join( + readFile(name), + utility.getStyleNames(), + (template, styles) => ({ template, path, blobs, styles }) + ); +} + +function copyDocs() { + const input = path.join(directory.root, 'docs', '*.rst'), + output = path.join(directory.build, 'docs'); + + return { + startLog: { task: ['log', 'Copying documentation.'] }, + read: { requires: 'startLog', task: ['glob', utility.glob(input)] }, + writeLog: { requires: 'read', task: ['log', 'Writing documentation.'] }, + write: { requires: 'writeLog', task: ['dest', output] } + }; +} + +function generateDemo(filterCB, readArgs) { + let styleDir = path.join('src', 'styles'), + staticArgs = utility.glob(path.join('demo', '*.min.{js,css}')), + imageArgs = utility.glob(path.join(styleDir, '*.{png,jpg}'), + 'binary'), + stylesArgs = utility.glob(path.join(styleDir, '*.css')), + demoRoot = path.join(directory.build, 'demo'), + templateArgs = { callback: templateAllFunc }, + destArgs = { + dir: path.join(demoRoot, 'styles'), + encoding: 'binary' + }; + + return { + logStart: { task: ['log', 'Generating demo.'] }, + readLanguages: { requires: 'logStart', task: ['glob', readArgs] }, + filterSnippets: { requires: 'readLanguages', task: ['filter', filterCB] }, + readSnippet: { requires: 'filterSnippets', task: 'readSnippet' }, + template: { + requires: 'readSnippet', + task: ['templateAll', templateArgs] + }, + write: { + requires: 'template', + task: ['write', path.join(demoRoot, 'index.html')] + }, + readStatic: { requires: 'logStart', task: ['glob', staticArgs] }, + writeStatic: { requires: 'readStatic', task: ['dest', demoRoot] }, + readStyles: { requires: 'logStart', task: ['glob', stylesArgs] }, + compressStyles: { requires: 'readStyles', task: 'cssminify' }, + writeStyles: { requires: 'compressStyles', task: ['dest', destArgs] }, + readImages: { requires: 'logStart', task: ['glob', imageArgs] }, + writeImages: { requires:'readImages', task: ['dest', destArgs] }, + readDemoJS: { + requires: 'logStart', + task: ['read', path.join('demo', 'demo.js')] + }, + minifyDemoJS: { requires: 'readDemoJS', task: 'jsminify' }, + writeDemoJS: { requires: 'minifyDemoJS', task: ['dest', demoRoot] }, + readDemoCSS: { + requires: 'logStart', + task: ['read', path.join('demo', 'style.css')] + }, + minifyDemoCSS: { requires: 'readDemoCSS', task: 'cssminify' }, + writeDemoCSS: { requires: 'minifyDemoCSS', task: ['dest', demoRoot] } + }; +} + +module.exports = function(commander, dir) { + directory = dir; + + let hljsExt, output, requiresTask, tasks, + replace = utility.replace, + regex = utility.regex, + replaceClassNames = utility.replaceClassNames, + + coreFile = path.join('src', 'highlight.js'), + languages = utility.glob(path.join('src', 'languages', '*.js')), + filterCB = utility.buildFilterCallback(commander.args), + replaceArgs = replace(regex.header, ''), + templateArgs = + 'hljs.registerLanguage(\'<%= name %>\', <%= content %>);\n'; + + tasks = { + startLog: { task: ['log', 'Building highlight.js pack file.'] }, + readCore: { requires: 'startLog', task: ['read', coreFile] }, + read: { requires: 'startLog', task: ['glob', languages] }, + filter: { requires: 'read', task: ['filter', filterCB] }, + reorder: { requires: 'filter', task: 'reorderDeps' }, + replace: { requires: 'reorder', task: ['replace', replaceArgs] }, + template: { requires: 'replace', task: ['template', templateArgs] }, + packageFiles: { + requires: ['readCore', 'template'], + task: 'packageFiles' + } + }; + requiresTask = 'packageFiles'; + + if(commander.compress || commander.target === 'cdn') { + tasks.compresslog = { + requires: requiresTask, + task: ['log', 'Compressing highlight.js pack file.'] + }; + + tasks.replace2 = { + requires: 'compresslog', + task: [ 'replaceSkippingStrings' + , replace(regex.replaces, replaceClassNames) + ] + }; + + tasks.replace3 = { + requires: 'replace2', + task: ['replace', replace(regex.classname, '$1.className')] + }; + + tasks.minify = { requires: 'replace3', task: 'jsminify' }; + requiresTask = 'minify'; + } + + tasks.insertLicenseTag = { + requires: requiresTask, + task: 'insertLicenseTag' + }; + + tasks.writelog = { + requires: 'insertLicenseTag', + task: ['log', 'Writing highlight.js pack file.'] + }; + + hljsExt = commander.target === 'cdn' ? 'min' : 'pack'; + output = path.join(directory.build, `highlight.${hljsExt}.js`); + + tasks.write = { + requires: 'writelog', + task: ['write', output] + }; + + tasks = (commander.target === 'browser') + ? [copyDocs(), generateDemo(filterCB, languages), tasks] + : [tasks]; + + return utility.toQueue(tasks, registry); +}; diff --git a/highlight-js/tools/build.js b/highlight-js/tools/build.js new file mode 100644 index 0000000..d399551 --- /dev/null +++ b/highlight-js/tools/build.js @@ -0,0 +1,89 @@ +// For the basic introductions on using this build script, see: +// +// +// +// Otherwise, lets explain what each build target does in more detail, for +// those that wish to know before running this script. +// +// Build Targets +// ------------- +// +// * browser +// +// The default target. This will package up the core `highlight.js` along +// with all the language definitions into the file `highlight.pack.js` -- +// which will be compressed without including the option to disable it. It +// also builds the documentation for our readthedocs page, mentioned +// above, along with a local instance of the demo at: +// +// . +// +// * cdn +// +// This will package up the core `highlight.js` along with all the +// language definitions into the file `highlight.min.js` and compresses +// all languages and styles into separate files. Since the target is for +// CDNs -- like cdnjs and jsdelivr -- it doesn't matter if you put the +// option to disable compression, this target is always be compressed. Do +// keep in mind that we don't keep the build results in the main +// repository; however, there is a separate repository for those that want +// the CDN builds without using a third party site or building it +// themselves. For those curious, head over to: +// +// +// +// * node +// +// This build will transform the library into a CommonJS module. It +// includes the generation of an `index.js` file that will be the main +// file imported for use with Node.js or browserify. Do note that this +// includes all languages by default and it might be too heavy to use for +// browserify. Luckily, you can easily do two things to make the build +// smaller; either specify the specific language/category you need or you +// can use the browser or cdn builds and it will work like any CommonJS +// file. Also with the CommonJS module, it includes the documentation for +// our readthedocs page and the uncompressed styles. Getting this build is +// pretty easy as it is the one that gets published to npm with the +// standard `npm install highlight.js`, but you can also visit the package +// page at: +// +// +// +// * all +// +// Builds every target and places the results into a sub-directory based +// off of the target name relative to the `build` directory; for example, +// "node" with go into `build/node`, "cdn" will go into `build/cdn`, +// "browser" will go into `build/browser` and so forth. +// +// All build targets will end up in the `build` directory. + +'use strict'; + +let commander = require('commander'); +let path = require('path'); +let Queue = require('gear').Queue; +let registry = require('./tasks'); + +let build, dir = {}; + +commander + .usage('[options] [...]') + .option('-n, --no-compress', 'Disable compression') + .option('-t, --target ', 'Build for target ' + + '[all, browser, cdn, node]', + /^(browser|cdn|node|all)$/i, 'browser') + .parse(process.argv); + +commander.target = commander.target.toLowerCase(); + +build = require(`./${commander.target}`); +dir.root = path.dirname(__dirname); +dir.build = path.join(dir.root, 'build'); + +new Queue({ registry: registry }) + .clean(dir.build) + .log('Starting build.') + .series(build(commander, dir)) + .log('Finished build.') + .run(); diff --git a/highlight-js/tools/cdn.js b/highlight-js/tools/cdn.js new file mode 100644 index 0000000..3d93c9c --- /dev/null +++ b/highlight-js/tools/cdn.js @@ -0,0 +1,88 @@ +'use strict'; + +let path = require('path'); + +let browserBuild = require('./browser'); +let registry = require('./tasks'); +let utility = require('./utility'); + +let directory; + +function moveLanguages() { + let input = path.join(directory.root, 'src', 'languages', '*.js'), + output = path.join(directory.build, 'languages'), + regex = utility.regex, + replace = utility.replace, + + replaceArgs = replace(regex.header, ''), + template = 'hljs.registerLanguage(\'<%= name %>\','+ + ' <%= content %>);\n'; + + return { + startLog: { task: ['log', 'Building language files.'] }, + read: { + requires: 'startLog', + task: ['glob', utility.glob(input)] + }, + replace: { requires: 'read', task: ['replace', replaceArgs] }, + template: { requires: 'replace', task: ['template', template] }, + replace2: { + requires: 'template', + task: [ 'replaceSkippingStrings' + , replace(regex.replaces, utility.replaceClassNames) + ] + }, + replace3: { + requires: 'replace2', + task: ['replace', replace(regex.classname, '$1.className')] + }, + compressLog: { + requires: 'replace3', + task: ['log', 'Compressing languages files.'] + }, + minify: { requires: 'compressLog', task: 'jsminify' }, + rename: { requires: 'minify', task: ['rename', { extname: '.min.js' }] }, + writeLog: { + requires: 'rename', + task: ['log', 'Writing language files.'] + }, + write: { requires: 'writeLog', task: ['dest', output] } + }; +} + +function moveStyles() { + const css = path.join(directory.root, 'src', 'styles', '*.css'), + images = path.join(directory.root, 'src', 'styles', '*.{jpg,png}'), + output = path.join(directory.build, 'styles'), + options = { dir: output, encoding: 'binary' }; + + return { + startLog: { task: ['log', 'Building style files.'] }, + readCSS: { requires: 'startLog', task: ['glob', utility.glob(css)] }, + readImages: { + requires: 'startLog', + task: ['glob', utility.glob(images, 'binary')] + }, + compressLog: { + requires: 'readCSS', + task: ['log', 'Compressing style files.'] + }, + minify: { requires: 'compressLog', task: 'cssminify' }, + rename: { + requires: 'minify', + task: ['rename', { extname: '.min.css' }] + }, + writeLog: { + requires: ['rename', 'readImages'], + task: ['log', 'Writing style files.'] + }, + write: { requires: 'writeLog', task: ['dest', options] } + }; +} + +module.exports = function(commander, dir) { + directory = dir; + + return utility.toQueue([moveLanguages(), moveStyles()], registry) + .concat(browserBuild(commander, dir)); +}; diff --git a/highlight-js/tools/codeformat.js b/highlight-js/tools/codeformat.js new file mode 100644 index 0000000..e6c5727 --- /dev/null +++ b/highlight-js/tools/codeformat.js @@ -0,0 +1,47 @@ +'use strict'; + +var _ = require('lodash'); +var bluebird = require('bluebird'); +var path = require('path'); +var glob = bluebird.promisify(require('glob')); +var fs = require('fs'); +var readFile = bluebird.promisify(fs.readFile); +var writeFile = bluebird.promisify(fs.writeFile); +var beautify = require('js-beautify').js_beautify; + +var beautify_options = { + "indent_size": 2, + "indent_char": " ", + "eol": "\n", + "indent_level": 0, + "indent_with_tabs": false, + "preserve_newlines": true, + "max_preserve_newlines": 10, + "jslint_happy": false, + "space_after_anon_function": false, + "brace_style": "collapse", + "keep_array_indentation": false, + "keep_function_indentation": false, + "space_before_conditional": true, + "break_chained_methods": false, + "eval_code": false, + "end_with_newline": true +}; + +console.log("Starting formatting."); + +var sources = path.join('src', 'languages', '*.js'); + +bluebird.map(glob(sources), function (name) { + var basename = path.basename(name, '.js'); + + return readFile(name).then(function (blob) { + return beautify(blob.toString(), beautify_options); + }).then(function (blob) { + return writeFile(name, blob).then(function () { + console.log(" ✓ " + basename); + }); + }); +}).then(function () { + console.log("Finished formatting."); +}); diff --git a/highlight-js/tools/developer.html b/highlight-js/tools/developer.html new file mode 100644 index 0000000..91d8753 --- /dev/null +++ b/highlight-js/tools/developer.html @@ -0,0 +1,107 @@ + + + + + highlight.js developer + + + + + + +

    highlight.js developer

    + +
    +
    + +

    + + Language: +

    +
    +
    +

    Rendered in ... ms [...]

    +
    ...
    +
    +
    +

    Markup +

    ...
    +
    +
    + + + + + + + diff --git a/highlight-js/tools/keywordsformat.js b/highlight-js/tools/keywordsformat.js new file mode 100644 index 0000000..85d5b22 --- /dev/null +++ b/highlight-js/tools/keywordsformat.js @@ -0,0 +1,18 @@ +/** Example */ + +var all = 'keywords here'; + +var output = '', line = ''; +all.forEach(function (item) { + if (12 + 1 + line.length + 1 + item.length + 4 > 120) { + output += "\n" + " '" + line + " ' +"; + line = ''; + return; + } + if (line) { + line = line + ' ' + item; + } else { + line = item; + } +}); +console.log(output); diff --git a/highlight-js/tools/node.js b/highlight-js/tools/node.js new file mode 100644 index 0000000..c29ff2b --- /dev/null +++ b/highlight-js/tools/node.js @@ -0,0 +1,141 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let path = require('path'); + +let packageJSON = require('../package'); +let registry = require('./tasks'); +let utility = require('./utility'); + +let directory, filterCB, + languages = utility.glob(path.join('src', 'languages', '*.js')), + header = utility.regex.header; + +function templateAllFunc(blobs) { + const names = _.map(blobs, blob => path.basename(blob.name, '.js')); + + return bluebird.resolve({ names: names }); +} + +function buildLanguages() { + let input = languages, + output = path.join(directory.build, 'lib', 'languages'), + + replaceArgs = utility.replace(header, ''), + template = 'module.exports = <%= content %>;'; + + return { + logStart: { task: ['log', 'Building language files.'] }, + read: { requires: 'logStart', task: ['glob', input] }, + filter: { requires: 'read', task: ['filter', filterCB] }, + replace: { requires: 'filter', task: ['replace', replaceArgs] }, + template: { requires: 'replace', task: ['template', template] }, + writeLog: { + requires: 'template', + task: ['log', 'Writing language files.'] + }, + write: { requires: 'writeLog', task: ['dest', output] } + }; +} + +function buildCore() { + const input = path.join(directory.root, 'src', 'highlight.js'), + output = path.join(directory.build, 'lib'); + + return { + startLog: { task: ['log', 'Building core file.'] }, + read: { requires: 'startLog', task: ['read', input] }, + writeLog: { requires: 'read', task: ['log', 'Writing core file.'] }, + write: { requires: 'writeLog', task: ['dest', output] } + }; +} + +function buildIndex() { + let input = languages, + output = path.join(directory.build, 'lib', 'index.js'), + + templateArgs = { + template: [ 'var hljs = require(\'./highlight\');\n' + , '<% _.each(names, function(name) { %>' + + 'hljs.registerLanguage(\'<%= name %>\', ' + + 'require(\'./languages/<%= name %>\'));' + , '<% }); %>' + , 'module.exports = hljs;' + ].join('\n'), + callback: templateAllFunc + }; + + return { + startLog: { task: ['log', 'Building index file.'] }, + read: { requires: 'startLog', task: ['glob', input] }, + filter: { requires: 'read', task: ['filter', filterCB] }, + reorder: { requires: 'filter', task: 'reorderDeps' }, + template: { requires: 'reorder', task: ['templateAll', templateArgs] }, + writeLog: { requires: 'template', task: ['log', 'Writing index file.'] }, + write: { requires: 'writeLog', task: ['write', output] } + }; +} + +function copyMetaFiles() { + let docs = path.join('docs', '*.rst'), + glob = `{README.md,LICENSE,${docs}}`, + + input = utility.glob(path.join(directory.root, glob)), + output = { dir: directory.build, base: '.' }; + + return { + startLog: { task: ['log', 'Copying meta files.'] }, + read: { requires: 'startLog', task: ['glob', input] }, + writeLog: { requires: 'read', task: ['log', 'Writing meta files.'] }, + write: { requires: 'writeLog', task: ['dest', output] } + }; +} + +function buildStyles() { + let input = path.join(directory.root, 'src', 'styles', '*'), + output = path.join(directory.build, 'styles'), + options = { encoding: 'binary', dir: output }; + + return { + startLog: { task: ['log', 'Building style files.'] }, + read: { + requires: 'startLog', + task: ['glob', utility.glob(input, 'binary')] + }, + writeLog: { requires: 'read', task: ['log', 'Writing style files.'] }, + write: { requires: 'writeLog', task: ['dest', options] } + }; +} + +function buildPackageFile() { + const input = path.join(directory.root, 'AUTHORS.en.txt'), + output = path.join(directory.build, 'package.json'); + + return { + startLog: { task: ['log', 'Building package.json file.'] }, + read: { requires: 'startLog', task: ['read', input] }, + build: { requires: 'read', task: ['buildPackage', packageJSON] }, + writeLog: { + requires: 'build', + task: ['log', 'Writing package.json file.'] + }, + write: { requires: 'writeLog', task: ['write', output] } + }; +} + +module.exports = function(commander, dir) { + directory = dir; + filterCB = utility.buildFilterCallback(commander.args); + + let tasks = [ + buildLanguages(), + buildCore(), + buildIndex(), + buildStyles(), + copyMetaFiles(), + buildPackageFile() + ]; + + return utility.toQueue(tasks, registry); +}; diff --git a/highlight-js/tools/tasks.js b/highlight-js/tools/tasks.js new file mode 100644 index 0000000..de1a6ac --- /dev/null +++ b/highlight-js/tools/tasks.js @@ -0,0 +1,248 @@ +'use strict'; + +let _ = require('lodash'); +let del = require('del'); +let gear = require('gear'); +let path = require('path'); +let utility = require('./utility'); + +let parseHeader = utility.parseHeader; +let tasks = require('gear-lib'); + +tasks.clean = function(directories, blobs, done) { + directories = _.isString(directories) ? [directories] : directories; + + return del(directories).then(() => done(null, blobs)); +}; +tasks.clean.type = 'collect'; + +// Depending on the languages required for the current language being +// processed, this task reorders it's dependencies first then include the +// language. +tasks.reorderDeps = function(options, blobs, done) { + let buffer = {}, + newBlobOrder = []; + + _.each(blobs, function(blob) { + let basename = path.basename(blob.name), + fileInfo = parseHeader(blob.result), + extra = { blob: blob, processed: false }; + + buffer[basename] = _.merge(extra, fileInfo || {}); + }); + + function pushInBlob(object) { + if(!object.processed) { + object.processed = true; + newBlobOrder.push(object.blob); + } + } + + _.each(buffer, function(buf) { + let object; + + if(buf.Requires) { + _.each(buf.Requires, function(language) { + object = buffer[language]; + pushInBlob(object); + }); + } + + pushInBlob(buf); + }); + + done(null, newBlobOrder); +}; +tasks.reorderDeps.type = 'collect'; + +tasks.template = function(template, blob, done) { + template = template || ''; + + let filename = path.basename(blob.name), + basename = path.basename(filename, '.js'), + content = _.template(template)({ + name: basename, + filename: filename, + content: blob.result.trim() + }); + + return done(null, new gear.Blob(content, blob)); +}; + +tasks.templateAll = function(options, blobs, done) { + return options.callback(blobs) + .then(function(data) { + let template = options.template || data.template, + content = _.template(template)(data); + + return done(null, [new gear.Blob(content)]); + }) + .catch(done); +}; +tasks.templateAll.type = 'collect'; + +tasks.rename = function(options, blob, done) { + options = options || {}; + + let name = blob.name, + ext = new RegExp(path.extname(name) + '$'); + + name = name.replace(ext, options.extname); + + return done(null, new gear.Blob(blob.result, { name: name })); +}; + +// Adds the contributors from `AUTHORS.en.txt` onto the `package.json` file +// and moves the result into the `build` directory. +tasks.buildPackage = function(json, blob, done) { + let result, + lines = blob.result.split(/\r?\n/), + regex = /^- (.*) <(.*)>$/; + + json.contributors = _.transform(lines, function(result, line) { + let matches = line.match(regex); + + if(matches) { + result.push({ + name: matches[1], + email: matches[2] + }); + } + }, []); + + result = JSON.stringify(json, null, ' '); + + return done(null, new gear.Blob(result, blob)); +}; + +// Mainly for replacing the keys of `utility.REPLACES` for it's values while +// skipping over strings, regular expressions, or comments. However, this is +// pretty generic so long as you use the `utility.replace` function, you can +// replace a regular expression with a string. +tasks.replaceSkippingStrings = function(params, blob, done) { + let content = blob.result, + length = content.length, + offset = 0, + + replace = params.replace || '', + regex = params.regex, + starts = /\/\/|['"\/]/, + + result = [], + chunk, end, match, start, terminator; + + while(offset < length) { + chunk = content.slice(offset); + match = chunk.match(starts); + end = match ? match.index : length; + + chunk = content.slice(offset, end + offset); + result.push(chunk.replace(regex, replace)); + + offset += end; + + if(match) { + // We found a starter sequence: either a `//` or a "quote" + // In the case of `//` our terminator is the end of line. + // Otherwise it's either a matching quote or an escape symbol. + terminator = match[0] !== '//' ? new RegExp(`[${match[0]}\\\\]`) + : /$/m; + start = offset; + offset += 1; + + while(true) { + chunk = content.slice(offset); + match = chunk.match(terminator); + + if(!match) { + return done('Unmatched quote'); + } + + if(match[0] === '\\') { + offset += match.index + 2; + } else { + offset += match.index + 1; + result.push(content.slice(start, offset)); + break; + } + } + } + } + + return done(null, new gear.Blob(result.join(''), blob)); +}; + +tasks.filter = function(callback, blobs, done) { + let filteredBlobs = _.filter(blobs, callback); + + // Re-add in blobs required from header definition + _.each(filteredBlobs, function(blob) { + let dirname = path.dirname(blob.name), + content = blob.result, + fileInfo = parseHeader(content); + + if(fileInfo && fileInfo.Requires) { + _.each(fileInfo.Requires, function(language) { + let filename = `${dirname}/${language}`, + fileFound = _.find(filteredBlobs, { name: filename }); + + if(!fileFound) { + filteredBlobs.push( + _.find(blobs, { name: filename })); + } + }); + } + }); + + return done(null, filteredBlobs); +}; +tasks.filter.type = 'collect'; + +tasks.readSnippet = function(options, blob, done) { + let name = path.basename(blob.name, '.js'), + fileInfo = parseHeader(blob.result), + snippetName = path.join('test', 'detect', name, 'default.txt'); + + function onRead(error, blob) { + if(error) return done(error); // ignore missing snippets + + let meta = { name: `${name}.js`, fileInfo: fileInfo }; + + return done(null, new gear.Blob(blob.result, meta)); + } + + gear.Blob.readFile(snippetName, 'utf8', onRead, false); +}; + +tasks.insertLicenseTag = function(options, blob, done) { + let hljsVersion = require('../package').version, + licenseTag = `/*! highlight.js v${hljsVersion} | ` + + `BSD3 License | git.io/hljslicense */\n`; + + return done(null, new gear.Blob(licenseTag + blob.result, blob)); +}; + +// Packages up included languages into the core `highlight.js` and moves the +// result into the `build` directory. +tasks.packageFiles = function(options, blobs, done) { + let content, + coreFile = _.head(blobs), + languages = _.tail(blobs), + + lines = coreFile.result + .replace(utility.regex.header, '') + .split('\n\n'), + lastLine = _.last(lines), + langStr = _.reduce(languages, (str, language) => + `${str + language.result}\n`, ''); + + lines[lines.length - 1] = langStr.trim(); + + lines = lines.concat(lastLine); + content = lines.join('\n\n'); + + return done(null, [new gear.Blob(content)]); +}; +tasks.packageFiles.type = 'collect'; + +module.exports = new gear.Registry({ tasks: tasks }); diff --git a/highlight-js/tools/utility.js b/highlight-js/tools/utility.js new file mode 100644 index 0000000..81f5059 --- /dev/null +++ b/highlight-js/tools/utility.js @@ -0,0 +1,169 @@ +'use strict'; + +let _ = require('lodash'); +let bluebird = require('bluebird'); +let glob = bluebird.promisify(require('glob')); +let path = require('path'); + +let Queue = require('gear').Queue; + +let regex = {}, + headerRegex = /^\s*\/\*((.|\r?\n)*?)\*/; + +const REPLACES = { + 'case_insensitive': 'cI', + 'lexemes': 'l', + 'contains': 'c', + 'keywords': 'k', + 'subLanguage': 'sL', + 'className': 'cN', + 'begin': 'b', + 'beginKeywords': 'bK', + 'end': 'e', + 'endsWithParent': 'eW', + 'illegal': 'i', + 'excludeBegin': 'eB', + 'excludeEnd': 'eE', + 'returnBegin': 'rB', + 'returnEnd': 'rE', + 'relevance': 'r', + 'variants': 'v', + + 'IDENT_RE': 'IR', + 'UNDERSCORE_IDENT_RE': 'UIR', + 'NUMBER_RE': 'NR', + 'C_NUMBER_RE': 'CNR', + 'BINARY_NUMBER_RE': 'BNR', + 'RE_STARTERS_RE': 'RSR', + 'BACKSLASH_ESCAPE': 'BE', + 'APOS_STRING_MODE': 'ASM', + 'QUOTE_STRING_MODE': 'QSM', + 'PHRASAL_WORDS_MODE': 'PWM', + 'C_LINE_COMMENT_MODE': 'CLCM', + 'C_BLOCK_COMMENT_MODE': 'CBCM', + 'HASH_COMMENT_MODE': 'HCM', + 'NUMBER_MODE': 'NM', + 'C_NUMBER_MODE': 'CNM', + 'BINARY_NUMBER_MODE': 'BNM', + 'CSS_NUMBER_MODE': 'CSSNM', + 'REGEXP_MODE': 'RM', + 'TITLE_MODE': 'TM', + 'UNDERSCORE_TITLE_MODE': 'UTM', + 'COMMENT': 'C', + + 'beginRe': 'bR', + 'endRe': 'eR', + 'illegalRe': 'iR', + 'lexemesRe': 'lR', + 'terminators': 't', + 'terminator_end': 'tE' +}; + +regex.replaces = new RegExp( + `\\b(${Object.keys(REPLACES).join('|')})\\b`, 'g'); + +regex.classname = /(block|parentNode)\.cN/g; + +regex.header = /^\s*(\/\*((.|\r?\n)*?)\*\/)?\s*/; + +function replace(from, to) { + return { regex: from, replace: to }; +} + +function replaceClassNames(match) { + return REPLACES[match]; +} + +// All meta data, for each language definition, it store within the headers +// of each file in `src/languages`. `parseHeader` extracts that data and +// turns it into a useful object -- mainly for categories and what language +// this definition requires. +function parseHeader(content) { + let headers, + match = content.match(headerRegex); + + if (!match) { + return null; + } + + headers = _.compact(match[1].split('\n')); + + return _.reduce(headers, function(result, header) { + let keyVal = header.trim().split(': '), + key = keyVal[0], + value = keyVal[1] || ''; + + if(key !== 'Description' && key !== 'Language') { + value = value.split(/\s*,\s*/); + } + + result[key] = value; + + return result; + }, {}); +} + +function filterByQualifiers(blob, languages, categories) { + if(_.isEmpty(languages) && _.isEmpty(categories)) return true; + + let language = path.basename(blob.name, '.js'), + fileInfo = parseHeader(blob.result), + containsCategory = _.partial(_.includes, categories); + + if(!fileInfo) return false; + + let fileCategories = fileInfo.Category || []; + + return _.includes(languages, language) || + _.some(fileCategories, containsCategory); +} + +// For the filter task in `tools/tasks.js`, this function will look for +// categories and languages specificed from the CLI. +function buildFilterCallback(qualifiers) { + const result = _.partition(qualifiers, { 0: ':' }), + languages = result[1], + categories = _.map(result[0], category => category.slice(1)); + + return blob => filterByQualifiers(blob, languages, categories); +} + +function globDefaults(pattern, encoding) { + encoding = encoding || 'utf8'; + + // The limit option is a fix for issue #636 when the build script would + // EMFILE error for those systems who had a limit of open files per + // process. + // + // + return { pattern: pattern, limit: 50, encoding: encoding }; +} + +function getStyleNames() { + let stylesDir = 'src/styles/', + options = { ignore: `${stylesDir}default.css` }; + + return glob(`${stylesDir}*.css`, options) + .map(function(style) { + let basename = path.basename(style, '.css'), + name = _.startCase(basename), + pathName = path.relative('src', style); + + return { path: pathName, name: name }; + }); +} + +function toQueue(tasks, registry) { + return _.map(tasks, task => new Queue({ registry }).tasks(task)); +} + +module.exports = { + buildFilterCallback: buildFilterCallback, + getStyleNames: getStyleNames, + glob: globDefaults, + parseHeader: parseHeader, + regex: regex, + replace: replace, + replaceClassNames: replaceClassNames, + toQueue: toQueue +}; diff --git a/index.html b/index.html new file mode 100644 index 0000000..2ac1f16 --- /dev/null +++ b/index.html @@ -0,0 +1,84 @@ + + + + + Presentations from CCCHB + + + + + + + + + + + + + +
    +
    + +
    + +

    Presentations

    + + +
    + +
    + + +
    + + + + + + + + + + diff --git a/reveal-js/.gitignore b/reveal-js/.gitignore new file mode 100644 index 0000000..7d13714 --- /dev/null +++ b/reveal-js/.gitignore @@ -0,0 +1,14 @@ +.idea/ +*.iml +*.iws +*.eml +out/ +.DS_Store +.svn +log/*.log +tmp/** +node_modules/ +package-lock.json +.sass-cache +css/reveal.min.css +js/reveal.min.js diff --git a/reveal-js/.travis.yml b/reveal-js/.travis.yml new file mode 100644 index 0000000..15d6627 --- /dev/null +++ b/reveal-js/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 4 +after_script: + - npm run build -- retire diff --git a/reveal-js/CONTRIBUTING.md b/reveal-js/CONTRIBUTING.md new file mode 100644 index 0000000..c2091e8 --- /dev/null +++ b/reveal-js/CONTRIBUTING.md @@ -0,0 +1,23 @@ +## Contributing + +Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. + + +### Personal Support +If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js). + + +### Bug Reports +When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested. + + +### Pull Requests +- Should follow the coding style of the file you work in, most importantly: + - Tabs to indent + - Single-quoted strings +- Should be made towards the **dev branch** +- Should be submitted from a feature/topic branch (not your master) + + +### Plugins +Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines diff --git a/reveal-js/Gruntfile.js b/reveal-js/Gruntfile.js new file mode 100644 index 0000000..8d8300b --- /dev/null +++ b/reveal-js/Gruntfile.js @@ -0,0 +1,193 @@ +/* global module:false */ +module.exports = function(grunt) { + var port = grunt.option('port') || 8000; + var root = grunt.option('root') || '.'; + + if (!Array.isArray(root)) root = [root]; + + // Project configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: + '/*!\n' + + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + + ' * http://revealjs.com\n' + + ' * MIT licensed\n' + + ' *\n' + + ' * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n' + + ' */' + }, + + qunit: { + files: [ 'test/*.html' ] + }, + + uglify: { + options: { + banner: '<%= meta.banner %>\n', + ie8: true + }, + build: { + src: 'js/reveal.js', + dest: 'js/reveal.min.js' + } + }, + + sass: { + core: { + src: 'css/reveal.scss', + dest: 'css/reveal.css' + }, + themes: { + expand: true, + cwd: 'css/theme/source', + src: ['*.sass', '*.scss'], + dest: 'css/theme', + ext: '.css' + } + }, + + autoprefixer: { + core: { + src: 'css/reveal.css' + } + }, + + cssmin: { + options: { + compatibility: 'ie9' + }, + compress: { + src: 'css/reveal.css', + dest: 'css/reveal.min.css' + } + }, + + jshint: { + options: { + curly: false, + eqeqeq: true, + immed: true, + esnext: true, + latedef: 'nofunc', + newcap: true, + noarg: true, + sub: true, + undef: true, + eqnull: true, + browser: true, + expr: true, + loopfunc: true, + globals: { + head: false, + module: false, + console: false, + unescape: false, + define: false, + exports: false + } + }, + files: [ 'Gruntfile.js', 'js/reveal.js' ] + }, + + connect: { + server: { + options: { + port: port, + base: root, + livereload: true, + open: true, + useAvailablePort: true + } + } + }, + + zip: { + bundle: { + src: [ + 'index.html', + 'css/**', + 'js/**', + 'lib/**', + 'images/**', + 'plugin/**', + '**.md' + ], + dest: 'reveal-js-presentation.zip' + } + }, + + watch: { + js: { + files: [ 'Gruntfile.js', 'js/reveal.js' ], + tasks: 'js' + }, + theme: { + files: [ + 'css/theme/source/*.sass', + 'css/theme/source/*.scss', + 'css/theme/template/*.sass', + 'css/theme/template/*.scss' + ], + tasks: 'css-themes' + }, + css: { + files: [ 'css/reveal.scss' ], + tasks: 'css-core' + }, + html: { + files: root.map(path => path + '/*.html') + }, + markdown: { + files: root.map(path => path + '/*.md') + }, + options: { + livereload: true + } + }, + + retire: { + js: [ 'js/reveal.js', 'lib/js/*.js', 'plugin/**/*.js' ], + node: [ '.' ] + } + + }); + + // Dependencies + grunt.loadNpmTasks( 'grunt-contrib-connect' ); + grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); + grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-contrib-qunit' ); + grunt.loadNpmTasks( 'grunt-contrib-uglify' ); + grunt.loadNpmTasks( 'grunt-contrib-watch' ); + grunt.loadNpmTasks( 'grunt-autoprefixer' ); + grunt.loadNpmTasks( 'grunt-retire' ); + grunt.loadNpmTasks( 'grunt-sass' ); + grunt.loadNpmTasks( 'grunt-zip' ); + + // Default task + grunt.registerTask( 'default', [ 'css', 'js' ] ); + + // JS task + grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] ); + + // Theme CSS + grunt.registerTask( 'css-themes', [ 'sass:themes' ] ); + + // Core framework CSS + grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] ); + + // All CSS + grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] ); + + // Package presentation to archive + grunt.registerTask( 'package', [ 'default', 'zip' ] ); + + // Serve presentation locally + grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); + + // Run tests + grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); + +}; diff --git a/reveal-js/LICENSE b/reveal-js/LICENSE new file mode 100644 index 0000000..1b8b5a7 --- /dev/null +++ b/reveal-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2018 Hakim El Hattab, http://hakim.se, and reveal.js contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/reveal-js/README.md b/reveal-js/README.md new file mode 100644 index 0000000..940e746 --- /dev/null +++ b/reveal-js/README.md @@ -0,0 +1,1309 @@ +# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) Slides + +A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://revealjs.com/). + +reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github). + + +## Table of contents + +- [Online Editor](#online-editor) +- [Installation](#installation) + - [Basic setup](#basic-setup) + - [Full setup](#full-setup) + - [Folder Structure](#folder-structure) +- [Instructions](#instructions) + - [Markup](#markup) + - [Markdown](#markdown) + - [Element Attributes](#element-attributes) + - [Slide Attributes](#slide-attributes) +- [Configuration](#configuration) +- [Presentation Size](#presentation-size) +- [Dependencies](#dependencies) +- [Ready Event](#ready-event) +- [Auto-sliding](#auto-sliding) +- [Keyboard Bindings](#keyboard-bindings) +- [Touch Navigation](#touch-navigation) +- [Lazy Loading](#lazy-loading) +- [API](#api) + - [Slide Changed Event](#slide-changed-event) + - [Presentation State](#presentation-state) + - [Slide States](#slide-states) + - [Slide Backgrounds](#slide-backgrounds) + - [Parallax Background](#parallax-background) + - [Slide Transitions](#slide-transitions) + - [Internal links](#internal-links) + - [Fragments](#fragments) + - [Fragment events](#fragment-events) + - [Code syntax highlighting](#code-syntax-highlighting) + - [Slide number](#slide-number) + - [Overview mode](#overview-mode) + - [Fullscreen mode](#fullscreen-mode) + - [Embedded media](#embedded-media) + - [Stretching elements](#stretching-elements) + - [postMessage API](#postmessage-api) +- [PDF Export](#pdf-export) +- [Theming](#theming) +- [Speaker Notes](#speaker-notes) + - [Share and Print Speaker Notes](#share-and-print-speaker-notes) + - [Server Side Speaker Notes](#server-side-speaker-notes) +- [Multiplexing](#multiplexing) + - [Master presentation](#master-presentation) + - [Client presentation](#client-presentation) + - [Socket.io server](#socketio-server) +- [MathJax](#mathjax) +- [License](#license) + +#### More reading + +- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history. +- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own! +- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks. +- [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js. + + +## Online Editor + +Presentations are written using HTML or Markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [https://slides.com](https://slides.com?ref=github). + + +## Installation + +The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features and plugins such as speaker notes as well as the development tasks needed to make changes to the source. + +### Basic setup + +The core of reveal.js is very easy to install. You'll simply need to download a copy of this repository and open the index.html file directly in your browser. + +1. Download the latest version of reveal.js from +2. Unzip and replace the example contents in index.html with your own +3. Open index.html in a browser to view it + +### Full setup + +Some reveal.js features, like external Markdown and speaker notes, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code. + +1. Install [Node.js](http://nodejs.org/) (4.0.0 or later) + +1. Clone the reveal.js repository + ```sh + $ git clone https://github.com/hakimel/reveal.js.git + ``` + +1. Navigate to the reveal.js folder + ```sh + $ cd reveal.js + ``` + +1. Install dependencies + ```sh + $ npm install + ``` + +1. Serve the presentation and monitor source files for changes + ```sh + $ npm start + ``` + +1. Open to view your presentation + + You can change the port by using `npm start -- --port=8001`. + +### Folder Structure + +- **css/** Core styles without which the project does not function +- **js/** Like above but for JavaScript +- **plugin/** Components that have been developed as extensions to reveal.js +- **lib/** All other third party assets (JavaScript, CSS, fonts) + + +## Instructions + +### Markup + +Here's a barebones example of a fully working reveal.js presentation: +```html + + + + + + +
    +
    +
    Slide 1
    +
    Slide 2
    +
    +
    + + + + +``` + +The presentation markup hierarchy needs to be `.reveal > .slides > section` where the `section` represents one slide and can be repeated indefinitely. If you place multiple `section` elements inside of another `section` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and will be included in the horizontal sequence. For example: + +```html +
    +
    +
    Single Horizontal Slide
    +
    +
    Vertical Slide 1
    +
    Vertical Slide 2
    +
    +
    +
    +``` + +### Markdown + +It's possible to write your slides using Markdown. To enable Markdown, add the `data-markdown` attribute to your `
    ` elements and wrap the contents in a ` +
    +``` + +#### External Markdown + +You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file: the `data-separator` attribute defines a regular expression for horizontal slides (defaults to `^\r?\n---\r?\n$`, a newline-bounded horizontal rule) and `data-separator-vertical` defines vertical slides (disabled by default). The `data-separator-notes` attribute is a regular expression for specifying the beginning of the current slide's speaker notes (defaults to `notes?:`, so it will match both "note:" and "notes:"). The `data-charset` attribute is optional and specifies which charset to use when loading the external file. + +When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). The following example customises all available options: + +```html +
    + +
    +``` + +#### Element Attributes + +Special syntax (through HTML comments) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things. + +```html +
    + +
    +``` + +#### Slide Attributes + +Special syntax (through HTML comments) is available for adding attributes to the slide `
    ` elements generated by your Markdown. + +```html +
    + +
    +``` + +#### Configuring *marked* + +We use [marked](https://github.com/chjj/marked) to parse Markdown. To customise marked's rendering, you can pass in options when [configuring Reveal](#configuration): + +```javascript +Reveal.initialize({ + // Options which are passed into marked + // See https://github.com/chjj/marked#options-1 + markdown: { + smartypants: true + } +}); +``` + +### Configuration + +At the end of your page you need to initialize reveal by running the following code. Note that all configuration values are optional and will default to the values specified below. + +```javascript +Reveal.initialize({ + + // Display presentation control arrows + controls: true, + + // Help the user learn the controls by providing hints, for example by + // bouncing the down arrow when they first encounter a vertical slide + controlsTutorial: true, + + // Determines where controls appear, "edges" or "bottom-right" + controlsLayout: 'bottom-right', + + // Visibility rule for backwards navigation arrows; "faded", "hidden" + // or "visible" + controlsBackArrows: 'faded', + + // Display a presentation progress bar + progress: true, + + // Display the page number of the current slide + slideNumber: false, + + // Push each slide change to the browser history + history: false, + + // Enable keyboard shortcuts for navigation + keyboard: true, + + // Enable the slide overview mode + overview: true, + + // Vertical centering of slides + center: true, + + // Enables touch navigation on devices with touch input + touch: true, + + // Loop the presentation + loop: false, + + // Change the presentation direction to be RTL + rtl: false, + + // Randomizes the order of slides each time the presentation loads + shuffle: false, + + // Turns fragments on and off globally + fragments: true, + + // Flags whether to include the current fragment in the URL, + // so that reloading brings you to the same fragment position + fragmentInURL: false, + + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: false, + + // Flags if we should show a help overlay when the questionmark + // key is pressed + help: true, + + // Flags if speaker notes should be visible to all viewers + showNotes: false, + + // Global override for autoplaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - true: All media will autoplay, regardless of individual setting + // - false: No media will autoplay, regardless of individual setting + autoPlayMedia: null, + + // Number of milliseconds between automatically proceeding to the + // next slide, disabled when set to 0, this value can be overwritten + // by using a data-autoslide attribute on your slides + autoSlide: 0, + + // Stop auto-sliding after user input + autoSlideStoppable: true, + + // Use this method for navigation when auto-sliding + autoSlideMethod: Reveal.navigateNext, + + // Specify the average time in seconds that you think you will spend + // presenting each slide. This is used to show a pacing timer in the + // speaker view + defaultTiming: 120, + + // Enable slide navigation via mouse wheel + mouseWheel: false, + + // Hides the address bar on mobile devices + hideAddressBar: true, + + // Opens links in an iframe preview overlay + // Add `data-preview-link` and `data-preview-link="false"` to customise each link + // individually + previewLinks: false, + + // Transition style + transition: 'slide', // none/fade/slide/convex/concave/zoom + + // Transition speed + transitionSpeed: 'default', // default/fast/slow + + // Transition style for full page slide backgrounds + backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom + + // Number of slides away from the current that are visible + viewDistance: 3, + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" + + // Number of pixels to move the parallax background per slide + // - Calculated automatically unless specified + // - Set to 0 to disable movement along an axis + parallaxBackgroundHorizontal: null, + parallaxBackgroundVertical: null, + + // The display mode that will be used to show slides + display: 'block' + +}); +``` + +The configuration can be updated after initialization using the `configure` method: + +```javascript +// Turn autoSlide off +Reveal.configure({ autoSlide: 0 }); + +// Start auto-sliding every 5s +Reveal.configure({ autoSlide: 5000 }); +``` + +### Presentation Size + +All presentations have a normal size, that is, the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport. + +See below for a list of configuration options related to sizing, including default values: + +```javascript +Reveal.initialize({ + + // ... + + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions. Can be + // specified using percentage units. + width: 960, + height: 700, + + // Factor of the display size that should remain empty around the content + margin: 0.1, + + // Bounds for smallest/largest possible scale to apply to content + minScale: 0.2, + maxScale: 1.5 + +}); +``` + +If you wish to disable this behavior and do your own scaling (e.g. using media queries), try these settings: + +```javascript +Reveal.initialize({ + + // ... + + width: "100%", + height: "100%", + margin: 0, + minScale: 1, + maxScale: 1 +}); +``` + +### Dependencies + +Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example: + +```javascript +Reveal.initialize({ + dependencies: [ + // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, + + // Interpret Markdown in
    elements + { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + + // Syntax highlight for elements + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + + // Zoom in and out with Alt+click + { src: 'plugin/zoom-js/zoom.js', async: true }, + + // Speaker notes + { src: 'plugin/notes/notes.js', async: true }, + + // MathJax + { src: 'plugin/math/math.js', async: true } + ] +}); +``` + +You can add your own extensions using the same syntax. The following properties are available for each dependency object: +- **src**: Path to the script to load +- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false +- **callback**: [optional] Function to execute when the script has loaded +- **condition**: [optional] Function which must return true for the script to be loaded + +To load these dependencies, reveal.js requires [head.js](http://headjs.com/) *(a script loading library)* to be loaded before reveal.js. + +### Ready Event + +A `ready` event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`. + +```javascript +Reveal.addEventListener( 'ready', function( event ) { + // event.currentSlide, event.indexh, event.indexv +} ); +``` + +Note that we also add a `.ready` class to the `.reveal` element so that you can hook into this with CSS. + +### Auto-sliding + +Presentations can be configured to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides: + +```javascript +// Slide every five seconds +Reveal.configure({ + autoSlide: 5000 +}); +``` + +When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »A« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying `autoSlideStoppable: false` in your reveal.js config. + +You can also override the slide duration for individual slides and fragments by using the `data-autoslide` attribute: + +```html +
    +

    After 2 seconds the first fragment will be shown.

    +

    After 10 seconds the next fragment will be shown.

    +

    Now, the fragment is displayed for 2 seconds before the next slide is shown.

    +
    +``` + +To override the method used for navigation when auto-sliding, you can specify the `autoSlideMethod` setting. To only navigate along the top layer and ignore vertical slides, set this to `Reveal.navigateRight`. + +Whenever the auto-slide mode is resumed or paused the `autoslideresumed` and `autoslidepaused` events are fired. + +### Keyboard Bindings + +If you're unhappy with any of the default keyboard bindings you can override them using the `keyboard` config option: + +```javascript +Reveal.configure({ + keyboard: { + 13: 'next', // go to the next slide when the ENTER key is pressed + 27: function() {}, // do something custom when ESC is pressed + 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding) + } +}); +``` + +### Touch Navigation + +You can swipe to navigate through a presentation on any touch-enabled device. Horizontal swipes change between horizontal slides, vertical swipes change between vertical slides. If you wish to disable this you can set the `touch` config option to false when initializing reveal.js. + +If there's some part of your content that needs to remain accessible to touch events you'll need to highlight this by adding a `data-prevent-swipe` attribute to the element. One common example where this is useful is elements that need to be scrolled. + +### Lazy Loading + +When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option. + +To enable lazy loading all you need to do is change your `src` attributes to `data-src` as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible. + +```html +
    + + + +
    +``` + +### API + +The `Reveal` object exposes a JavaScript API for controlling navigation and reading state: + +```javascript +// Navigation +Reveal.slide( indexh, indexv, indexf ); +Reveal.left(); +Reveal.right(); +Reveal.up(); +Reveal.down(); +Reveal.prev(); +Reveal.next(); +Reveal.prevFragment(); +Reveal.nextFragment(); + +// Randomize the order of slides +Reveal.shuffle(); + +// Toggle presentation states, optionally pass true/false to force on/off +Reveal.toggleOverview(); +Reveal.togglePause(); +Reveal.toggleAutoSlide(); + +// Shows a help overlay with keyboard shortcuts, optionally pass true/false +// to force on/off +Reveal.toggleHelp(); + +// Change a config value at runtime +Reveal.configure({ controls: true }); + +// Returns the present configuration options +Reveal.getConfig(); + +// Fetch the current scale of the presentation +Reveal.getScale(); + +// Retrieves the previous and current slide elements +Reveal.getPreviousSlide(); +Reveal.getCurrentSlide(); + +Reveal.getIndices(); // { h: 0, v: 0, f: 0 } +Reveal.getSlidePastCount(); +Reveal.getProgress(); // (0 == first slide, 1 == last slide) +Reveal.getSlides(); // Array of all slides +Reveal.getTotalSlides(); // Total number of slides + +// Returns the speaker notes for the current slide +Reveal.getSlideNotes(); + +// State checks +Reveal.isFirstSlide(); +Reveal.isLastSlide(); +Reveal.isOverview(); +Reveal.isPaused(); +Reveal.isAutoSliding(); +``` + +### Custom Key Bindings + +Custom key bindings can be added and removed using the following Javascript API. Custom key bindings will override the default keyboard bindings, but will in turn be overridden by the user defined bindings in the ``keyboard`` config option. + +```javascript +Reveal.addKeyBinding( binding, callback ); +Reveal.removeKeyBinding( keyCode ); +``` + +For example + +```javascript +// The binding parameter provides the following properties +// keyCode: the keycode for binding to the callback +// key: the key label to show in the help overlay +// description: the description of the action to show in the help overlay +Reveal.addKeyBinding( { keyCode: 84, key: 'T', description: 'Start timer' }, function() { + // start timer +} ) + +// The binding parameter can also be a direct keycode without providing the help description +Reveal.addKeyBinding( 82, function() { + // reset timer +} ) +``` + +This allows plugins to add key bindings directly to Reveal so they can + +* make use of Reveal's pre-processing logic for key handling (for example, ignoring key presses when paused); and +* be included in the help overlay (optional) + +### Slide Changed Event + +A `slidechanged` event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes. + +Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'slidechanged', function( event ) { + // event.previousSlide, event.currentSlide, event.indexh, event.indexv +} ); +``` + +### Presentation State + +The presentation's current state can be fetched by using the `getState` method. A state object contains all of the information required to put the presentation back as it was when `getState` was first called. Sort of like a snapshot. It's a simple object that can easily be stringified and persisted or sent over the wire. + +```javascript +Reveal.slide( 1 ); +// we're on slide 1 + +var state = Reveal.getState(); + +Reveal.slide( 3 ); +// we're on slide 3 + +Reveal.setState( state ); +// we're back on slide 1 +``` + +### Slide States + +If you set `data-state="somestate"` on a slide `
    `, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide. + +Furthermore you can also listen to these changes in state via JavaScript: + +```javascript +Reveal.addEventListener( 'somestate', function() { + // TODO: Sprinkle magic +}, false ); +``` + +### Slide Backgrounds + +Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a `data-background` attribute to your `
    ` elements. Four different types of backgrounds are supported: color, image, video and iframe. + +#### Color Backgrounds + +All CSS color formats are supported, including hex values, keywords, `rgba()` or `hsl()`. + +```html +
    +

    Color

    +
    +``` + +#### Image Backgrounds + +By default, background images are resized to cover the full page. Available options: + +| Attribute | Default | Description | +| :------------------------------- | :--------- | :---------- | +| data-background-image | | URL of the image to show. GIFs restart when the slide opens. | +| data-background-size | cover | See [background-size](https://developer.mozilla.org/docs/Web/CSS/background-size) on MDN. | +| data-background-position | center | See [background-position](https://developer.mozilla.org/docs/Web/CSS/background-position) on MDN. | +| data-background-repeat | no-repeat | See [background-repeat](https://developer.mozilla.org/docs/Web/CSS/background-repeat) on MDN. | +| data-background-opacity | 1 | Opacity of the background image on a 0-1 scale. 0 is transparent and 1 is fully opaque. | + +```html +
    +

    Image

    +
    +
    +

    This background image will be sized to 100px and repeated

    +
    +``` + +#### Video Backgrounds + +Automatically plays a full size video behind the slide. + +| Attribute | Default | Description | +| :--------------------------- | :------ | :---------- | +| data-background-video | | A single video source, or a comma separated list of video sources. | +| data-background-video-loop | false | Flags if the video should play repeatedly. | +| data-background-video-muted | false | Flags if the audio should be muted. | +| data-background-size | cover | Use `cover` for full screen and some cropping or `contain` for letterboxing. | +| data-background-opacity | 1 | Opacity of the background video on a 0-1 scale. 0 is transparent and 1 is fully opaque. | + +```html +
    +

    Video

    +
    +``` + +#### Iframe Backgrounds + +Embeds a web page as a slide background that covers 100% of the reveal.js width and height. The iframe is in the background layer, behind your slides, and as such it's not possible to interact with it by default. To make your background interactive, you can add the `data-background-interactive` attribute. + +```html +
    +

    Iframe

    +
    +``` + +#### Background Transitions + +Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing `backgroundTransition: 'slide'` to the `Reveal.initialize()` call. Alternatively you can set `data-background-transition` on any section with a background to override that specific transition. + + +### Parallax Background + +If you want to use a parallax scrolling background, set the first two properties below when initializing reveal.js (the other two are optional). + +```javascript +Reveal.initialize({ + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto) + + // Number of pixels to move the parallax background per slide + // - Calculated automatically unless specified + // - Set to 0 to disable movement along an axis + parallaxBackgroundHorizontal: 200, + parallaxBackgroundVertical: 50 + +}); +``` + +Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://revealjs.com/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px). + +### Slide Transitions + +The global presentation transition is set using the `transition` config value. You can override the global transition for a specific slide by using the `data-transition` attribute: + +```html +
    +

    This slide will override the presentation transition and zoom!

    +
    + +
    +

    Choose from three transition speeds: default, fast or slow!

    +
    +``` + +You can also use different in and out transitions for the same slide: + +```html +
    + The train goes on … +
    +
    + and on … +
    +
    + and stops. +
    +
    + (Passengers entering and leaving) +
    +
    + And it starts again. +
    +``` +You can choose from `none`, `fade`, `slide`, `convex`, `concave` and `zoom`. +### Internal links + +It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (`
    `): + +```html +Link +Link +``` + +You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an `enabled` class when it's a valid navigation route based on the current slide. + +```html + + + + + + +``` + +### Fragments + +Fragments are used to highlight individual elements on a slide. Every element with the class `fragment` will be stepped through before moving on to the next slide. Here's an example: http://revealjs.com/#/fragments + +The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment: + +```html +
    +

    grow

    +

    shrink

    +

    fade-out

    +

    fade-up (also down, left and right!)

    +

    fades in, then out when we move to the next step

    +

    fades in, then obfuscate when we move to the next step

    +

    blue only once

    +

    highlight-red

    +

    highlight-green

    +

    highlight-blue

    +
    +``` + +Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second. + +```html +
    + + I'll fade in, then out + +
    +``` + +The display order of fragments can be controlled using the `data-fragment-index` attribute. + +```html +
    +

    Appears last

    +

    Appears first

    +

    Appears second

    +
    +``` + +### Fragment events + +When a slide fragment is either shown or hidden reveal.js will dispatch an event. + +Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'fragmentshown', function( event ) { + // event.fragment = the fragment DOM element +} ); +Reveal.addEventListener( 'fragmenthidden', function( event ) { + // event.fragment = the fragment DOM element +} ); +``` + +### Code syntax highlighting + +By default, Reveal is configured with [highlight.js](https://highlightjs.org/) for code syntax highlighting. To enable syntax highlighting, you'll have to load the highlight plugin ([plugin/highlight/highlight.js](plugin/highlight/highlight.js)) and a highlight.js CSS theme (Reveal comes packaged with the zenburn theme: [lib/css/zenburn.css](lib/css/zenburn.css)). + +```javascript +Reveal.initialize({ + // More info https://github.com/hakimel/reveal.js#dependencies + dependencies: [ + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + ] +}); +``` + +Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `` to call out a line of code, add the `data-noescape` attribute to the `` element. + +```html +
    +
    
    +(def lazy-fib
    +  (concat
    +   [0 1]
    +   ((fn rfib [a b]
    +        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
    +	
    +
    +``` + +### Slide number + +If you would like to display the page number of the current slide you can do so using the `slideNumber` and `showSlideNumber` configuration values. + +```javascript +// Shows the slide number using default formatting +Reveal.configure({ slideNumber: true }); + +// Slide number formatting can be configured using these variables: +// "h.v": horizontal . vertical slide number (default) +// "h/v": horizontal / vertical slide number +// "c": flattened slide number +// "c/t": flattened slide number / total slides +Reveal.configure({ slideNumber: 'c/t' }); + +// Control which views the slide number displays on using the "showSlideNumber" value: +// "all": show on all views (default) +// "speaker": only show slide numbers on speaker notes view +// "print": only show slide numbers when printing to PDF +Reveal.configure({ showSlideNumber: 'speaker' }); +``` + +### Overview mode + +Press »ESC« or »O« keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides, +as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks: + +```javascript +Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } ); +Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } ); + +// Toggle the overview mode programmatically +Reveal.toggleOverview(); +``` + +### Fullscreen mode + +Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. + +### Embedded media + +Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown: + +```html + +``` + +If you want to enable or disable autoplay globally, for all embedded media, you can use the `autoPlayMedia` configuration option. If you set this to `true` ALL media will autoplay regardless of individual `data-autoplay` attributes. If you initialize with `autoPlayMedia: false` NO media will autoplay. + +Note that embedded HTML5 `