mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 14:02:41 +00:00
Add QR-Code as snippet under Editor (#539)
* Add snippet for QR-code * Add snippet for QR-code * Refactor to expose metadata to snippets * Lint Co-authored-by: Rasmus Bækgaard <git@bakgaard.net> Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
This commit is contained in:
@@ -48,7 +48,7 @@ const getTOC = (pages)=>{
|
||||
};
|
||||
|
||||
module.exports = function(brew){
|
||||
const pages = brew.split('\\page');
|
||||
const pages = brew.text.split('\\page');
|
||||
const TOC = getTOC(pages);
|
||||
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
|
||||
r.push(`- **[${idx1 + 1} ${g1.title}](#p${g1.page})**`);
|
||||
@@ -69,4 +69,4 @@ module.exports = function(brew){
|
||||
##### Table Of Contents
|
||||
${markdown}
|
||||
</div>\n`;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user