asset忘了上传了,重新传一下,增加了模板引擎(见README),修复了printable的目录bug

This commit is contained in:
Nobody committed 2026-11-10 00:43:44 +08:00
commit 294abad18b
550 files changed
+62291

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
//提供四个对象,可以来写dom逻辑
//html,documentument,cfg,pages
/**
* 从提供的 `documentument` 中移除所有 style 中含有 `page-break-after: always` 的声明。
* - 处理 inline `style` 属性
* - 处理 `<style>` 元素中的 CSS 文本
*
* 用法:
* import { removePageBreakAfterAlways } from './build.js';
* removePageBreakAfterAlways(documentument);
*/
cfg.indexSearch = {
mode: "sequential",
};
@@ -0,0 +1,34 @@
<div
style="min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: xx-large; position: relative; page-break-after: always"
>
<div
style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%"
>
<div
style="position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1mm"
>
<p
class=""
style="scale: 4.5; z-index: 999"
>
工农解放报
</p>
<p
class=""
style="margin-top: 1%; scale: 2; z-index: 999"
>
RSF续刊第{{times}}期
</p>
<p
class=""
style="position: relative; margin-top: 1%; font-size: larger"
>
工农解放社-原革命社会主义阵地(RSF)- {{year}}.{{month}}.{{day}}发布
</p>
</div>
</div>
</div>
<style>
</style>
@@ -0,0 +1 @@
<div></div>
+96
View File
@@ -0,0 +1,96 @@
<style>
/* @font-face {
font-family: "Liu Jian Mao Cao";
src: url("fonts/LiuJianMaoCao-Regular.ttf")
format("truetype");
font-display: swap;
} */
/* @font-face {
font-family: "YangRenDongZhuShiTi";
src: url("fonts/YangRenDongZhuShiTi-Regular.ttf")
format("truetype");
font-display: swap;
} */
@font-face {
font-family: "ZCOOL QingKe HuangYou";
src: url("fonts/ZCOOLQingKeHuangYou-Regular.ttf")
format("truetype");
font-display: swap;
}
/* @font-face {
font-family: "ZCOOLKuaiLe";
src: url("fonts/ZCOOLKuaiLe-Regular.ttf")
format("truetype");
font-display: swap;
} */
/* @font-face {
font-family: "MaShanZheng";
src: url("fonts/MaShanZheng-Regular.ttf")
format("truetype");
font-display: swap;
} */
@font-face {
font-family: "HongLei";
src: url("fonts/HongLei.otf") format("opentype");
font-display: swap;
}
/* @font-face {
font-family: "Kai";
src: url("fonts/Kai.ttf") format("truetype");
font-display: swap;
} */
@font-face {
font-family: "FangZhengFangSong";
src: url("fonts/方正仿宋简体.ttf")
format("woff2");
font-display: swap;
}
/* .zcool-qingke-huangyou-regular {
font-family: "ZCOOL QingKe HuangYou", sans-serif;
font-weight: 400;
font-style: normal;
}
.liu-jian-mao-cao-regular {
font-family: "Liu Jian Mao Cao", cursive;
font-weight: 400;
font-style: normal;
}
.zcool-kuai-le-regular {
font-family: "ZCOOLKuaiLe", cursive;
font-weight: 400;
font-style: normal;
}
.ma-shan-zheng-regular {
font-family: "MaShanZheng", cursive;
font-weight: 400;
font-style: normal;
}
.hong-lei-regular {
font-family: "HongLei", regular;
font-weight: 400;
font-style: normal;
}
.yang-ren-dong-zhu-shi-ti-regular {
font-family: "YangRenDongZhuShiTi", regular;
font-weight: 400;
font-style: normal;
}
.kai-regular {
font-family: "Kai", regular;
font-weight: 400;
font-style: normal;
}
.wang-song-jian-regular {
font-family: "FangZhengFangSong", regular;
font-weight: 400;
font-style: normal;
} */
</style>
+190
View File
@@ -0,0 +1,190 @@
<style>
/*基础格式部分*/
.global {
font-family: "R-PMingLiU", sans-serif;
font-size: var(--font-size);
margin: 1rem 4rem 2rem 4rem;
line-height: 20px;
/* letter-spacing: -0.15rem; */
}
.global h1 {
line-height: 1.5;
}
.global h2 {
line-height: 1.45;
}
.global h3,
.global h4,
.global h5,
.global h6 {
line-height: 1.4;
}
.global h1 {
line-height: 2rem;
font-family: "R-PMingLiU", sans-serif;
break-after: avoid-page;
page-break-after: avoid;
break-inside: avoid;
page-break-inside: avoid;
}
/* Let long articles flow naturally, but keep an article heading with its
first block so a page does not begin with a detached title. */
.passages {
padding-block: 1.5rem;
break-inside: auto;
page-break-inside: auto;
break-after: auto;
page-break-after: auto;
}
.passages > h1:first-child + p,
.passages > h1:first-child + h2,
.passages > h1:first-child + h3 {
break-before: auto;
page-break-before: auto;
}
.article-heading-group {
display: block;
break-inside: avoid-page;
page-break-inside: avoid;
}
.passages > h1:first-child {
margin-bottom: 0.35rem;
}
ch1.c_title {
margin-top: 3rem;
margin-bottom: 1rem;
break-after: avoid-page;
page-break-after: avoid;
break-inside: avoid;
page-break-inside: avoid;
}
.global p {
margin: 15px 0;
}
html, body {
margin: 0;
padding: 0;
--font-size: 12px;
}
/*控件美化部分*/
.c_title {
font-size: 2rem;
color: red;
display: inline-flex;
width: fit-content;
line-height: 1.5;
padding: 0.08em 0.24em;
white-space: normal;
word-break: break-all;
font-family: "R-PMingLiU", sans-serif;
margin: 2rem 1rem 0rem 2rem;
overflow-wrap: break-word;
max-width: 21cm;
}
blockquote {
border-left: 0.5rem solid #ccc;
padding: 0.5rem 1rem;
margin: 1rem 0;
border-radius: 22px;
border-color: #666;
}
.global img {
height: auto;
object-fit: scale-down;
max-width: 45%;
max-height: 10cm;
border-radius: 12px;
border: 4px solid linear-gradient(45deg, #e799b1, #44b144, #2f90ba);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
display: block;
margin: 1rem auto;
/* color: transparent; */
/* overflow: hidden; */
}
.global a[href] {
color: rgb(0, 180, 120);
text-decoration: none;
}
/*目录美化部分*/
index h1 {
font-size: 1rem;
color: black;
border: 0.18rem solid red;
display: inline-flex;
width: fit-content;
line-height: 1.5;
padding: 0.08em 0.24em;
white-space: normal;
word-break: break-all;
font-family: "R-PMingLiU", sans-serif;
margin: 2rem 1rem 0rem 2rem;
border-radius: 0.5rem;
overflow-wrap: break-word;
max-width: 21cm;
}
index a {
text-decoration: none;
font-size: var(--font-size);
display: flex;
width: 100%;
justify-content: space-between;
align-items: flex-start;
gap: 0.75rem;
}
index ul {
margin: 1rem 2rem 3rem 2rem;
/* padding: 0.5rem 1rem; */
}
index li {
list-style: none;
display: flex;
width: 100%;
justify-content: space-between;
align-items: flex-start;
word-break: break-all;
word-wrap: normal;
line-height: 1.5;
break-inside: avoid;
page-break-inside: avoid;
}
index li page_title {
color: black;
font-size: var(--font-size);
font-weight: thin;
position: static;
flex: 1 1 auto;
min-width: 0;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
line-height: 1.5;
display: inline-block;
}
index li page_num {
color: black;
font-size: var(--font-size);
position: static;
flex: 0 0 auto;
min-width: 4ch;
margin-left: 1rem;
white-space: nowrap;
text-align: right;
font-variant-numeric: tabular-nums;
font-feature-settings: "tnum" 1;
}
index li a {
break-inside: avoid;
page-break-inside: avoid;
}
</style>