From 631ef795b75239505a2812ed046f2b108cb8c2eb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 17 Oct 2024 18:30:31 -0500 Subject: [PATCH] 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)