-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
185 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#generator { | ||
label { | ||
font-size: 24px; | ||
font-weight: 400; | ||
margin-bottom: 0.5em; | ||
display: block; | ||
} | ||
|
||
fieldset label { | ||
font-size: 20px; | ||
} | ||
|
||
fieldset { | ||
border: none; | ||
padding: 0; | ||
} | ||
|
||
legend { | ||
font-size: 24px; | ||
font-weight: 400; | ||
} | ||
|
||
.checkboxes { | ||
margin-top: 8px; | ||
padding-left: 24px; | ||
label { | ||
cursor: pointer; | ||
} | ||
> div { | ||
margin-top: 2rem; | ||
margin-bottom: 1rem; | ||
} | ||
} | ||
|
||
.mb-4 { | ||
margin-bottom: 24px; | ||
} | ||
|
||
.my-2 { | ||
margin-top: 1rem; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.text-sm { | ||
font-size: 80%; | ||
} | ||
|
||
.text-red { | ||
color: #eb5757; | ||
} | ||
|
||
button { | ||
text-transform: none; | ||
-webkit-appearance: button; | ||
font-family: inherit; | ||
font-size: 24px; | ||
line-height: 1.15; | ||
margin: 0 0 3rem 0; | ||
border-radius: 1em; | ||
border: none; | ||
background-color: #4ba0a5; | ||
padding: 1em 24px; | ||
color: white; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: #00b6af; | ||
} | ||
} | ||
|
||
input[type="text"], | ||
input[type="url"], | ||
input[type="email"], | ||
select, | ||
textarea { | ||
font-size: 1.8rem; | ||
width: 100%; | ||
border-radius: 10px; | ||
padding: 1rem 24px; | ||
border: 2px solid #c8cdd0; | ||
&:focus { | ||
border-color: #00b6af; | ||
outline: none; | ||
} | ||
&:read-only { | ||
&:focus { | ||
border-color: #c8cdd0; | ||
} | ||
font-size: 1.2rem; | ||
padding: 1rem 1rem; | ||
} | ||
} | ||
|
||
dt { | ||
font-weight: 600; | ||
} | ||
dd { | ||
margin-bottom: 3rem; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Debugging Help | ||
// Use console.error, not console.log | ||
// | ||
// Replaces {{#GENERATOR}} with the ./src/Generator/index.html data | ||
|
||
import { readFileSync } from "node:fs"; | ||
|
||
function generatorEmbed(chapter) { | ||
const regex = /{{#GENERATOR}}/g; | ||
const matches = [...chapter.content.matchAll(regex)]; | ||
matches.forEach((match) => { | ||
try { | ||
const output = readFileSync("./src/Generator/index.html", "utf8"); | ||
|
||
const replaceWith = output | ||
.split("\n") | ||
.map((line) => line.trim().replace("./_app/", "./Generator/_app/")) | ||
.join("\n"); | ||
chapter.content = chapter.content.replace(match[0], replaceWith); | ||
} catch (e) { | ||
console.error( | ||
"Unable to read the generated Generator script. Looks like you need to follow the instructions in tools/signed-request-generator/README.md", | ||
); | ||
throw e; | ||
} | ||
}); | ||
if (chapter.sub_items) { | ||
chapter.sub_items.forEach((section) => { | ||
section.Chapter && generatorEmbed(section.Chapter); | ||
}); | ||
} | ||
} | ||
|
||
// Function to perform the preprocessing | ||
function preprocessMdBook([_context, book]) { | ||
// Generator Embed | ||
book.sections.forEach((section) => { | ||
section.Chapter && generatorEmbed(section.Chapter); | ||
}); | ||
|
||
// Output the processed content in mdbook preprocessor format | ||
process.stdout.write(JSON.stringify(book)); | ||
} | ||
|
||
if (process.argv < 3) { | ||
throw new Error("Something strange is happening"); | ||
} | ||
|
||
if (process.argv[2] === "supports") { | ||
process.exit(0); | ||
} | ||
|
||
process.stdin.setEncoding("utf-8"); | ||
process.stdout.setEncoding("utf-8"); | ||
|
||
// Read data from stdin | ||
let inputData = ""; | ||
|
||
process.stdin.on("data", (chunk) => { | ||
inputData += chunk; | ||
}); | ||
|
||
process.stdin.on("end", () => { | ||
preprocessMdBook(JSON.parse(inputData)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.