mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 18:52:38 +00:00
Relocate more general purposes snippets from 5ePHB to Blank
Should include all supporting style content.
This commit is contained in:
@@ -6,138 +6,13 @@ const MonsterBlockGen = require('./snippets/monsterblock.gen.js');
|
|||||||
const scriptGen = require('./snippets/script.gen.js');
|
const scriptGen = require('./snippets/script.gen.js');
|
||||||
const ClassFeatureGen = require('./snippets/classfeature.gen.js');
|
const ClassFeatureGen = require('./snippets/classfeature.gen.js');
|
||||||
const CoverPageGen = require('./snippets/coverpage.gen.js');
|
const CoverPageGen = require('./snippets/coverpage.gen.js');
|
||||||
const TableOfContentsGen = require('./snippets/tableOfContents.gen.js');
|
|
||||||
const indexGen = require('./snippets/index.gen.js');
|
|
||||||
const QuoteGen = require('./snippets/quote.gen.js');
|
const QuoteGen = require('./snippets/quote.gen.js');
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
|
||||||
{
|
|
||||||
groupName : 'Text Editor',
|
|
||||||
icon : 'fas fa-pencil-alt',
|
|
||||||
view : 'text',
|
|
||||||
snippets : [
|
|
||||||
{
|
|
||||||
name : 'Table of Contents',
|
|
||||||
icon : 'fas fa-book',
|
|
||||||
gen : TableOfContentsGen,
|
|
||||||
experimental : true,
|
|
||||||
subsnippets : [
|
|
||||||
{
|
|
||||||
name : 'Table of Contents',
|
|
||||||
icon : 'fas fa-book',
|
|
||||||
gen : TableOfContentsGen,
|
|
||||||
experimental : true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Include in ToC up to H3',
|
|
||||||
icon : 'fas fa-dice-three',
|
|
||||||
gen : dedent `\n{{tocDepthH3
|
|
||||||
}}\n`,
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Include in ToC up to H4',
|
|
||||||
icon : 'fas fa-dice-four',
|
|
||||||
gen : dedent `\n{{tocDepthH4
|
|
||||||
}}\n`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Include in ToC up to H5',
|
|
||||||
icon : 'fas fa-dice-five',
|
|
||||||
gen : dedent `\n{{tocDepthH5
|
|
||||||
}}\n`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Include in ToC up to H6',
|
|
||||||
icon : 'fas fa-dice-six',
|
|
||||||
gen : dedent `\n{{tocDepthH6
|
|
||||||
}}\n`,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Index',
|
|
||||||
icon : 'fas fa-bars',
|
|
||||||
gen : indexGen,
|
|
||||||
experimental : true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
groupName : 'Style Editor',
|
|
||||||
icon : 'fas fa-pencil-alt',
|
|
||||||
view : 'style',
|
|
||||||
snippets : [
|
|
||||||
{
|
|
||||||
name : 'Remove Drop Cap',
|
|
||||||
icon : 'fas fa-remove-format',
|
|
||||||
gen : dedent`/* Removes Drop Caps */
|
|
||||||
.page h1+p:first-letter {
|
|
||||||
all: unset;
|
|
||||||
}\n\n
|
|
||||||
/* Removes Small-Caps in first line */
|
|
||||||
.page h1+p:first-line {
|
|
||||||
all: unset;
|
|
||||||
}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Tweak Drop Cap',
|
|
||||||
icon : 'fas fa-sliders-h',
|
|
||||||
gen : dedent`/* Drop Cap settings */
|
|
||||||
.page h1 + p::first-letter {
|
|
||||||
font-family: SolberaImitationRemake;
|
|
||||||
font-size: 3.5cm;
|
|
||||||
background-image: linear-gradient(-45deg, #322814, #998250, #322814);
|
|
||||||
line-height: 1em;
|
|
||||||
}\n\n`
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
/*********************** IMAGES *******************/
|
|
||||||
{
|
|
||||||
groupName : 'Images',
|
|
||||||
icon : 'fas fa-images',
|
|
||||||
view : 'text',
|
|
||||||
snippets : [
|
|
||||||
{
|
|
||||||
name : 'Image',
|
|
||||||
icon : 'fas fa-image',
|
|
||||||
gen : dedent`
|
|
||||||
 {width:325px,mix-blend-mode:multiply}
|
|
||||||
|
|
||||||
{{artist,position:relative,top:-230px,left:10px,margin-bottom:-30px
|
|
||||||
##### Cat Warrior
|
|
||||||
[Kyoung Hwan Kim](https://www.artstation.com/tahra)
|
|
||||||
}}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Background Image',
|
|
||||||
icon : 'fas fa-tree',
|
|
||||||
gen : dedent`
|
|
||||||
 {position:absolute,top:50px,right:30px,width:280px}
|
|
||||||
|
|
||||||
{{artist,top:80px,right:30px
|
|
||||||
##### Homebrew Mug
|
|
||||||
[naturalcrit](https://homebrew.naturalcrit.com)
|
|
||||||
}}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Watermark',
|
|
||||||
icon : 'fas fa-id-card',
|
|
||||||
gen : dedent`
|
|
||||||
{{watermark Homebrewery}}\n`
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/************************* PHB ********************/
|
/************************* PHB ********************/
|
||||||
|
|
||||||
{
|
{
|
||||||
groupName : 'PHB',
|
groupName : 'PHB',
|
||||||
icon : 'fas fa-book',
|
icon : 'fas fa-book',
|
||||||
@@ -332,9 +207,6 @@ module.exports = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************** PAGE *************/
|
/**************** PAGE *************/
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ const WatercolorGen = require('./snippets/watercolor.gen.js');
|
|||||||
const ImageMaskGen = require('./snippets/imageMask.gen.js');
|
const ImageMaskGen = require('./snippets/imageMask.gen.js');
|
||||||
const FooterGen = require('./snippets/footer.gen.js');
|
const FooterGen = require('./snippets/footer.gen.js');
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
|
const TableOfContentsGen = require('./snippets/tableOfContents.gen.js');
|
||||||
|
const indexGen = require('./snippets/index.gen.js');
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
|
||||||
@@ -125,7 +127,53 @@ module.exports = [
|
|||||||
[Homebrewery.Naturalcrit.com](https://homebrewery.naturalcrit.com)
|
[Homebrewery.Naturalcrit.com](https://homebrewery.naturalcrit.com)
|
||||||
}}\n\n`;
|
}}\n\n`;
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
name : 'Table of Contents',
|
||||||
|
icon : 'fas fa-book',
|
||||||
|
gen : TableOfContentsGen,
|
||||||
|
experimental : true,
|
||||||
|
subsnippets : [
|
||||||
|
{
|
||||||
|
name : 'Table of Contents',
|
||||||
|
icon : 'fas fa-book',
|
||||||
|
gen : TableOfContentsGen,
|
||||||
|
experimental : true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Include in ToC up to H3',
|
||||||
|
icon : 'fas fa-dice-three',
|
||||||
|
gen : dedent `\n{{tocDepthH3
|
||||||
|
}}\n`,
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Include in ToC up to H4',
|
||||||
|
icon : 'fas fa-dice-four',
|
||||||
|
gen : dedent `\n{{tocDepthH4
|
||||||
|
}}\n`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Include in ToC up to H5',
|
||||||
|
icon : 'fas fa-dice-five',
|
||||||
|
gen : dedent `\n{{tocDepthH5
|
||||||
|
}}\n`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Include in ToC up to H6',
|
||||||
|
icon : 'fas fa-dice-six',
|
||||||
|
gen : dedent `\n{{tocDepthH6
|
||||||
|
}}\n`,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Index',
|
||||||
|
icon : 'fas fa-bars',
|
||||||
|
gen : indexGen,
|
||||||
|
experimental : true
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -138,6 +186,29 @@ module.exports = [
|
|||||||
icon : 'fas fa-code',
|
icon : 'fas fa-code',
|
||||||
gen : '/* This is a comment that will not be rendered into your brew. */'
|
gen : '/* This is a comment that will not be rendered into your brew. */'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name : 'Remove Drop Cap',
|
||||||
|
icon : 'fas fa-remove-format',
|
||||||
|
gen : dedent`/* Removes Drop Caps */
|
||||||
|
.page h1+p:first-letter {
|
||||||
|
all: unset;
|
||||||
|
}\n\n
|
||||||
|
/* Removes Small-Caps in first line */
|
||||||
|
.page h1+p:first-line {
|
||||||
|
all: unset;
|
||||||
|
}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Tweak Drop Cap',
|
||||||
|
icon : 'fas fa-sliders-h',
|
||||||
|
gen : dedent`/* Drop Cap settings */
|
||||||
|
.page h1 + p::first-letter {
|
||||||
|
font-family: SolberaImitationRemake;
|
||||||
|
font-size: 3.5cm;
|
||||||
|
background-image: linear-gradient(-45deg, #322814, #998250, #322814);
|
||||||
|
line-height: 1em;
|
||||||
|
}\n\n`
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -482,3 +482,130 @@ body { counter-reset : page-numbers; }
|
|||||||
.pageNumber { left : 30px; }
|
.pageNumber { left : 30px; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *****************************
|
||||||
|
// * INDEX
|
||||||
|
// *****************************/
|
||||||
|
.page {
|
||||||
|
.index {
|
||||||
|
font-size : 0.218cm;
|
||||||
|
|
||||||
|
ul ul { margin : 0; }
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left : 0;
|
||||||
|
text-indent : 0;
|
||||||
|
list-style-type : none;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > ul > li {
|
||||||
|
padding-left : 1.5em;
|
||||||
|
text-indent : -1.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// *****************************
|
||||||
|
// * TABLE OF CONTENTS
|
||||||
|
// *****************************/
|
||||||
|
|
||||||
|
// Default Exclusions
|
||||||
|
// Anything not exlcuded is included, default Headers are H1, H2, and H3.
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
.page:has(.frontCover),
|
||||||
|
.page:has(.backCover),
|
||||||
|
.page:has(.insideCover),
|
||||||
|
.monster,
|
||||||
|
.noToC,
|
||||||
|
.toc { --TOC: exclude; }
|
||||||
|
|
||||||
|
.tocDepthH2 :is(h1, h2) {--TOC: include; }
|
||||||
|
.tocDepthH3 :is(h1, h2, h3) {--TOC: include; }
|
||||||
|
.tocDepthH4 :is(h1, h2, h3, h4) {--TOC: include; }
|
||||||
|
.tocDepthH5 :is(h1, h2, h3, h4, h5) {--TOC: include; }
|
||||||
|
.tocDepthH6 :is(h1, h2, h3, h4, h5, h6) {--TOC: include; }
|
||||||
|
|
||||||
|
.tocIncludeH1 h1 {--TOC: include; }
|
||||||
|
.tocIncludeH2 h2 {--TOC: include; }
|
||||||
|
.tocIncludeH3 h3 {--TOC: include; }
|
||||||
|
.tocIncludeH4 h4 {--TOC: include; }
|
||||||
|
.tocIncludeH5 h5 {--TOC: include; }
|
||||||
|
.tocIncludeH6 h6 {--TOC: include; }
|
||||||
|
|
||||||
|
.page:has(.partCover) {
|
||||||
|
--TOC: exclude;
|
||||||
|
& h1 {
|
||||||
|
--TOC: include;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
&:has(.toc)::after { display : none; }
|
||||||
|
.toc {
|
||||||
|
-webkit-column-break-inside : avoid;
|
||||||
|
page-break-inside : avoid;
|
||||||
|
break-inside : avoid;
|
||||||
|
h1 {
|
||||||
|
margin-bottom : 0.3cm;
|
||||||
|
text-align : center;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
display : inline;
|
||||||
|
color : inherit;
|
||||||
|
text-decoration : none;
|
||||||
|
&:hover { text-decoration : underline; }
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
margin-top : 0.2cm;
|
||||||
|
line-height : 0.4cm;
|
||||||
|
& + ul li { line-height : 1.2em; }
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
padding-left : 0;
|
||||||
|
margin-top : 0;
|
||||||
|
list-style-type : none;
|
||||||
|
a {
|
||||||
|
display : flex;
|
||||||
|
flex-flow : row nowrap;
|
||||||
|
justify-content : space-between;
|
||||||
|
width : 100%;
|
||||||
|
}
|
||||||
|
li + li h3 {
|
||||||
|
margin-top : 0.26cm;
|
||||||
|
line-height : 1em;
|
||||||
|
}
|
||||||
|
h3 span:first-child::after { border : none; }
|
||||||
|
span {
|
||||||
|
display : contents;
|
||||||
|
&:first-child::after {
|
||||||
|
bottom : 0.08cm;
|
||||||
|
flex : 1;
|
||||||
|
margin-right : 0.16cm;
|
||||||
|
margin-bottom : 0.08cm;
|
||||||
|
margin-left : 0.08cm; /* Spacing before dot leaders */
|
||||||
|
content : '';
|
||||||
|
border-bottom : 0.05cm dotted #000000;
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
display : inline-block;
|
||||||
|
align-self : flex-end;
|
||||||
|
font-family : 'BookInsanityRemake';
|
||||||
|
font-size : 0.34cm;
|
||||||
|
font-weight : normal;
|
||||||
|
color : #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ul { /* List indent */
|
||||||
|
margin-left : 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.wide {
|
||||||
|
.useColumns(0.96, @fillMode: balance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.toc.wide li {
|
||||||
|
break-inside: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user