0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 14:12:43 +00:00

Disable Global ToC Snippet

This commit is contained in:
Trevor Buckner
2024-10-17 16:42:57 -04:00
parent 4dd07a3c11
commit f2f06b23fd
4 changed files with 36 additions and 28 deletions

View File

@@ -291,8 +291,9 @@ const SnippetGroup = createClass({
return _.map(snippets, (snippet)=>{ return _.map(snippets, (snippet)=>{
return <div className='snippet' key={snippet.name} onClick={(e)=>this.handleSnippetClick(e, snippet)}> return <div className='snippet' key={snippet.name} onClick={(e)=>this.handleSnippetClick(e, snippet)}>
<i className={snippet.icon} /> <i className={snippet.icon} />
<span className='name'title={snippet.name}>{snippet.name}</span> <span className={`name${snippet.disabled ? ' disabled' : ''}`} title={snippet.name}>{snippet.name}</span>
{snippet.experimental && <span className='beta'>beta</span>} {snippet.experimental && <span className='beta'>beta</span>}
{snippet.disabled && <span className='beta' title="temporarily disabled due to large slowdown; under re-design">disabled</span>}
{snippet.subsnippets && <> {snippet.subsnippets && <>
<i className='fas fa-caret-right'></i> <i className='fas fa-caret-right'></i>
<div className='dropdown side'> <div className='dropdown side'>

View File

@@ -179,6 +179,7 @@
} }
} }
.name { margin-right : auto; } .name { margin-right : auto; }
.disabled { text-decoration: line-through; }
.beta { .beta {
align-self : center; align-self : center;
padding : 4px 6px; padding : 4px 6px;

View File

@@ -157,24 +157,27 @@ module.exports = [
{ {
name : 'Table of Contents Toggles', name : 'Table of Contents Toggles',
icon : 'fas fa-book', icon : 'fas fa-book',
gen : `{{tocGlobalH4}}\n\n`, //gen : `{{tocGlobalH4}}\n\n`,
subsnippets : [ disabled : true
{ // RELIES ON .PAGES:HAS() WHICH IS VERY SLOW
name : 'Enable H1-H4 all pages', // WILL BE MOVED TO STYLE TAB SNIPPETS
icon : 'fas fa-dice-four', // subsnippets : [
gen : `{{tocGlobalH4}}\n\n`, // {
}, // name : 'Enable H1-H4 all pages',
{ // icon : 'fas fa-dice-four',
name : 'Enable H1-H5 all pages', // gen : `{{tocGlobalH4}}\n\n`,
icon : 'fas fa-dice-five', // },
gen : `{{tocGlobalH5}}\n\n`, // {
}, // name : 'Enable H1-H5 all pages',
{ // icon : 'fas fa-dice-five',
name : 'Enable H1-H6 all pages', // gen : `{{tocGlobalH5}}\n\n`,
icon : 'fas fa-dice-six', // },
gen : `{{tocGlobalH6}}\n\n`, // {
}, // name : 'Enable H1-H6 all pages',
] // icon : 'fas fa-dice-six',
// gen : `{{tocGlobalH6}}\n\n`,
// },
// ]
} }
] ]
}, },

View File

@@ -812,17 +812,20 @@ h6,
// Brew level default inclusion changes. // Brew level default inclusion changes.
// These add Headers 'back' to inclusion. // These add Headers 'back' to inclusion.
.pages:has(.tocGlobalH4) {
h4 {--TOC: include; }
}
.pages:has(.tocGlobalH5) { //NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS!
h4, h5 {--TOC: include; } //WILL BE MOVED TO A STYLE TAB SNIPPET INSTEAD
} // .pages:has(.tocGlobalH4) {
// h4 {--TOC: include; }
// }
.pages:has(.tocGlobalH6) { // .pages:has(.tocGlobalH5) {
h4, h5, h6 {--TOC: include; } // h4, h5 {--TOC: include; }
} // }
// .pages:has(.tocGlobalH6) {
// h4, h5, h6 {--TOC: include; }
// }
// Block level inclusion changes // Block level inclusion changes
// These include either a single (include) or a range (depth) // These include either a single (include) or a range (depth)