Files
bmad-method-template/prototype/markdown-template.html
Claude Sonnet 4.6 9a5eb793e8 feat: 添加 Markdown 文档渲染功能
- 在文档中心和首页添加内嵌 Markdown 渲染器
- 使用 markdown-it 库在前端渲染 Markdown 内容
- 添加模态框展示渲染后的文档
- 重命名 {output_folder} 为 planning-artifacts
- 修改 server.js 支持父目录文件服务
- 文档链接现在可以正确显示格式化的 HTML

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 02:54:37 +00:00

182 lines
5.1 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{title}}</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
line-height: 1.8;
color: #333;
background: #f8f9fa;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 40px 20px;
}
.markdown-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 60px 20px;
text-align: center;
margin-bottom: 40px;
box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}
.markdown-header h1 {
font-size: 2.5em;
font-weight: 700;
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.markdown-content {
background: white;
padding: 40px 50px;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
margin-top: 1.5em;
margin-bottom: 0.8em;
font-weight: 600;
line-height: 1.4;
}
.markdown-content h1 {
font-size: 2em;
border-bottom: 3px solid #667eea;
padding-bottom: 0.3em;
}
.markdown-content h2 {
font-size: 1.6em;
border-bottom: 2px solid #e0e0e0;
padding-bottom: 0.2em;
}
.markdown-content h3 {
font-size: 1.3em;
color: #555;
}
.markdown-content p {
margin-bottom: 1em;
}
.markdown-content a {
color: #667eea;
text-decoration: none;
border-bottom: 1px dotted #667eea;
}
.markdown-content a:hover {
color: #764ba2;
border-bottom-style: solid;
}
.markdown-content ul,
.markdown-content ol {
margin-left: 2em;
margin-bottom: 1em;
}
.markdown-content li {
margin-bottom: 0.5em;
}
.markdown-content code {
background: #f4f4f4;
padding: 0.2em 0.4em;
border-radius: 4px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 0.9em;
color: #e74c3c;
}
.markdown-content pre {
background: #2d2d2d;
color: #f8f8f2;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
margin-bottom: 1.5em;
}
.markdown-content pre code {
background: transparent;
color: inherit;
padding: 0;
}
.markdown-content blockquote {
border-left: 4px solid #667eea;
padding-left: 20px;
margin: 1.5em 0;
color: #666;
background: #f8f9fa;
padding: 15px 20px;
border-radius: 0 8px 8px 0;
}
.markdown-content table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1.5em;
}
.markdown-content table th,
.markdown-content table td {
border: 1px solid #ddd;
padding: 12px;
text-align: left;
}
.markdown-content table th {
background: #667eea;
color: white;
font-weight: 600;
}
.markdown-content table tr:nth-child(even) {
background: #f8f9fa;
}
.markdown-content img {
max-width: 100%;
border-radius: 8px;
margin: 1.5em 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.markdown-content hr {
border: none;
border-top: 2px solid #e0e0e0;
margin: 2em 0;
}
.back-link {
text-align: center;
margin-top: 30px;
}
.back-link a {
display: inline-block;
padding: 10px 24px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
text-decoration: none;
border-radius: 25px;
border: none;
transition: transform 0.2s, box-shadow 0.2s;
}
.back-link a:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
</style>
</head>
<body>
<div class="markdown-header">
<h1>{{title}}</h1>
</div>
<div class="container">
<div class="markdown-content">
{{content}}
</div>
<div class="back-link">
<a href="/">返回首页</a>
</div>
</div>
</body>
</html>