markdawn 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdawn-0.2.0 → markdawn-0.3.0}/PKG-INFO +1 -1
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn/__init__.py +2 -2
- markdawn-0.3.0/markdawn/parts/template.py +210 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn.egg-info/PKG-INFO +1 -1
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn.egg-info/SOURCES.txt +2 -1
- markdawn-0.3.0/markdawn.egg-info/top_level.txt +2 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/setup.py +1 -1
- markdawn-0.2.0/markdawn.egg-info/top_level.txt +0 -1
- {markdawn-0.2.0 → markdawn-0.3.0}/README.md +0 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn/test.py +0 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn.egg-info/dependency_links.txt +0 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn.egg-info/entry_points.txt +0 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/markdawn.egg-info/requires.txt +0 -0
- {markdawn-0.2.0 → markdawn-0.3.0}/setup.cfg +0 -0
|
@@ -173,8 +173,8 @@ def _simple_md_to_html(text: str) -> str:
|
|
|
173
173
|
return '\n'.join(html_lines)
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
# HTML テンプレート
|
|
177
|
-
HTML_TEMPLATE = fies[rel2abs("./template.
|
|
176
|
+
# HTML テンプレート (htmlではezpipの公開範囲に含まれないため便宜上py拡張子としている)
|
|
177
|
+
HTML_TEMPLATE = fies[rel2abs("./parts/template.py"), "text"]
|
|
178
178
|
|
|
179
179
|
def build_header(title: str, subtitle: str) -> str:
|
|
180
180
|
if not title:
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="{lang}">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>{title}</title>
|
|
7
|
+
|
|
8
|
+
<!-- KaTeX (数式) -->
|
|
9
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.css">
|
|
10
|
+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.js"></script>
|
|
11
|
+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/contrib/auto-render.min.js"
|
|
12
|
+
onload="renderMathInElement(document.body, {{
|
|
13
|
+
delimiters: [
|
|
14
|
+
{{left: '$$', right: '$$', display: true}},
|
|
15
|
+
{{left: '$', right: '$', display: false}}
|
|
16
|
+
],
|
|
17
|
+
throwOnError: false
|
|
18
|
+
}});"></script>
|
|
19
|
+
|
|
20
|
+
<!-- highlight.js (シンタックスハイライト) -->
|
|
21
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/{hl_theme}.min.css">
|
|
22
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
23
|
+
<script>
|
|
24
|
+
document.addEventListener('DOMContentLoaded', () => {{
|
|
25
|
+
document.querySelectorAll('pre code').forEach((el) => {{
|
|
26
|
+
hljs.highlightElement(el);
|
|
27
|
+
}});
|
|
28
|
+
}});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
:root {{
|
|
33
|
+
--text: {color_text};
|
|
34
|
+
--bg: {color_bg};
|
|
35
|
+
--accent: {color_accent};
|
|
36
|
+
--accent-light: {color_accent_light};
|
|
37
|
+
--border: {color_border};
|
|
38
|
+
--code-bg: {color_code_bg};
|
|
39
|
+
}}
|
|
40
|
+
|
|
41
|
+
* {{ box-sizing: border-box; margin: 0; padding: 0; }}
|
|
42
|
+
|
|
43
|
+
body {{
|
|
44
|
+
font-family: {font_family};
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
line-height: 1.85;
|
|
47
|
+
color: var(--text);
|
|
48
|
+
background: var(--bg);
|
|
49
|
+
max-width: 820px;
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
padding: 48px 32px 80px;
|
|
52
|
+
}}
|
|
53
|
+
|
|
54
|
+
h1 {{ display: none; }}
|
|
55
|
+
|
|
56
|
+
h2 {{
|
|
57
|
+
font-size: 1.35rem;
|
|
58
|
+
color: var(--accent);
|
|
59
|
+
border-left: 4px solid var(--accent);
|
|
60
|
+
padding: 6px 0 6px 14px;
|
|
61
|
+
margin: 2.4em 0 0.9em;
|
|
62
|
+
}}
|
|
63
|
+
|
|
64
|
+
h3 {{
|
|
65
|
+
font-size: 1.1rem;
|
|
66
|
+
color: #2a4060;
|
|
67
|
+
margin: 1.8em 0 0.6em;
|
|
68
|
+
padding-bottom: 3px;
|
|
69
|
+
border-bottom: 1px solid var(--border);
|
|
70
|
+
}}
|
|
71
|
+
|
|
72
|
+
h4 {{
|
|
73
|
+
font-size: 1rem;
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
margin: 1.4em 0 0.4em;
|
|
76
|
+
}}
|
|
77
|
+
|
|
78
|
+
p {{ margin: 0.7em 0; }}
|
|
79
|
+
|
|
80
|
+
ul, ol {{ margin: 0.6em 0 0.6em 1.5em; }}
|
|
81
|
+
li {{ margin: 0.3em 0; }}
|
|
82
|
+
|
|
83
|
+
strong {{ color: #1a3a5c; }}
|
|
84
|
+
|
|
85
|
+
/* インラインコード */
|
|
86
|
+
code {{
|
|
87
|
+
font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
|
|
88
|
+
font-size: 0.87em;
|
|
89
|
+
background: var(--code-bg);
|
|
90
|
+
border: 1px solid var(--border);
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
padding: 1px 5px;
|
|
93
|
+
}}
|
|
94
|
+
|
|
95
|
+
/* コードブロックのラッパー */
|
|
96
|
+
pre {{
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
margin: 1.2em 0;
|
|
100
|
+
font-size: 0.88em;
|
|
101
|
+
line-height: 1.6;
|
|
102
|
+
position: relative;
|
|
103
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
|
|
104
|
+
}}
|
|
105
|
+
|
|
106
|
+
/* highlight.js のコードブロック
|
|
107
|
+
hljs クラスが highlight.js によって付与されるので
|
|
108
|
+
そちらで背景・文字色が決定される。padding のみ指定。 */
|
|
109
|
+
pre code.hljs {{
|
|
110
|
+
padding: 18px 22px;
|
|
111
|
+
background: none; /* pre 側と二重にしない */
|
|
112
|
+
font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
|
|
113
|
+
font-size: 1em;
|
|
114
|
+
}}
|
|
115
|
+
|
|
116
|
+
/* 未ハイライト時 (fallback) */
|
|
117
|
+
pre > code:not(.hljs) {{
|
|
118
|
+
display: block;
|
|
119
|
+
background: var(--code-bg);
|
|
120
|
+
border: 1px solid var(--border);
|
|
121
|
+
padding: 18px 22px;
|
|
122
|
+
font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
|
|
123
|
+
}}
|
|
124
|
+
|
|
125
|
+
/* 言語ラベル (右上に言語名を表示) */
|
|
126
|
+
pre[data-lang]::before {{
|
|
127
|
+
content: attr(data-lang);
|
|
128
|
+
position: absolute;
|
|
129
|
+
top: 0;
|
|
130
|
+
right: 0;
|
|
131
|
+
font-size: 0.72rem;
|
|
132
|
+
font-family: 'SFMono-Regular', 'Consolas', monospace;
|
|
133
|
+
color: #888;
|
|
134
|
+
background: rgba(255,255,255,0.75);
|
|
135
|
+
padding: 2px 10px;
|
|
136
|
+
border-radius: 0 8px 0 6px;
|
|
137
|
+
letter-spacing: 0.05em;
|
|
138
|
+
text-transform: lowercase;
|
|
139
|
+
pointer-events: none;
|
|
140
|
+
}}
|
|
141
|
+
|
|
142
|
+
.katex-display {{
|
|
143
|
+
margin: 1.2em 0;
|
|
144
|
+
overflow-x: auto;
|
|
145
|
+
padding: 6px 0;
|
|
146
|
+
}}
|
|
147
|
+
|
|
148
|
+
hr {{
|
|
149
|
+
border: none;
|
|
150
|
+
border-top: 1px solid var(--border);
|
|
151
|
+
margin: 2.5em 0;
|
|
152
|
+
}}
|
|
153
|
+
|
|
154
|
+
table {{
|
|
155
|
+
border-collapse: collapse;
|
|
156
|
+
width: 100%;
|
|
157
|
+
margin: 1.2em 0;
|
|
158
|
+
font-size: 0.95em;
|
|
159
|
+
}}
|
|
160
|
+
|
|
161
|
+
th, td {{
|
|
162
|
+
border: 1px solid var(--border);
|
|
163
|
+
padding: 8px 14px;
|
|
164
|
+
text-align: left;
|
|
165
|
+
}}
|
|
166
|
+
|
|
167
|
+
th {{
|
|
168
|
+
background: var(--accent-light);
|
|
169
|
+
color: var(--accent);
|
|
170
|
+
font-weight: bold;
|
|
171
|
+
}}
|
|
172
|
+
|
|
173
|
+
blockquote {{
|
|
174
|
+
border-left: 3px solid var(--accent);
|
|
175
|
+
background: var(--accent-light);
|
|
176
|
+
margin: 1em 0;
|
|
177
|
+
padding: 10px 16px;
|
|
178
|
+
border-radius: 0 6px 6px 0;
|
|
179
|
+
}}
|
|
180
|
+
|
|
181
|
+
a {{ color: var(--accent); }}
|
|
182
|
+
|
|
183
|
+
.header-bar {{
|
|
184
|
+
background: var(--accent);
|
|
185
|
+
color: white;
|
|
186
|
+
border-radius: 8px;
|
|
187
|
+
padding: 22px 28px;
|
|
188
|
+
margin-bottom: 2.5em;
|
|
189
|
+
}}
|
|
190
|
+
|
|
191
|
+
.header-bar .main-title {{
|
|
192
|
+
font-size: 1.4rem;
|
|
193
|
+
font-weight: bold;
|
|
194
|
+
margin: 0 0 4px;
|
|
195
|
+
}}
|
|
196
|
+
|
|
197
|
+
.header-bar .subtitle {{
|
|
198
|
+
font-size: 0.88rem;
|
|
199
|
+
opacity: 0.8;
|
|
200
|
+
}}
|
|
201
|
+
</style>
|
|
202
|
+
</head>
|
|
203
|
+
<body>
|
|
204
|
+
|
|
205
|
+
{header_html}
|
|
206
|
+
|
|
207
|
+
{body_html}
|
|
208
|
+
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|
|
@@ -7,7 +7,7 @@ import ezpip
|
|
|
7
7
|
with ezpip.packager(develop_dir = "./_develop_markdawn/") as p:
|
|
8
8
|
setup(
|
|
9
9
|
name = "markdawn",
|
|
10
|
-
version = "0.
|
|
10
|
+
version = "0.3.0",
|
|
11
11
|
description = "A tool that converts markdown containing mathematical formulas into HTML as beautiful as dawn",
|
|
12
12
|
author = "bib_inf",
|
|
13
13
|
author_email = "contact.bibinf@gmail.com",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
markdawn
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|