From 1aabb84731e64e8227be66e90ba75ceaf1c3148a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:40:32 -0500 Subject: [PATCH 1/5] Revert --experimental-vm-modules Code works but does not work with jest as expected. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f8007c608..cd4fda141 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node --experimental-require-module scripts/dev.js", - "quick": "node --experimental-require-module scripts/quick.js", - "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", - "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", + "dev": "node scripts/dev.js", + "quick": "node scripts/quick.js", + "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", + "builddev": "node scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node --experimental-require-module scripts/phb.js", + "phb": "node scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node --experimental-require-module server.js" + "start": "node server.js" }, "author": "stolksdorf", "license": "MIT", From 9506be6b65f687e095e95278c3362121b425656c Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:41:40 -0500 Subject: [PATCH 2/5] Revert "Revert --experimental-vm-modules" This reverts commit 1aabb84731e64e8227be66e90ba75ceaf1c3148a. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cd4fda141..f8007c608 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node scripts/dev.js", - "quick": "node scripts/quick.js", - "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", - "builddev": "node scripts/buildHomebrew.js --dev", + "dev": "node --experimental-require-module scripts/dev.js", + "quick": "node --experimental-require-module scripts/quick.js", + "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", + "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node scripts/phb.js", + "phb": "node --experimental-require-module scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node server.js" + "start": "node --experimental-require-module server.js" }, "author": "stolksdorf", "license": "MIT", From 631ef795b75239505a2812ed046f2b108cb8c2eb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 17 Oct 2024 18:30:31 -0500 Subject: [PATCH 3/5] Fix .tocGlobalH? Based on OH DEAR GOD THE LAG! discoveries related to the global toggles, these are being moved from a markup tag to a styles tab insert. --- themes/V3/5ePHB/snippets.js | 47 +++++++++++++++++-------------------- themes/V3/5ePHB/style.less | 12 ---------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 543b1cf5c..798a36193 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -154,31 +154,6 @@ module.exports = [ ] }, - { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - //gen : `{{tocGlobalH4}}\n\n`, - disabled : true - // RELIES ON .PAGES:HAS() WHICH IS VERY SLOW - // WILL BE MOVED TO STYLE TAB SNIPPETS - // subsnippets : [ - // { - // name : 'Enable H1-H4 all pages', - // icon : 'fas fa-dice-four', - // gen : `{{tocGlobalH4}}\n\n`, - // }, - // { - // name : 'Enable H1-H5 all pages', - // icon : 'fas fa-dice-five', - // gen : `{{tocGlobalH5}}\n\n`, - // }, - // { - // name : 'Enable H1-H6 all pages', - // icon : 'fas fa-dice-six', - // gen : `{{tocGlobalH6}}\n\n`, - // }, - // ] - } ] }, { @@ -217,6 +192,28 @@ module.exports = [ line-height: 1em; }\n\n` }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + disabled : false, + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + }, + ] + } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 1216d0370..ba975e58a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -814,18 +814,6 @@ h6, // These add Headers 'back' to inclusion. //NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS! -//WILL BE MOVED TO A STYLE TAB SNIPPET INSTEAD -// .pages:has(.tocGlobalH4) { -// h4 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH5) { -// h4, h5 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH6) { -// h4, h5, h6 {--TOC: include; } -// } // Block level inclusion changes // These include either a single (include) or a range (depth) From 9d81f50b609dc551375af031639fe4db386d7da1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:46:59 -0400 Subject: [PATCH 4/5] Remove `disabled = false` Don't need that tag at all when it's false. --- themes/V3/5ePHB/snippets.js | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 798a36193..f06064895 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -195,7 +195,6 @@ module.exports = [ { name : 'Table of Contents Toggles', icon : 'fas fa-book', - disabled : false, subsnippets : [ { name : 'Enable H1-H4 all pages', From d53a271c9ff8be2c736b2bb8720ead0a74747b2b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:53:16 -0400 Subject: [PATCH 5/5] Change to `.page` and tweak spacing/newlines to match other snippets All of our "global" style snippets are just set at `.page`, not `.pages`. This still applies globally but is consistent with our current approach. --- themes/V3/5ePHB/snippets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f06064895..dbcdc6f2a 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -199,17 +199,17 @@ module.exports = [ { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', - gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H5 all pages', icon : 'fas fa-dice-five', - gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H6 all pages', icon : 'fas fa-dice-six', - gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5, h6 {--TOC: include; }\n}\n\n`, }, ] }