mirror of
https://github.com/jdan/98.css.git
synced 2025-01-17 04:38:30 +01:00
basic template setup
This commit is contained in:
parent
dd3922d691
commit
a3f9651982
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
docs/index.html
|
||||
node_modules/
|
22
build.js
Normal file
22
build.js
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env node
|
||||
const ejs = require("ejs");
|
||||
const fs = require("fs");
|
||||
|
||||
let id = 0;
|
||||
function getNewId() {
|
||||
return ++id;
|
||||
}
|
||||
function getCurrentId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
function buildDocs() {
|
||||
const template = fs.readFileSync("./docs/index.html.ejs", "utf-8");
|
||||
|
||||
fs.writeFileSync(
|
||||
"./docs/index.html",
|
||||
ejs.render(template, { getNewId, getCurrentId })
|
||||
);
|
||||
}
|
||||
|
||||
buildDocs();
|
@ -166,8 +166,8 @@
|
||||
</p>
|
||||
|
||||
<div class="example">
|
||||
<input type="checkbox" id="example1">
|
||||
<label for="example1">This is a checkbox</label>
|
||||
<input type="checkbox" id="example<%= getNewId() %>">
|
||||
<label for="example<%= getCurrentId() %>">This is a checkbox</label>
|
||||
|
||||
<details>
|
||||
<summary>Show code</summary>
|
||||
@ -188,8 +188,8 @@
|
||||
|
||||
<div class="example">
|
||||
<div class="field-row">
|
||||
<input checked type="checkbox" id="example2">
|
||||
<label for="example2">I am checked</label>
|
||||
<input checked type="checkbox" id="example<%= getNewId() %>">
|
||||
<label for="example<%= getCurrentId() %>">I am checked</label>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<input disabled type="checkbox" id="example3">
|
14
package-lock.json
generated
Normal file
14
package-lock.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "98.css",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ejs": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.0.2.tgz",
|
||||
"integrity": "sha512-IncmUpn1yN84hy2shb0POJ80FWrfGNY0cxO9f4v+/sG7qcBvAtVWUA1IdzY/8EYUmOVhoKJVdJjNd3AZcnxOjA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,8 @@
|
||||
"doc": "docs"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "./build.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -22,5 +23,8 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/jdan/windows98.css/issues"
|
||||
},
|
||||
"homepage": "https://github.com/jdan/windows98.css#readme"
|
||||
"homepage": "https://github.com/jdan/windows98.css#readme",
|
||||
"devDependencies": {
|
||||
"ejs": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user