From 51ea98dabd45eb9048565275aa6554053e71365c Mon Sep 17 00:00:00 2001 From: kildom Date: Fri, 1 Mar 2024 12:36:17 +0100 Subject: [PATCH] Allow editing front page as well. --- docs/tmpl/docs.js | 4 +- docs/tmpl/index.tmpl.html | 86 ++++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/docs/tmpl/docs.js b/docs/tmpl/docs.js index 564d1ca..17b771e 100644 --- a/docs/tmpl/docs.js +++ b/docs/tmpl/docs.js @@ -110,7 +110,9 @@ async function editPage() { await addScript('https://cdn.jsdelivr.net/npm/diff2html/bundles/js/diff2html-ui.min.js'); await addScript('https://cdnjs.cloudflare.com/ajax/libs/jsdiff/5.2.0/diff.js'); diffTarget = document.createElement('div'); - textDiv.parentElement.insertBefore(diffTarget, textDiv); + diffTarget.style.background = 'white'; + diffTarget.style.color = 'black'; + textDiv.parentElement.appendChild(diffTarget); setInterval(checkUpdates, 200); } } diff --git a/docs/tmpl/index.tmpl.html b/docs/tmpl/index.tmpl.html index 20e16e8..266b7c6 100644 --- a/docs/tmpl/index.tmpl.html +++ b/docs/tmpl/index.tmpl.html @@ -3,6 +3,7 @@ + @@ -11,57 +12,60 @@ - -
-
<%= title %>
-
-
-
- <%= subtitleList.map(x => `
${x}
`).join('') %> +
+
+ +
+
<%= title %>
+
+
+
+ <%= subtitleList.map(x => `
${x}
`).join('') %> +
+
<%= subtitleEnding %>
-
<%= subtitleEnding %>
-
-
-
- <% for (sample of samples) { %> -
-
-
// <%- sample.title %>
-
Classic
-
<%- sample.regexp %>
+
+
+ <% for (sample of samples) { %> +
+
+
// <%- sample.title %>
+
Classic
+
<%- sample.regexp %>
-
Convenient Regular Expressions
-
<%- sample.code %>
+
Convenient Regular Expressions
+
<%- sample.code %>
+
+ <% } %>
- <% } %> +
+
+
-
-
-
-
-
- <% for (let section of sections) { let className = section.simple && section.sub.length > 4 ? 'benefit' : 'step' %> -
- <%= section.title %> -
-
- <% for (let sub of section.sub) { %> -
-
<%= sub.title %>
-
- <%= sub.html %> +
+ <% for (let section of sections) { let className = section.simple && section.sub.length > 4 ? 'benefit' : 'step' %> +
+ <%= section.title %> +
+
+ <% for (let sub of section.sub) { %> +
+
<%= sub.title %>
+
+ <%= sub.html %> +
-
+ <% } %> +
<% } %>
- <% } %> +
- \ No newline at end of file