diff --git a/build.js b/build.js index a777c81..2993bca 100644 --- a/build.js +++ b/build.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +const dedent = require("dedent"); const ejs = require("ejs"); const fs = require("fs"); @@ -12,8 +13,9 @@ function getCurrentId() { function example(code) { const magicBrackets = /\[\[(.*)\]\]/g; - const inline = code.replace(magicBrackets, "$1"); - const escaped = code + const dedented = dedent(code); + const inline = dedented.replace(magicBrackets, "$1"); + const escaped = dedented .replace(magicBrackets, "") .replace(//g, ">"); diff --git a/docs/index.html.ejs b/docs/index.html.ejs index 8cace6a..fbd6776 100644 --- a/docs/index.html.ejs +++ b/docs/index.html.ejs @@ -141,16 +141,10 @@ being able to click the entire label to select the box).
-<input type="checkbox" id="example1">
-<label for="example1">This is a checkbox</label>
-
Checkboxes can be selected and disabled with the standard checked
and disabled
@@ -162,36 +156,20 @@
a consistent spacing between inputs.
<div class="field-row">
- <input checked type="checkbox" id="example2">
- <label for="example2">I am checked</label>
-</div>
-<div class="field-row">
- <input disabled type="checkbox" id="example3">
- <label for="example3">I am inactive</label>
-</div>
-<div class="field-row">
- <input checked disabled type="checkbox" id="example4">
- <label for="example4">I am inactive but still checked</label>
-</div>
- field-row
class to ensure a consistent spacing between inputs.
- <div class="field-row">
- <input id="radio1" type="radio" name="first-example">
- <label for="radio1">Yes</label>
-</div>
-<div class="field-row">
- <input id="radio2" type="radio" name="first-example">
- <label for="radio2">No</label>
-</div>
-
Option buttons can also be checked
and disabled
with their corresponding
HTML attributes.
<div class="field-row">
- <input id="radio3" type="radio" name="second-example">
- <label for="radio3">Peanut butter should be smooth</label>
-</div>
-<div class="field-row">
- <input checked disabled id="radio4" type="radio" name="second-example">
- <label for="radio4">I understand why people like crunchy peanut butter</label>
-</div>
-<div class="field-row">
- <input disabled id="radio5" type="radio" name="second-example">
- <label for="radio5">Crunchy peanut butter is good</label>
-</div>
-