From d278c52571070c25e604822731cf83a993de48e0 Mon Sep 17 00:00:00 2001 From: Victor Losada Hernandez Date: Sun, 26 Mar 2023 23:28:29 +0200 Subject: [PATCH 1/5] Initial draft --- themes/V3/5ePHB/snippets.js | 6 ++ themes/V3/5ePHB/snippets/index.gen.js | 116 ++++++++++++++++++++++++++ themes/V3/5ePHB/style.less | 18 ++++ 3 files changed, 140 insertions(+) create mode 100644 themes/V3/5ePHB/snippets/index.gen.js diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 68d5cc596..8b2ae8ef5 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -7,6 +7,7 @@ const scriptGen = require('./snippets/script.gen.js'); const ClassFeatureGen = require('./snippets/classfeature.gen.js'); const CoverPageGen = require('./snippets/coverpage.gen.js'); const TableOfContentsGen = require('./snippets/tableOfContents.gen.js'); +const indexGen = require('./snippets/index.gen.js'); const dedent = require('dedent-tabs').default; @@ -192,6 +193,11 @@ module.exports = [ \n`; }, }, + { + name : 'Index', + icon : 'fas fa-bars', + gen : indexGen, + }, ] }, diff --git a/themes/V3/5ePHB/snippets/index.gen.js b/themes/V3/5ePHB/snippets/index.gen.js new file mode 100644 index 000000000..775422e80 --- /dev/null +++ b/themes/V3/5ePHB/snippets/index.gen.js @@ -0,0 +1,116 @@ +const _ = require('lodash'); +const dedent = require('dedent-tabs').default; + +module.exports = () => { + return dedent`{{index,wide,columns:5; + ##### Index + - Abjuration Magic + creating spell slots, 12 + protective wards, 23 + - Acrobatics Skill + checks, 7, 10 + - Adventurers + creating a character, 4-6, 15 + - Alignment + choosing an alignment, 8-9 + effects of alignment, 18 + - Arcana Skill + checks, 12, 23 + - Armor + types of armor, 5 + donning and doffing armor, 13-14 + - Backgrounds + choosing a background, 6-7 + background features, 20-22 + - Bards + class features, 11-12 + spells, 27-28 + - Charisma Ability Score + determining ability score, 10 + modifying ability score, 13 + - Clerics + class features, 11 + spells, 25-26 + - Combat + initiative, 5-6 + actions in combat, 13 + resolving attacks, 29-31 + - Constitution Ability Score + determining ability score, 10 + modifying ability score, 13 + - Dexterity Ability Score + determining ability score, 10 + modifying ability score, 13 + - Dungeon Master + role of the DM, 4 + preparing for a game, 16-18 + - Dungeons & Dragons + history of the game, 4-6 + basic rules, 15 + - Equipment + buying and selling equipment, 5 + gear, 14-15 + - Experience Points (XP) + gaining XP, 8 + level advancement, 17 + - Familiars + types of familiars, 12 + familiar rules, 24 + - Feats + gaining feats, 13 + types of feats, 30 + - Fighters + class features, 11 + combat styles, 25 + - Hit Points (HP) + determining HP, 5 + losing and gaining HP, 13 + healing, 29-30 + - Intelligence Ability Score + determining ability score, 10 + modifying ability score, 13 + - Items + types of items, 5 + using and interacting with items, 14-15 + - Lore + knowledge checks, 12 + identifying magic, 23-24 + - Monsters + creating and using monsters, 11-12 + monster stats, 27-28 + - Nature Skill + checks, 12 + identifying creatures, 23 + - Paladins + class features, 11 + spells, 26-27 + - Perception Skill + checks, 7, 10 + - Rangers + class features, 11 + spells, 26 + - Religion Skill + checks, 12 + identifying holy symbols, 24 + - Rogues + class features, 11 + sneak attack, 25-26 + - Sorcerers + class features, 11 + spells, 28-29 + - Stealth Skill + checks, 7, 10 + - Strength Ability Score + determining ability score, 10 + modifying ability score, 13 + - Thieves’ Tools + using thieves’ tools, 14 + disarming traps, 31 + - Warlocks + class features, 11 + spells, 29 + - Wizards + class features, 11-12 + preparing spells, 27 + }}`; +}; \ No newline at end of file diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index c75cf0a1a..426e0deab 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -941,3 +941,21 @@ break-inside : avoid; } } } +//***************************** +// * INDEX +// *****************************/ +.page { + .index { + font-size:11px; + + ul { + margin-bottom: .5em; + padding-left: 1em; + text-indent: -1em; + list-style-type: none; + -webkit-column-break-inside: auto; + page-break-inside: auto; + break-inside: auto; + } + } +} From 71ec9034b7168c9faa8499af5e8c5f442dd24d9e Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 26 May 2023 17:17:56 -0400 Subject: [PATCH 2/5] Change snippet to nested list --- themes/V3/5ePHB/snippets/index.gen.js | 161 ++++++++------------------ 1 file changed, 49 insertions(+), 112 deletions(-) diff --git a/themes/V3/5ePHB/snippets/index.gen.js b/themes/V3/5ePHB/snippets/index.gen.js index 775422e80..985d5116f 100644 --- a/themes/V3/5ePHB/snippets/index.gen.js +++ b/themes/V3/5ePHB/snippets/index.gen.js @@ -1,116 +1,53 @@ -const _ = require('lodash'); const dedent = require('dedent-tabs').default; module.exports = () => { - return dedent`{{index,wide,columns:5; - ##### Index - - Abjuration Magic - creating spell slots, 12 - protective wards, 23 - - Acrobatics Skill - checks, 7, 10 - - Adventurers - creating a character, 4-6, 15 - - Alignment - choosing an alignment, 8-9 - effects of alignment, 18 - - Arcana Skill - checks, 12, 23 - - Armor - types of armor, 5 - donning and doffing armor, 13-14 - - Backgrounds - choosing a background, 6-7 - background features, 20-22 - - Bards - class features, 11-12 - spells, 27-28 - - Charisma Ability Score - determining ability score, 10 - modifying ability score, 13 - - Clerics - class features, 11 - spells, 25-26 - - Combat - initiative, 5-6 - actions in combat, 13 - resolving attacks, 29-31 - - Constitution Ability Score - determining ability score, 10 - modifying ability score, 13 - - Dexterity Ability Score - determining ability score, 10 - modifying ability score, 13 - - Dungeon Master - role of the DM, 4 - preparing for a game, 16-18 - - Dungeons & Dragons - history of the game, 4-6 - basic rules, 15 - - Equipment - buying and selling equipment, 5 - gear, 14-15 - - Experience Points (XP) - gaining XP, 8 - level advancement, 17 - - Familiars - types of familiars, 12 - familiar rules, 24 - - Feats - gaining feats, 13 - types of feats, 30 - - Fighters - class features, 11 - combat styles, 25 - - Hit Points (HP) - determining HP, 5 - losing and gaining HP, 13 - healing, 29-30 - - Intelligence Ability Score - determining ability score, 10 - modifying ability score, 13 - - Items - types of items, 5 - using and interacting with items, 14-15 - - Lore - knowledge checks, 12 - identifying magic, 23-24 - - Monsters - creating and using monsters, 11-12 - monster stats, 27-28 - - Nature Skill - checks, 12 - identifying creatures, 23 - - Paladins - class features, 11 - spells, 26-27 - - Perception Skill - checks, 7, 10 - - Rangers - class features, 11 - spells, 26 - - Religion Skill - checks, 12 - identifying holy symbols, 24 - - Rogues - class features, 11 - sneak attack, 25-26 - - Sorcerers - class features, 11 - spells, 28-29 - - Stealth Skill - checks, 7, 10 - - Strength Ability Score - determining ability score, 10 - modifying ability score, 13 - - Thieves’ Tools - using thieves’ tools, 14 - disarming traps, 31 - - Warlocks - class features, 11 - spells, 29 - - Wizards - class features, 11-12 - preparing spells, 27 - }}`; + return dedent` + {{index,wide,columns:5; + ##### Index + - Ankh-Morpork + - city map, 7 + - city watch, 12 + - guilds, 19 + - Cheese + - types of cheese, 8 + - cheese-related magic, 14 + - cheese-related quests, 26-27 + - Death + - appearance, 10 + - personality, 13 + - hobbies, 23 + - Elves + - types of elves, 15 + - elvish magic, 24 + - elvish curses, 28 + - Footnotes + - types of footnotes, 16-17 + - footnote rules, 20-21 + - footnote humor, 29-30 + - Gods + - types of gods, 12 + - godly interventions, 25 + - godly conflicts, 31 + - Heroes + - class features, 11-12 + - heroic deeds, 26-27 + - Inns + - types of inns, 9 + - inn amenities, 18 + - Jokes + - types of jokes,11-12 + - joke delivery,25 + - Knives + - types of knives,16-17 + - knife skills,22-23 + - knife fights,28-29 + - Luggage + - appearance,10 + - personality,13 + - abilities,23 + - Magic + - types of magic,15 + - magic rules,24 + - magic mishaps,28 + }}`; }; \ No newline at end of file From 47680f07df468d763cfdfc4a8e15168d0f32c574 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 30 May 2023 17:17:17 -0400 Subject: [PATCH 3/5] Change to nested lists, shrink font to match PHB --- themes/V3/5ePHB/snippets/index.gen.js | 56 +++++++++++++++++++++------ themes/V3/5ePHB/style.less | 21 ++++++---- 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/themes/V3/5ePHB/snippets/index.gen.js b/themes/V3/5ePHB/snippets/index.gen.js index 985d5116f..dff6467ac 100644 --- a/themes/V3/5ePHB/snippets/index.gen.js +++ b/themes/V3/5ePHB/snippets/index.gen.js @@ -4,7 +4,7 @@ module.exports = () => { return dedent` {{index,wide,columns:5; ##### Index - - Ankh-Morpork + - Ankhesh-Bort - city map, 7 - city watch, 12 - guilds, 19 @@ -35,19 +35,51 @@ module.exports = () => { - types of inns, 9 - inn amenities, 18 - Jokes - - types of jokes,11-12 - - joke delivery,25 + - types of jokes, 11-12 + - joke delivery, 25 - Knives - - types of knives,16-17 - - knife skills,22-23 - - knife fights,28-29 + - types of knives, 16-17 + - knife skills, 22-23 + - knife fights, 28-29 - Luggage - - appearance,10 - - personality,13 - - abilities,23 + - appearance, 10 + - personality, 13 + - abilities, 23 - Magic - - types of magic,15 - - magic rules,24 - - magic mishaps,28 + - types of magic, 15 + - magic rules, 24 + - magic mishaps, 28 + - Socks + - types of socks, 9 + - sock-related magic (yes, really), 15 + - sock-related quests (no, really), 26 + - Trolls + - appearance and biology, 11 + - culture and language, 18 + - troll rights and activism, 31 + - Unknown University + - history and architecture, 12 + - faculty and staff, 20 + - courses and exams, 33 + - Vampires + - types and origins, 13 + - vampiric powers and weaknesses, 21 + - vampiric etiquette and politics, 34 + - Witches + - types and traditions, 14 + - witchcraft and headology, 22 + - witch trials and tribulations, 35 + - Xylophones + - musical instruments or weapons?, 15 + - xylophone-related magic and lore, 23 + - xylophone-related quests and puzzles, 36 + - Yetis + - appearance and behavior, 16 + - yeti philosophy and religion, 24 + - yeti encounters and stories, 37 + - Zombies + - types and causes, 17 + - zombie rights and duties, 25 + - zombie survival and prevention, 38 }}`; }; \ No newline at end of file diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index f09d5a024..c6e87c40a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -1111,16 +1111,21 @@ break-inside : avoid; // *****************************/ .page { .index { - font-size:11px; + font-size : 0.218cm; + + ul ul { + margin : 0; + } ul { - margin-bottom: .5em; - padding-left: 1em; - text-indent: -1em; - list-style-type: none; - -webkit-column-break-inside: auto; - page-break-inside: auto; - break-inside: auto; + padding-left : 0; + text-indent : 0; + list-style-type : none; + } + + & > ul > li { + text-indent : -1.5em; + padding-left : 1.5em; } } } From 66b827ee2feae163feace48daf002e5f78e2283b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 30 May 2023 17:20:17 -0400 Subject: [PATCH 4/5] linting --- themes/V3/5ePHB/snippets.js | 15 ++++++++------- themes/V3/5ePHB/snippets/index.gen.js | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index ea373eb1d..13a6bbdec 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -7,7 +7,7 @@ const scriptGen = require('./snippets/script.gen.js'); const ClassFeatureGen = require('./snippets/classfeature.gen.js'); const CoverPageGen = require('./snippets/coverpage.gen.js'); const TableOfContentsGen = require('./snippets/tableOfContents.gen.js'); -const indexGen = require('./snippets/index.gen.js'); +const indexGen = require('./snippets/index.gen.js'); const dedent = require('dedent-tabs').default; @@ -189,9 +189,9 @@ module.exports = [ experimental : true }, { - name : 'Back Cover Page', - icon : 'fac book-back-cover', - gen : CoverPageGen.back, + name : 'Back Cover Page', + icon : 'fac book-back-cover', + gen : CoverPageGen.back, experimental : true }, { @@ -212,9 +212,10 @@ module.exports = [ }, }, { - name : 'Index', - icon : 'fas fa-bars', - gen : indexGen, + name : 'Index', + icon : 'fas fa-bars', + gen : indexGen, + experimental : true }, ] }, diff --git a/themes/V3/5ePHB/snippets/index.gen.js b/themes/V3/5ePHB/snippets/index.gen.js index dff6467ac..8de5df14c 100644 --- a/themes/V3/5ePHB/snippets/index.gen.js +++ b/themes/V3/5ePHB/snippets/index.gen.js @@ -1,7 +1,7 @@ const dedent = require('dedent-tabs').default; -module.exports = () => { - return dedent` +module.exports = ()=>{ + return dedent` {{index,wide,columns:5; ##### Index - Ankhesh-Bort From 37abc38426f974f03b1a4abaffc79eb958ade204 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 31 May 2023 09:33:01 -0400 Subject: [PATCH 5/5] Move snippet to "Text Editor" group --- themes/V3/5ePHB/snippets.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 13a6bbdec..dba4ad8d5 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -33,6 +33,12 @@ module.exports = [ name : 'Table of Contents', icon : 'fas fa-book', gen : TableOfContentsGen + }, + { + name : 'Index', + icon : 'fas fa-bars', + gen : indexGen, + experimental : true } ] }, @@ -210,13 +216,7 @@ module.exports = [ }} \n`; }, - }, - { - name : 'Index', - icon : 'fas fa-bars', - gen : indexGen, - experimental : true - }, + } ] },