From de8bd67e07dc5033ddbba83bb0dc2d0cfdb0476a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 29 Aug 2024 17:44:45 -0500 Subject: [PATCH 01/10] Add toggles for global Toc changes. --- themes/V3/5ePHB/snippets.js | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 4daa05c51..4badd9da5 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -94,6 +94,58 @@ module.exports = [ background-image: linear-gradient(-45deg, #322814, #998250, #322814); line-height: 1em; }\n\n` + }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ + { + h3, h4, h5, h6 { + --TOC: include; + } + }\n\n`, + subsnippets : [ + { + name : 'Enable H1-H3 all pages', + icon : 'fas fa-dice-three', + gen : dedent`/* Add ToC include for H3 level Headers */ + { + h3 { + --TOC: include; + } + }\n\n` + }, + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : dedent`/* Add ToC include for H3 and H4 level Headers */ + { + h3, h4 { + --TOC: include; + } + }\n\n` + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ + { + h3, h4, h5 { + --TOC: include; + } + }\n\n` + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ + { + h3, h4, h5, h6 { + --TOC: include; + } + }\n\n` + }, + ] } ] }, From 2a366c305301fe48b602be78bd444acb24d39dcb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 29 Aug 2024 17:51:59 -0500 Subject: [PATCH 02/10] Update ToC Style snippets for better specificity --- themes/V3/5ePHB/snippets.js | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 4badd9da5..f3ada5789 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -99,50 +99,40 @@ module.exports = [ name : 'Table of Contents Toggles', icon : 'fas fa-book', gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - { - h3, h4, h5, h6 { - --TOC: include; - } + .page h3, .page h4, .page h5, .page h6 { + --TOC: include; }\n\n`, subsnippets : [ { name : 'Enable H1-H3 all pages', icon : 'fas fa-dice-three', gen : dedent`/* Add ToC include for H3 level Headers */ - { - h3 { - --TOC: include; - } + .page h3 { + --TOC: include; }\n\n` }, { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', gen : dedent`/* Add ToC include for H3 and H4 level Headers */ - { - h3, h4 { - --TOC: include; - } + .page h3, .page h4 { + --TOC: include; }\n\n` }, { name : 'Enable H1-H5 all pages', icon : 'fas fa-dice-five', gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ - { - h3, h4, h5 { + .page h3, .page h4, .page h5 { --TOC: include; - } }\n\n` }, { name : 'Enable H1-H6 all pages', icon : 'fas fa-dice-six', gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - { - h3, h4, h5, h6 { + .page h3, .page h4, .page h5, .page h6 { --TOC: include; - } }\n\n` }, ] From f0a8bf379a958bad97f689f1cf3572495ae216c5 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 6 Sep 2024 16:43:44 -0400 Subject: [PATCH 03/10] Fix non-uniform spacing/indenting --- themes/V3/5ePHB/snippets.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f3ada5789..05c28a17b 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -107,8 +107,8 @@ module.exports = [ name : 'Enable H1-H3 all pages', icon : 'fas fa-dice-three', gen : dedent`/* Add ToC include for H3 level Headers */ - .page h3 { - --TOC: include; + .page h3 { + --TOC: include; }\n\n` }, { @@ -116,7 +116,7 @@ module.exports = [ icon : 'fas fa-dice-four', gen : dedent`/* Add ToC include for H3 and H4 level Headers */ .page h3, .page h4 { - --TOC: include; + --TOC: include; }\n\n` }, { @@ -124,7 +124,7 @@ module.exports = [ icon : 'fas fa-dice-five', gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ .page h3, .page h4, .page h5 { - --TOC: include; + --TOC: include; }\n\n` }, { @@ -132,7 +132,7 @@ module.exports = [ icon : 'fas fa-dice-six', gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ .page h3, .page h4, .page h5, .page h6 { - --TOC: include; + --TOC: include; }\n\n` }, ] From 3629292ebbbb45f8fa25249d9e43bc0da6f81645 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Mon, 9 Sep 2024 17:09:24 -0500 Subject: [PATCH 04/10] Remove --- themes/V3/5ePHB/snippets.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f3ada5789..12eb25ad3 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -103,14 +103,6 @@ module.exports = [ --TOC: include; }\n\n`, subsnippets : [ - { - name : 'Enable H1-H3 all pages', - icon : 'fas fa-dice-three', - gen : dedent`/* Add ToC include for H3 level Headers */ - .page h3 { - --TOC: include; - }\n\n` - }, { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', From ed376f3154d7b2f8a540e7f1dcf866c80f4e2e99 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 10 Sep 2024 11:25:06 -0500 Subject: [PATCH 05/10] Oy, what a typo. --- themes/V3/5ePHB/style.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 307b4d21e..d119792ae 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -814,15 +814,15 @@ h6, .tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } .tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } -.page:has(.tocGobalH4) { +.page:has(.tocGlobalH4) { h4 {--TOC: include; } } -.page:has(.tocGobalH5) { +.page:has(.tocGlobalH5) { h4, h5 {--TOC: include; } } -.page:has(.tocGobalH6) { +.page:has(.tocGlobalH6) { h4, h5, h6 {--TOC: include; } } From f8d170be87d411c4b5929f28838ede6a0c488546 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 10 Sep 2024 12:15:12 -0500 Subject: [PATCH 06/10] Document level toggles need to look at pages, not page. --- themes/V3/5ePHB/style.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index d119792ae..8f19b46c5 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -797,7 +797,7 @@ // *****************************/ // Default Exclusions -// Anything not exlcuded is included, default Headers are H1, H2, and H3. +// Anything not excluded is included, default Headers are H1, H2, and H3. h4, h5, h6, @@ -814,15 +814,15 @@ h6, .tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } .tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } -.page:has(.tocGlobalH4) { +.pages:has(.tocGlobalH4) { h4 {--TOC: include; } } -.page:has(.tocGlobalH5) { +.pages:has(.tocGlobalH5) { h4, h5 {--TOC: include; } } -.page:has(.tocGlobalH6) { +.pages:has(.tocGlobalH6) { h4, h5, h6 {--TOC: include; } } From 59f27197f65440ed8044a353c484257c49f74b08 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 10 Sep 2024 13:34:47 -0500 Subject: [PATCH 07/10] A few small cleanups for ToC Explicitly define --TOC as included in :root so there is no doubt the default value. Rearrange Block ToC inclusion classes for organization and comments Add block level, single Header class exclusion convienance classes. --- themes/V3/5ePHB/style.less | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 8f19b46c5..5a2b5cf3f 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -11,6 +11,7 @@ --HB_Color_CaptionText : #766649; // Brown --HB_Color_WatercolorStain : #BBAD82; // Light brown --HB_Color_Footnotes : #C9AD6A; // Gold + --TOC : 'include'; } .useSansSerif() { @@ -808,12 +809,9 @@ h6, .noToC, .toc { --TOC: exclude; } -.tocDepthH2 :is(h1, h2) {--TOC: include; } -.tocDepthH3 :is(h1, h2, h3) {--TOC: include; } -.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; } -.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } -.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } +// Brew level default inclusion changes. +// These add Headers 'back' to inclusion. .pages:has(.tocGlobalH4) { h4 {--TOC: include; } } @@ -826,6 +824,8 @@ h6, h4, h5, h6 {--TOC: include; } } +// Block level inclusion changes +// These include either a single (include) or a range (depth) .tocIncludeH1 h1 {--TOC: include; } .tocIncludeH2 h2 {--TOC: include; } .tocIncludeH3 h3 {--TOC: include; } @@ -833,6 +833,21 @@ h6, .tocIncludeH5 h5 {--TOC: include; } .tocIncludeH6 h6 {--TOC: include; } +.tocDepthH2 :is(h1, h2) {--TOC: include; } +.tocDepthH3 :is(h1, h2, h3) {--TOC: include; } +.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; } +.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; } +.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; } + +// Block level exclusion changes +// These exclude a single block level +.tocExcludeH1 h1 {--TOC: exclude; } +.tocExcludeH2 h2 {--TOC: exclude; } +.tocExcludeH3 h3 {--TOC: exclude; } +.tocExcludeH4 h4 {--TOC: exclude; } +.tocExcludeH5 h5 {--TOC: exclude; } +.tocExcludeH6 h6 {--TOC: exclude; } + .page:has(.partCover) { --TOC: exclude; & h1 { From bc6b4e3bfc78e0832a3ea15fac4cf9e4f6399114 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 10 Sep 2024 14:18:36 -0500 Subject: [PATCH 08/10] Move ToC Includes Menu from styles to Table of Contents subsnippet Create additional subsnippets for .tocInclude*, .tocExclude*, and move the existing depth entries to a subsnippet. --- themes/V3/5ePHB/snippets.js | 121 +++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index ca7c773db..02e575c27 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -27,35 +27,90 @@ module.exports = [ experimental : true, subsnippets : [ { - name : 'Table of Contents', + name : 'Generate Table of Contents', icon : 'fas fa-book', gen : TableOfContentsGen, experimental : true }, { - name : 'Include in ToC up to H3', - icon : 'fas fa-dice-three', + name : 'Table of Contents Individual Inclusion', + icon : 'fas fa-book', + gen : dedent `\n{{tocInclude# CHANGE # to your header level + }}\n`, + }, + { + name : 'Table of Contents Range Inclusion', + icon : 'fas fa-book', gen : dedent `\n{{tocDepthH3 }}\n`, + subsnippets : [ + { + name : 'Include in ToC up to H3', + icon : 'fas fa-dice-three', + gen : dedent `\n{{tocDepthH3 + }}\n`, + }, + { + name : 'Include in ToC up to H4', + icon : 'fas fa-dice-four', + gen : dedent `\n{{tocDepthH4 + }}\n`, + }, + { + name : 'Include in ToC up to H5', + icon : 'fas fa-dice-five', + gen : dedent `\n{{tocDepthH5 + }}\n`, + }, + { + name : 'Include in ToC up to H6', + icon : 'fas fa-dice-six', + gen : dedent `\n{{tocDepthH6 + }}\n`, + }, + ] }, { - name : 'Include in ToC up to H4', - icon : 'fas fa-dice-four', - gen : dedent `\n{{tocDepthH4 + name : 'Table of Contents Individual Exclusion', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH# CHANGE # to your header level }}\n`, }, + { - name : 'Include in ToC up to H5', - icon : 'fas fa-dice-five', - gen : dedent `\n{{tocDepthH5 - }}\n`, - }, - { - name : 'Include in ToC up to H6', - icon : 'fas fa-dice-six', - gen : dedent `\n{{tocDepthH6 - }}\n`, + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ + .page h3, .page h4, .page h5, .page h6 { + --TOC: include; + }\n\n`, + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : dedent`/* Add ToC include for H3 and H4 level Headers */ + .page h3, .page h4 { + --TOC: include; + }\n\n` + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ + .page h3, .page h4, .page h5 { + --TOC: include; + }\n\n` + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ + .page h3, .page h4, .page h5, .page h6 { + --TOC: include; + }\n\n` + }, + ] } ] }, @@ -95,40 +150,6 @@ module.exports = [ line-height: 1em; }\n\n` }, - { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - .page h3, .page h4, .page h5, .page h6 { - --TOC: include; - }\n\n`, - subsnippets : [ - { - name : 'Enable H1-H4 all pages', - icon : 'fas fa-dice-four', - gen : dedent`/* Add ToC include for H3 and H4 level Headers */ - .page h3, .page h4 { - --TOC: include; - }\n\n` - }, - { - name : 'Enable H1-H5 all pages', - icon : 'fas fa-dice-five', - gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ - .page h3, .page h4, .page h5 { - --TOC: include; - }\n\n` - }, - { - name : 'Enable H1-H6 all pages', - icon : 'fas fa-dice-six', - gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - .page h3, .page h4, .page h5, .page h6 { - --TOC: include; - }\n\n` - }, - ] - } ] }, From 7c59f56fb2d934e4792e39f960847fadfea016e6 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 10 Sep 2024 20:22:50 -0500 Subject: [PATCH 09/10] Explode tocInclude and tocExclude snippet menus to match tocGlobal and tocDepth pattern. --- themes/V3/5ePHB/snippets.js | 78 ++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 02e575c27..5823a8848 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -37,6 +37,44 @@ module.exports = [ icon : 'fas fa-book', gen : dedent `\n{{tocInclude# CHANGE # to your header level }}\n`, + subsnippets : [ + { + name : 'Individual Inclusion H1', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH1 \n + }}\n`, + }, + { + name : 'Individual Inclusion H2', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH2 \n + }}\n`, + }, + { + name : 'Individual Inclusion H3', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH3 \n + }}\n`, + }, + { + name : 'Individual Inclusion H4', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH4 \n + }}\n`, + }, + { + name : 'Individual Inclusion H5', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH5 \n + }}\n`, + }, + { + name : 'Individual Inclusion H6', + icon : 'fas fa-book', + gen : dedent `\n{{tocIncludeH6 \n + }}\n`, + } + ] }, { name : 'Table of Contents Range Inclusion', @@ -74,8 +112,46 @@ module.exports = [ { name : 'Table of Contents Individual Exclusion', icon : 'fas fa-book', - gen : dedent `\n{{tocExcludeH# CHANGE # to your header level + gen : dedent `\n{{tocExcludeH1 \n }}\n`, + subsnippets : [ + { + name : 'Individual Exclusion H1', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH1 \n + }}\n`, + }, + { + name : 'Individual Exclusion H2', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH2 \n + }}\n`, + }, + { + name : 'Individual Exclusion H3', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH3 \n + }}\n`, + }, + { + name : 'Individual Exclusion H4', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH4 \n + }}\n`, + }, + { + name : 'Individual Exclusion H5', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH5 \n + }}\n`, + }, + { + name : 'Individual Exclusion H6', + icon : 'fas fa-book', + gen : dedent `\n{{tocExcludeH6 \n + }}\n`, + }, + ] }, { From 3ad0755c361e24fff61253497a5cb1a9013632c0 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Sun, 15 Sep 2024 18:33:14 -0500 Subject: [PATCH 10/10] Correct ToC Global toggles subsnippets The snippets incorrectedly reflected their previous incarnation as part of the Styles tab menus. --- themes/V3/5ePHB/snippets.js | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 5823a8848..c3094abc4 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -155,36 +155,24 @@ module.exports = [ }, { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - .page h3, .page h4, .page h5, .page h6 { - --TOC: include; - }\n\n`, + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + gen : `{{tocGlobalH4}}\n\n`, subsnippets : [ { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', - gen : dedent`/* Add ToC include for H3 and H4 level Headers */ - .page h3, .page h4 { - --TOC: include; - }\n\n` + gen : `{{tocGlobalH4}}\n\n`, }, { name : 'Enable H1-H5 all pages', icon : 'fas fa-dice-five', - gen : dedent`/* Add ToC include for H3, H4, and H5 level Headers */ - .page h3, .page h4, .page h5 { - --TOC: include; - }\n\n` + gen : `{{tocGlobalH5}}\n\n`, }, { name : 'Enable H1-H6 all pages', icon : 'fas fa-dice-six', - gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */ - .page h3, .page h4, .page h5, .page h6 { - --TOC: include; - }\n\n` + gen : `{{tocGlobalH6}}\n\n`, }, ] }