mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-03 20:43:50 +01:00
....turns out there *is* a GH alert markdown-it plugin!
Thanks, markdown-it-github-alerts :D A bit of CSS ~~hackery~~ magic and we're away!
This commit is contained in:
parent
8a143e9a4b
commit
d07c1709cf
@ -442,26 +442,50 @@ footer {
|
|||||||
border: 0.2em solid var(--cat-colour);
|
border: 0.2em solid var(--cat-colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
.note, .tip, .important, .warning, .caution {
|
.note, .tip, .important, .warning, .caution
|
||||||
|
.markdown-alert-note,
|
||||||
|
.markdown-alert-tip,
|
||||||
|
.markdown-alert-important,
|
||||||
|
.markdown-alert-warning,
|
||||||
|
.markdown-alert-caution
|
||||||
|
{
|
||||||
padding: 0.4em 0.6em;
|
padding: 0.4em 0.6em;
|
||||||
border-radius: 0 0.2em 0.2em 0;
|
border-radius: 0 0.2em 0.2em 0;
|
||||||
}
|
}
|
||||||
|
.markdown-alert-note::before,
|
||||||
.note::before { color: #31a0fc; content: "\0024d8\0000a0Note"; }
|
.note::before { color: #31a0fc; content: "\0024d8\0000a0Note"; }
|
||||||
|
.markdown-alert-tip::before,
|
||||||
.tip::before { color: #25cb1c; content: "\01f4a1\0000a0Tip"; }
|
.tip::before { color: #25cb1c; content: "\01f4a1\0000a0Tip"; }
|
||||||
.important::before { color: #911ccb; content: "\01f53a\0000a0Important"; }
|
.markdown-alert-important::before,
|
||||||
|
.important::before { color: #911ccb; content: "\01f7e3\0000a0Important"; }
|
||||||
|
.markdown-alert-warning::before,
|
||||||
.warning::before { color: #e0b840; content: "\0026a0\0000a0Warning"; }
|
.warning::before { color: #e0b840; content: "\0026a0\0000a0Warning"; }
|
||||||
|
.markdown-alert-caution::before,
|
||||||
.caution::before { color: #e04040; content: "\00203c\0000a0Caution"; }
|
.caution::before { color: #e04040; content: "\00203c\0000a0Caution"; }
|
||||||
|
|
||||||
|
.markdown-alert-note::before,
|
||||||
|
.markdown-alert-tip::before,
|
||||||
|
.markdown-alert-important::before,
|
||||||
|
.markdown-alert-warning::before,
|
||||||
|
.markdown-alert-caution::before,
|
||||||
.note::before, .tip::before, .important::before, .warning::before, .caution::before {
|
.note::before, .tip::before, .important::before, .warning::before, .caution::before {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 0.3em;
|
margin-bottom: 0.3em;
|
||||||
}
|
}
|
||||||
|
.markdown-alert-note,
|
||||||
.note { border-left: 0.2em solid #31a0fc; background: #31a1fc1f; }
|
.note { border-left: 0.2em solid #31a0fc; background: #31a1fc1f; }
|
||||||
|
.markdown-alert-tip,
|
||||||
.tip { border-left: 0.2em solid #25cb1c; background: #31fc491f; }
|
.tip { border-left: 0.2em solid #25cb1c; background: #31fc491f; }
|
||||||
|
.markdown-alert-important,
|
||||||
.important { border-left: 0.2em solid #911ccb; background: #bc31fc1f; }
|
.important { border-left: 0.2em solid #911ccb; background: #bc31fc1f; }
|
||||||
|
.markdown-alert-warning,
|
||||||
.warning { border-left: 0.2em solid #e0b840; background: #efc7461f; }
|
.warning { border-left: 0.2em solid #e0b840; background: #efc7461f; }
|
||||||
|
.markdown-alert-caution,
|
||||||
.caution { border-left: 0.2em solid #e04040; background: #ef5f461f; }
|
.caution { border-left: 0.2em solid #e04040; background: #ef5f461f; }
|
||||||
|
|
||||||
|
/* markdown-it-alert-title. We *should* use their provided styles really.... but meh */
|
||||||
|
.markdown-alert-title { display: none; }
|
||||||
|
|
||||||
.contributor-list {
|
.contributor-list {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
@ -21,6 +21,9 @@ markdown.use(markdown_prism, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const alerts = require("markdown-it-github-alerts");
|
||||||
|
markdown.use(alerts);
|
||||||
|
|
||||||
function extract_title(line) {
|
function extract_title(line) {
|
||||||
return line.match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, "")
|
return line.match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, "")
|
||||||
}
|
}
|
||||||
|
22
.docs/package-lock.json
generated
22
.docs/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "worldeditadditions",
|
"name": "worldeditadditions",
|
||||||
"version": "1.0.0",
|
"version": "1.14.5",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "worldeditadditions",
|
"name": "worldeditadditions",
|
||||||
"version": "1.0.0",
|
"version": "1.14.5",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@11ty/eleventy": "^2.0.1",
|
"@11ty/eleventy": "^2.0.1",
|
||||||
@ -17,6 +17,7 @@
|
|||||||
"html-entities": "^2.4.0",
|
"html-entities": "^2.4.0",
|
||||||
"html-minifier-terser": "^7.0.0-beta.0",
|
"html-minifier-terser": "^7.0.0-beta.0",
|
||||||
"imagickal": "^5.0.1",
|
"imagickal": "^5.0.1",
|
||||||
|
"markdown-it-github-alerts": "^0.1.2",
|
||||||
"markdown-it-prism": "^2.3.0",
|
"markdown-it-prism": "^2.3.0",
|
||||||
"p-memoize": "^7.1.1",
|
"p-memoize": "^7.1.1",
|
||||||
"p-queue": "^7.3.4",
|
"p-queue": "^7.3.4",
|
||||||
@ -1515,6 +1516,17 @@
|
|||||||
"markdown-it": "bin/markdown-it.js"
|
"markdown-it": "bin/markdown-it.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/markdown-it-github-alerts": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-jtCrfFxXR6c/bNRBvWkoqUquEDdIF9q7/gNZjP47W96kaIiBMiYHbpf468IPeZJB5BVRls6+IXGchhQSTxy0DQ==",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/antfu"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"markdown-it": "^13.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/markdown-it-prism": {
|
"node_modules/markdown-it-prism": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.3.0.tgz",
|
||||||
@ -3645,6 +3657,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"markdown-it-github-alerts": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-jtCrfFxXR6c/bNRBvWkoqUquEDdIF9q7/gNZjP47W96kaIiBMiYHbpf468IPeZJB5BVRls6+IXGchhQSTxy0DQ==",
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
"markdown-it-prism": {
|
"markdown-it-prism": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.3.0.tgz",
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
"html-entities": "^2.4.0",
|
"html-entities": "^2.4.0",
|
||||||
"html-minifier-terser": "^7.0.0-beta.0",
|
"html-minifier-terser": "^7.0.0-beta.0",
|
||||||
"imagickal": "^5.0.1",
|
"imagickal": "^5.0.1",
|
||||||
|
"markdown-it-github-alerts": "^0.1.2",
|
||||||
"markdown-it-prism": "^2.3.0",
|
"markdown-it-prism": "^2.3.0",
|
||||||
"p-memoize": "^7.1.1",
|
"p-memoize": "^7.1.1",
|
||||||
"p-queue": "^7.3.4",
|
"p-queue": "^7.3.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user