0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 19:42:43 +00:00

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.
This commit is contained in:
David Bolack
2024-09-10 14:18:36 -05:00
parent 5a2e071879
commit bc6b4e3bfc

View File

@@ -27,35 +27,90 @@ module.exports = [
experimental : true, experimental : true,
subsnippets : [ subsnippets : [
{ {
name : 'Table of Contents', name : 'Generate Table of Contents',
icon : 'fas fa-book', icon : 'fas fa-book',
gen : TableOfContentsGen, gen : TableOfContentsGen,
experimental : true experimental : true
}, },
{ {
name : 'Include in ToC up to H3', name : 'Table of Contents Individual Inclusion',
icon : 'fas fa-dice-three', 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 gen : dedent `\n{{tocDepthH3
}}\n`, }}\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', name : 'Table of Contents Individual Exclusion',
icon : 'fas fa-dice-four', icon : 'fas fa-book',
gen : dedent `\n{{tocDepthH4 gen : dedent `\n{{tocExcludeH# CHANGE # to your header level
}}\n`, }}\n`,
}, },
{ {
name : 'Include in ToC up to H5', name : 'Table of Contents Toggles',
icon : 'fas fa-dice-five', icon : 'fas fa-book',
gen : dedent `\n{{tocDepthH5 gen : dedent`/* Add ToC include for H3, H4, H5, and H6 level Headers */
}}\n`, .page h3, .page h4, .page h5, .page h6 {
}, --TOC: include;
{ }\n\n`,
name : 'Include in ToC up to H6', subsnippets : [
icon : 'fas fa-dice-six', {
gen : dedent `\n{{tocDepthH6 name : 'Enable H1-H4 all pages',
}}\n`, 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; line-height: 1em;
}\n\n` }\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`
},
]
}
] ]
}, },