mirror of
https://github.com/jdan/98.css.git
synced 2025-08-30 17:19:56 +02:00
add highlight.js
This commit is contained in:
7
build.js
7
build.js
@@ -2,6 +2,7 @@
|
|||||||
const dedent = require("dedent");
|
const dedent = require("dedent");
|
||||||
const ejs = require("ejs");
|
const ejs = require("ejs");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const hljs = require("highlight.js");
|
||||||
const mkdirp = require("mkdirp");
|
const mkdirp = require("mkdirp");
|
||||||
const postcss = require("postcss");
|
const postcss = require("postcss");
|
||||||
|
|
||||||
@@ -17,10 +18,8 @@ function example(code) {
|
|||||||
const magicBrackets = /\[\[(.*)\]\]/g;
|
const magicBrackets = /\[\[(.*)\]\]/g;
|
||||||
const dedented = dedent(code);
|
const dedented = dedent(code);
|
||||||
const inline = dedented.replace(magicBrackets, "$1");
|
const inline = dedented.replace(magicBrackets, "$1");
|
||||||
const escaped = dedented
|
const escaped = hljs.highlight("html", dedented.replace(magicBrackets, ""))
|
||||||
.replace(magicBrackets, "")
|
.value;
|
||||||
.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">");
|
|
||||||
|
|
||||||
return `<div class="example">
|
return `<div class="example">
|
||||||
${inline}
|
${inline}
|
||||||
|
@@ -511,10 +511,10 @@ pre {
|
|||||||
inset 2px 2px #0a0a0a;
|
inset 2px 2px #0a0a0a;
|
||||||
padding: 12px 8px;
|
padding: 12px 8px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: monospace;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code,
|
||||||
|
code * {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -511,10 +511,10 @@ pre {
|
|||||||
inset 2px 2px #0a0a0a;
|
inset 2px 2px #0a0a0a;
|
||||||
padding: 12px 8px;
|
padding: 12px 8px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: monospace;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code,
|
||||||
|
code * {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="stylesheet" href="98.css"></style>
|
<link rel="stylesheet" href="98.css"></style>
|
||||||
<link rel="stylesheet" href="docs.css"></style>
|
<link rel="stylesheet" href="docs.css"></style>
|
||||||
|
<link rel="stylesheet" href="vs.css"></style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<aside>
|
<aside>
|
||||||
@@ -14,11 +15,20 @@
|
|||||||
<a href="#components">Components</a>
|
<a href="#components">Components</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#button">Button</a></li>
|
<li><a href="#button">Button</a></li>
|
||||||
<li><a href="#dialog">Dialog</a></li>
|
|
||||||
<li><a href="#checkbox">Checkbox</a></li>
|
<li><a href="#checkbox">Checkbox</a></li>
|
||||||
<li><a href="#option-button">OptionButton</a></li>
|
<li><a href="#option-button">OptionButton</a></li>
|
||||||
|
<li><a href="#fieldset">Fieldset</a></li>
|
||||||
<li><a href="#text-box">TextBox</a></li>
|
<li><a href="#text-box">TextBox</a></li>
|
||||||
<li><a href="#multiline-text-box">Multiline TextBox</a></li>
|
<li><a href="#multiline-text-box">Multiline TextBox</a></li>
|
||||||
|
<li>
|
||||||
|
<a href="#dialog">Dialog</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#menubar">Menubar</a></li>
|
||||||
|
<li><a href="#controls">Controls</a></li>
|
||||||
|
<li><a href="#all-together">All together</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="#treeview">TreeView</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#extras">Extras</a></li>
|
<li><a href="#extras">Extras</a></li>
|
||||||
@@ -98,7 +108,7 @@
|
|||||||
<button>Click me</button>
|
<button>Click me</button>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><button>Click me</button></code></pre>
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">button</span>></span>Click me<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -112,7 +122,7 @@
|
|||||||
<button class="active">I am being pressed</button>
|
<button class="active">I am being pressed</button>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><button>I am being pressed</button></code></pre>
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">button</span>></span>I am being pressed<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -125,7 +135,7 @@
|
|||||||
<button disabled>I cannot be clicked</button>
|
<button disabled>I cannot be clicked</button>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><button disabled>I cannot be clicked</button></code></pre>
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">disabled</span>></span>I cannot be clicked<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -138,7 +148,7 @@
|
|||||||
<button class="focused">I am focused</button>
|
<button class="focused">I am focused</button>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><button>I am focused</button></code></pre>
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">button</span>></span>I am focused<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -170,8 +180,8 @@
|
|||||||
<label for="example1">This is a checkbox</label>
|
<label for="example1">This is a checkbox</label>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><input type="checkbox" id="example1">
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"checkbox"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example1"</span>></span>
|
||||||
<label for="example1">This is a checkbox</label></code></pre>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"example1"</span>></span>This is a checkbox<span class="hljs-tag"></<span class="hljs-name">label</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -200,18 +210,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><div class="field-row">
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input checked type="checkbox" id="example2">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">checked</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"checkbox"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example2"</span>></span>
|
||||||
<label for="example2">I am checked</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"example2"</span>></span>I am checked<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||||
<div class="field-row">
|
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input disabled type="checkbox" id="example3">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"checkbox"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example3"</span>></span>
|
||||||
<label for="example3">I am inactive</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"example3"</span>></span>I am inactive<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||||
<div class="field-row">
|
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input checked disabled type="checkbox" id="example4">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">checked</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"checkbox"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example4"</span>></span>
|
||||||
<label for="example4">I am inactive but still checked</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"example4"</span>></span>I am inactive but still checked<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div></code></pre>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -245,14 +255,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><div class="field-row">
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input id="radio5" type="radio" name="first-example">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"radio5"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"first-example"</span>></span>
|
||||||
<label for="radio5">Yes</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"radio5"</span>></span>Yes<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||||
<div class="field-row">
|
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input id="radio6" type="radio" name="first-example">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"radio6"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"first-example"</span>></span>
|
||||||
<label for="radio6">No</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"radio6"</span>></span>No<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div></code></pre>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -276,18 +286,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<details>
|
<details>
|
||||||
<summary>Show code</summary>
|
<summary>Show code</summary>
|
||||||
<pre><code><div class="field-row">
|
<pre><code><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input id="radio7" type="radio" name="second-example">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"radio7"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"second-example"</span>></span>
|
||||||
<label for="radio7">Peanut butter should be smooth</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"radio7"</span>></span>Peanut butter should be smooth<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||||
<div class="field-row">
|
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input checked disabled id="radio8" type="radio" name="second-example">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">checked</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"radio8"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"second-example"</span>></span>
|
||||||
<label for="radio8">I understand why people like crunchy peanut butter</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"radio8"</span>></span>I understand why people like crunchy peanut butter<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
||||||
<div class="field-row">
|
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"field-row"</span>></span>
|
||||||
<input disabled id="radio9" type="radio" name="second-example">
|
<span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"radio9"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"second-example"</span>></span>
|
||||||
<label for="radio9">Crunchy peanut butter is good</label>
|
<span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"radio9"</span>></span>Crunchy peanut butter is good<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
|
||||||
</div></code></pre>
|
<span class="hljs-tag"></<span class="hljs-name">div</span>></span></code></pre>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="stylesheet" href="98.css"></style>
|
<link rel="stylesheet" href="98.css"></style>
|
||||||
<link rel="stylesheet" href="docs.css"></style>
|
<link rel="stylesheet" href="docs.css"></style>
|
||||||
|
<link rel="stylesheet" href="vs.css"></style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<aside>
|
<aside>
|
||||||
@@ -14,11 +15,20 @@
|
|||||||
<a href="#components">Components</a>
|
<a href="#components">Components</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#button">Button</a></li>
|
<li><a href="#button">Button</a></li>
|
||||||
<li><a href="#dialog">Dialog</a></li>
|
|
||||||
<li><a href="#checkbox">Checkbox</a></li>
|
<li><a href="#checkbox">Checkbox</a></li>
|
||||||
<li><a href="#option-button">OptionButton</a></li>
|
<li><a href="#option-button">OptionButton</a></li>
|
||||||
|
<li><a href="#fieldset">Fieldset</a></li>
|
||||||
<li><a href="#text-box">TextBox</a></li>
|
<li><a href="#text-box">TextBox</a></li>
|
||||||
<li><a href="#multiline-text-box">Multiline TextBox</a></li>
|
<li><a href="#multiline-text-box">Multiline TextBox</a></li>
|
||||||
|
<li>
|
||||||
|
<a href="#dialog">Dialog</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#menubar">Menubar</a></li>
|
||||||
|
<li><a href="#controls">Controls</a></li>
|
||||||
|
<li><a href="#all-together">All together</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="#treeview">TreeView</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#extras">Extras</a></li>
|
<li><a href="#extras">Extras</a></li>
|
||||||
|
67
docs/vs.css
Normal file
67
docs/vs.css
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
|
||||||
|
|
||||||
|
*/
|
||||||
|
.hljs {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 0.5em;
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-comment,
|
||||||
|
.hljs-quote,
|
||||||
|
.hljs-variable {
|
||||||
|
color: #008000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-keyword,
|
||||||
|
.hljs-selector-tag,
|
||||||
|
.hljs-built_in,
|
||||||
|
.hljs-name,
|
||||||
|
.hljs-tag {
|
||||||
|
color: #00f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-string,
|
||||||
|
.hljs-title,
|
||||||
|
.hljs-section,
|
||||||
|
.hljs-attribute,
|
||||||
|
.hljs-literal,
|
||||||
|
.hljs-template-tag,
|
||||||
|
.hljs-template-variable,
|
||||||
|
.hljs-type,
|
||||||
|
.hljs-addition {
|
||||||
|
color: #a31515;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-deletion,
|
||||||
|
.hljs-selector-attr,
|
||||||
|
.hljs-selector-pseudo,
|
||||||
|
.hljs-meta {
|
||||||
|
color: #2b91af;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-doctag {
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-attr {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-symbol,
|
||||||
|
.hljs-bullet,
|
||||||
|
.hljs-link {
|
||||||
|
color: #00b0e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-emphasis {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hljs-strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
6
package-lock.json
generated
6
package-lock.json
generated
@@ -166,6 +166,12 @@
|
|||||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"highlight.js": {
|
||||||
|
"version": "9.18.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.1.tgz",
|
||||||
|
"integrity": "sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"htmlparser2": {
|
"htmlparser2": {
|
||||||
"version": "3.10.1",
|
"version": "3.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dedent": "^0.7.0",
|
"dedent": "^0.7.0",
|
||||||
"ejs": "^3.0.2",
|
"ejs": "^3.0.2",
|
||||||
|
"highlight.js": "^9.18.1",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4",
|
||||||
"postcss-css-variables": "^0.14.0",
|
"postcss-css-variables": "^0.14.0",
|
||||||
"postcss-inline": "^1.2.0",
|
"postcss-inline": "^1.2.0",
|
||||||
|
Reference in New Issue
Block a user