0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 12:12:42 +00:00

Use dedent-tabs

This commit is contained in:
Trevor Buckner
2023-08-03 19:23:40 -04:00
parent 999f9c8f25
commit 7aca0f2f10

View File

@@ -27,10 +27,13 @@ module.exports = {
non : function(snippetClasses){ non : function(snippetClasses){
const classname = _.sample(classnames); const classname = _.sample(classnames);
return `{{${snippetClasses}\n##### The ${classname}\n` + return dedent`
`| Level | Proficiency | Features |\n`+ {{${snippetClasses}
`| ^| Bonus ^| ^|\n`+ ##### The ${classname}
`|:-----:|:-----------:|:-------------|\n${ | Level | Proficiency | Features |
| ^| Bonus ^| ^|
|:-----:|:-----------:|:-------------|
${
_.map(levels, function(levelName, level){ _.map(levels, function(levelName, level){
const res = [ const res = [
_.pad(levelName, 5), _.pad(levelName, 5),
@@ -38,7 +41,9 @@ module.exports = {
_.padEnd(_.sample(features), 21), _.padEnd(_.sample(features), 21),
].join(' | '); ].join(' | ');
return `| ${res} |`; return `| ${res} |`;
}).join('\n')}\n}}\n\n`; }).join('\n')
}
}}\n\n`;
}, },
full : function(snippetClasses){ full : function(snippetClasses){
@@ -57,10 +62,13 @@ module.exports = {
['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1, 1, 1], ['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1, 1, 1],
]; ];
return `{{${snippetClasses}\n##### The ${classname}\n` + return dedent`
`| Level | Proficiency | Features | Cantrips | --- Spell Slots Per Spell Level ---|||||||||\n`+ {{${snippetClasses}
`| ^| Bonus ^| ^| Known ^|1st |2nd |3rd |4th |5th |6th |7th |8th |9th |\n`+ ##### The ${classname}
`|:-----:|:-----------:|:-------------|:--------:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|\n${ | Level | Proficiency | Features | Cantrips | --- Spell Slots Per Spell Level ---|||||||||
| ^| Bonus ^| ^| Known ^|1st |2nd |3rd |4th |5th |6th |7th |8th |9th |
|:-----:|:-----------:|:-------------|:--------:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|
${
_.map(levels, function(levelName, level){ _.map(levels, function(levelName, level){
const res = [ const res = [
_.pad(levelName, 5), _.pad(levelName, 5),
@@ -72,7 +80,9 @@ module.exports = {
}).join(' | '), }).join(' | '),
].join(' | '); ].join(' | ');
return `| ${res} |`; return `| ${res} |`;
}).join('\n')}\n}}\n\n`; }).join('\n')
}
}}\n\n`;
}, },
half : function(snippetClasses){ half : function(snippetClasses){
@@ -87,10 +97,13 @@ module.exports = {
['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1, 2, 2], ['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1, 2, 2],
]; ];
return `{{${snippetClasses}\n##### The ${classname}\n` + return dedent`
`| Level | Proficiency | Features | Spells | --- Spell Slots Per Spell Level ---|||||\n`+ {{${snippetClasses}
`| ^| Bonus ^| ^| Known ^|1st |2nd |3rd |4th |5th |\n`+ ##### The ${classname}
`|:-----:|:-----------:|:-------------|:------:|:--:|:--:|:--:|:--:|:--:|\n${ | Level | Proficiency | Features | Spells | --- Spell Slots Per Spell Level ---|||||
| ^| Bonus ^| ^| Known ^|1st |2nd |3rd |4th |5th |
|:-----:|:-----------:|:-------------|:------:|:--:|:--:|:--:|:--:|:--:|
${
_.map(levels, function(levelName, level){ _.map(levels, function(levelName, level){
const res = [ const res = [
_.pad(levelName, 5), _.pad(levelName, 5),
@@ -102,7 +115,9 @@ module.exports = {
}).join(' | '), }).join(' | '),
].join(' | '); ].join(' | ');
return `| ${res} |`; return `| ${res} |`;
}).join('\n')}\n}}\n\n`; }).join('\n')
}
}}\n\n`;
}, },
third : function(snippetClasses){ third : function(snippetClasses){
@@ -118,10 +133,13 @@ module.exports = {
['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1], ['—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', '—', 1, 1],
]; ];
return `{{${snippetClasses}\n##### ${classname} Spellcasting\n` + return dedent`
`| Level | Cantrips | Spells |--- Spells Slots per Spell Level ---||||\n` + {{${snippetClasses}
`| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` + ##### ${classname} Spellcasting
`|:-----:|:--------:|:------:|:-------:|:-------:|:-------:|:-------:|\n${ | Level | Cantrips | Spells |--- Spells Slots per Spell Level ---||||
| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |
|:-----:|:--------:|:------:|:-------:|:-------:|:-------:|:-------:|
${
_.map(thirdLevels, function(levelName, level){ _.map(thirdLevels, function(levelName, level){
const res = [ const res = [
_.pad(levelName, 5), _.pad(levelName, 5),
@@ -132,6 +150,8 @@ module.exports = {
}).join(' | '), }).join(' | '),
].join(' | '); ].join(' | ');
return `| ${res} |`; return `| ${res} |`;
}).join('\n')}\n}}\n\n`; }).join('\n')
}
}}\n\n`;
} }
}; };