mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 16:32:40 +00:00
Flag Table of Contents as "Experimental"
This commit is contained in:
@@ -21,14 +21,16 @@ module.exports = [
|
|||||||
view : 'text',
|
view : 'text',
|
||||||
snippets : [
|
snippets : [
|
||||||
{
|
{
|
||||||
name : 'Table of Contents',
|
name : 'Table of Contents',
|
||||||
icon : 'fas fa-book',
|
icon : 'fas fa-book',
|
||||||
gen : TableOfContentsGen,
|
gen : TableOfContentsGen,
|
||||||
subsnippets : [
|
experimental : true,
|
||||||
|
subsnippets : [
|
||||||
{
|
{
|
||||||
name : 'Table of Contents',
|
name : 'Table of Contents',
|
||||||
icon : 'fas fa-book',
|
icon : 'fas fa-book',
|
||||||
gen : TableOfContentsGen,
|
gen : TableOfContentsGen,
|
||||||
|
experimental : true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'Include in ToC up to H3',
|
name : 'Include in ToC up to H3',
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const getTOC = (pages)=>{
|
|||||||
const headerDepth = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];
|
const headerDepth = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];
|
||||||
|
|
||||||
_.each(headings, (heading)=>{
|
_.each(headings, (heading)=>{
|
||||||
const onPage = parseInt(heading.closest('.page,.phb').id?.replace(/^p/, ''));
|
const onPage = parseInt(heading.closest('.page').id?.replace(/^p/, ''));
|
||||||
const ToCExclude = getComputedStyle(heading).getPropertyValue('--TOC');
|
const ToCExclude = getComputedStyle(heading).getPropertyValue('--TOC');
|
||||||
|
|
||||||
if(ToCExclude != 'exclude') {
|
if(ToCExclude != 'exclude') {
|
||||||
|
|||||||
Reference in New Issue
Block a user