Loading...
Loading...
Compare original and translation side by side
| 编号 | 风格名称 | 适用场景 | 视觉特点 |
|---|---|---|---|
| 1 | 经典优雅 (Classic Elegance) | 文学、散文、回忆录 | 衬线字体、暖色调、首字下沉、装饰性分隔线 |
| 2 | 现代极简 (Modern Minimalist) | 科技博客、现代文章 | 无衬线字体、大量留白、简洁线条 |
| 3 | 科技杂志 (Tech Magazine) | 编程、技术内容 | 渐变色彩、代码块样式、未来感设计 |
| 4 | 自然生活 (Nature & Lifestyle) | 生活方式、旅行、美食 | 自然绿色调、有机造型、手写风格点缀 |
| 5 | 大胆社论 (Bold Editorial) | 观点、评论文章 | 超大标题、高对比黑白、红色强调 |
| 6 | 复古怀旧 (Vintage Retro) | 历史、怀旧内容 | 复古边框、打字机字体、羊皮纸质感 |
| 7 | 商务专业 (Corporate Professional) | 商业报告、企业文档 | 海军蓝配色、清晰层级、专业严谨 |
| 8 | 创意艺术 (Creative Art) | 设计、艺术创作 | 不对称布局、色块装饰、手绘风格 |
| 9 | 学术期刊 (Academic Journal) | 学术论文、研究报告 | 双栏布局、摘要样式、引用格式 |
| 10 | 时尚奢华 (Fashion Luxe) | 时尚、奢侈品内容 | 金色点缀、优雅衬线、精致留白 |
| 11 | 新闻报道 (News & Report) | 新闻、新闻报道 | 报纸风格、多级标题、突发标签 |
| 12 | 暗黑科技 (Dark Mode Tech) | 开发者内容 | 深色背景、荧光配色、终端风格 |
| ID | Style Name | Use Case | Visual Features |
|---|---|---|---|
| 1 | Classic Elegance | Literature, essays, memoirs | Serif fonts, warm color tones, drop cap, decorative dividers |
| 2 | Modern Minimalist | Tech blogs, modern articles | Sans-serif fonts, ample white space, clean lines |
| 3 | Tech Magazine | Programming, technical content | Gradient colors, code block styles, futuristic design |
| 4 | Nature & Lifestyle | Lifestyle, travel, food | Natural green tones, organic shapes, handwritten style accents |
| 5 | Bold Editorial | Opinions, commentaries | Oversized headings, high-contrast black and white, red accents |
| 6 | Vintage Retro | History, nostalgic content | Vintage borders, typewriter fonts, parchment texture |
| 7 | Corporate Professional | Business reports, corporate documents | Navy blue color scheme, clear hierarchy, professional and rigorous |
| 8 | Creative Art | Design, artistic creation | Asymmetric layout, color block decorations, hand-drawn style |
| 9 | Academic Journal | Academic papers, research reports | Two-column layout, abstract style, citation format |
| 10 | Fashion Luxe | Fashion, luxury content | Gold accents, elegant serifs, refined white space |
| 11 | News & Report | News, news reports | Newspaper style, multi-level headings, breaking news tags |
| 12 | Dark Mode Tech | Developer content | Dark background, fluorescent color scheme, terminal style |
drop-capblockquote<!-- 首字下沉段落 -->
<p class="drop-cap">首段文字内容...</p>
<!-- 引言/引用块 -->
<blockquote>
<p>"重要引言内容"</p>
<cite>— 来源</cite>
</blockquote>
<!-- 章节分隔线 -->
<div class="elegant-divider"><span>※</span></div>
<!-- 标题区域 -->
<header>
<h1>主标题</h1>
<p class="subtitle">副标题或导语</p>
</header>/* 打印/PDF模式 */
@media print {
/* 标题后禁止分页 */
h1, h2, h3, .chapter-number, .chapter-title {
page-break-after: avoid; break-after: avoid;
}
/* 块级元素内部禁止分页 */
blockquote, .highlight-box, .stage-item, .question-item,
.code-block, .terminal, figure, img, table {
page-break-inside: avoid; break-inside: avoid;
}
/* 列表保持完整 */
ul, ol, .numbered-list, .stage-list {
page-break-inside: avoid; break-inside: avoid;
}
/* 分隔线后禁止分页 */
.elegant-divider, .divider, hr {
page-break-after: avoid; break-after: avoid;
}
/* 段落孤行寡行控制 */
p { orphans: 3; widows: 3; }
}
/* 非打印时也应用,确保PDF渲染一致 */
blockquote, .highlight-box, .code-block, .terminal, figure, img, table {
page-break-inside: avoid; break-inside: avoid;
}| CSS属性 | 效果 | 适用元素 |
|---|---|---|
| 元素内部禁止分页 | 引言、卡片、列表 |
| 元素后禁止分页 | 标题、分隔线 |
| 页底至少保留3行 | 段落 |
| 页顶至少保留3行 | 段落 |
drop-capblockquote<!-- Drop cap paragraph -->
<p class="drop-cap">First paragraph content...</p>
<!-- Quote/citation block -->
<blockquote>
<p>"Important quote content"</p>
<cite>— Source</cite>
</blockquote>
<!-- Chapter divider -->
<div class="elegant-divider"><span>※</span></div>
<!-- Header section -->
<header>
<h1>Main Title</h1>
<p class="subtitle">Subtitle or introduction</p>
</header>/* Print/PDF mode */
@media print {
/* Prevent page breaks after headings */
h1, h2, h3, .chapter-number, .chapter-title {
page-break-after: avoid; break-after: avoid;
}
/* Prevent page breaks inside block elements */
blockquote, .highlight-box, .stage-item, .question-item,
.code-block, .terminal, figure, img, table {
page-break-inside: avoid; break-inside: avoid;
}
/* Keep lists intact */
ul, ol, .numbered-list, .stage-list {
page-break-inside: avoid; break-inside: avoid;
}
/* Prevent page breaks after dividers */
.elegant-divider, .divider, hr {
page-break-after: avoid; break-after: avoid;
}
/* Control orphan and widow lines for paragraphs */
p { orphans: 3; widows: 3; }
}
/* Apply to non-print modes too for consistent PDF rendering */
blockquote, .highlight-box, .code-block, .terminal, figure, img, table {
page-break-inside: avoid; break-inside: avoid;
}| CSS Property | Effect | Applicable Elements |
|---|---|---|
| Prevent page breaks inside elements | Quotes, cards, lists |
| Prevent page breaks after elements | Headings, dividers |
| Keep at least 3 lines at the bottom of a page | Paragraphs |
| Keep at least 3 lines at the top of a page | Paragraphs |
scripts/html_to_pdf.pyundefinedscripts/html_to_pdf.pyundefined
**引擎安装方法:**
- Playwright(推荐): `pip install playwright && playwright install chromium`
- WeasyPrint: `pip install weasyprint`
- wkhtmltopdf: `brew install wkhtmltopdf` (macOS)
**Engine Installation Methods:**
- Playwright (Recommended): `pip install playwright && playwright install chromium`
- WeasyPrint: `pip install weasyprint`
- wkhtmltopdf: `brew install wkhtmltopdf` (macOS)文章_第1页.html文章_第2页.htmlArticle_Page1.htmlArticle_Page2.htmlundefinedundefined文章.html文章.htmlpython scripts/html_to_pdf.py 文章.htmlundefinedArticle.html<!DOCTYPE html>
...complete HTML code...Article.htmlpython scripts/html_to_pdf.py Article.htmlundefinedhtml_to_pdf.pyhtml_to_pdf.pystyles.mdstyles.md