mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-27 20:23:08 +00:00
change legacy snippets to use named exports and move from dedent-tabs to dedent
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
import MagicGen from './snippets/magic.gen.js';
|
||||
import ClassTableGen from './snippets/classtable.gen.js';
|
||||
import MonsterBlockGen from './snippets/monsterblock.gen.js';
|
||||
import ClassFeatureGen from './snippets/classfeature.gen.js';
|
||||
import CoverPageGen from './snippets/coverpage.gen.js';
|
||||
import TableOfContentsGen from './snippets/tableOfContents.gen.js';
|
||||
import dedent from 'dedent-tabs';
|
||||
import MagicGen from './themes/Legacy/5ePHB/snippets/magic.gen.js';
|
||||
import ClassTableGen from './themes/Legacy/5ePHB/snippets/classtable.gen.js';
|
||||
import MonsterBlockGen from './themes/Legacy/5ePHB/snippets/monsterblock.gen.js';
|
||||
import ClassFeatureGen from './themes/Legacy/5ePHB/snippets/classfeature.gen.js';
|
||||
import CoverPageGen from './themes/Legacy/5ePHB/snippets/coverpage.gen.js';
|
||||
import TableOfContentsGen from './themes/Legacy/5ePHB/snippets/tableOfContents.gen.js';
|
||||
import dedent from 'dedent';
|
||||
|
||||
export default [
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
export default function(classname){
|
||||
function classFeatureGen(classname) {
|
||||
|
||||
classname = _.sample(['archivist', 'fancyman', 'linguist', 'fletcher',
|
||||
'notary', 'berserker-typist', 'fishmongerer', 'manicurist', 'haberdasher', 'concierge']);
|
||||
@@ -49,4 +49,6 @@ export default function(classname){
|
||||
`- ${_.sample(['10 lint fluffs', '1 button', 'a cherished lost sock'])}`,
|
||||
'\n\n\n'
|
||||
].join('\n');
|
||||
};
|
||||
}
|
||||
|
||||
export default classFeatureGen;
|
||||
|
||||
@@ -98,8 +98,8 @@ const subtitles = [
|
||||
];
|
||||
|
||||
|
||||
export default ()=>{
|
||||
return `<style>
|
||||
function coverPageGen() {
|
||||
return `<style>
|
||||
.phb#p1{ text-align:center; }
|
||||
.phb#p1:after{ display:none; }
|
||||
</style>
|
||||
@@ -114,4 +114,6 @@ export default ()=>{
|
||||
</div>
|
||||
|
||||
\\page`;
|
||||
};
|
||||
}
|
||||
|
||||
export default coverPageGen;
|
||||
@@ -4,7 +4,7 @@ import ClassFeatureGen from './classfeature.gen.js';
|
||||
|
||||
import ClassTableGen from './classtable.gen.js';
|
||||
|
||||
export default function(){
|
||||
function fullClassGen(){
|
||||
|
||||
const classname = _.sample(['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
|
||||
'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']);
|
||||
@@ -40,4 +40,6 @@ export default function(){
|
||||
|
||||
|
||||
].join('\n')}\n\n\n`;
|
||||
};
|
||||
}
|
||||
|
||||
export default fullClassGen;
|
||||
@@ -47,7 +47,8 @@ const getTOC = (pages)=>{
|
||||
return res;
|
||||
};
|
||||
|
||||
export default function(props){
|
||||
function tableOfContentsGen(props){
|
||||
|
||||
const pages = props.brew.text.split('\\page');
|
||||
const TOC = getTOC(pages);
|
||||
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
|
||||
@@ -69,4 +70,6 @@ export default function(props){
|
||||
##### Table Of Contents
|
||||
${markdown}
|
||||
</div>\n`;
|
||||
};
|
||||
}
|
||||
|
||||
export default tableOfContentsGen;
|
||||
Reference in New Issue
Block a user