0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 13:02:38 +00:00

Fix TOC generators

This commit is contained in:
Trevor Buckner
2023-07-08 01:43:08 -04:00
parent 62532f788e
commit 96d04ad75a
2 changed files with 4 additions and 4 deletions

View File

@@ -47,8 +47,8 @@ const getTOC = (pages)=>{
return res;
};
module.exports = function(brew){
const pages = brew.text.split('\\page');
module.exports = function(props){
const pages = props.brew.text.split('\\page');
const TOC = getTOC(pages);
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
r.push(`- **[${idx1 + 1} ${g1.title}](#p${g1.page})**`);

View File

@@ -48,8 +48,8 @@ const getTOC = (pages)=>{
return res;
};
module.exports = function(brew){
const pages = brew.text.split('\\page');
module.exports = function(props){
const pages = props.brew.text.split('\\page');
const TOC = getTOC(pages);
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
if(g1.title !== null) {