@imontene/mdrender 2.8.1 → 2.10.0
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.
- package/CHANGELOG.md +23 -0
- package/README.md +102 -44
- package/dist/assets/theme-tech-magazine-dark.css +19 -0
- package/dist/assets/theme-tech-magazine.css +535 -0
- package/dist/assets.d.ts +19 -0
- package/dist/assets.js +48 -2
- package/dist/cli.js +2 -2
- package/dist/convert.js +47 -13
- package/dist/markdown/hyphenate.js +7 -3
- package/dist/options.d.ts +18 -1
- package/dist/options.js +43 -1
- package/dist/render/fonts.d.ts +4 -0
- package/dist/render/fonts.js +12 -1
- package/dist/render/header-footer.d.ts +2 -0
- package/dist/render/header-footer.js +1 -1
- package/dist/render/magazine.d.ts +48 -0
- package/dist/render/magazine.js +211 -0
- package/dist/render/page.d.ts +2 -0
- package/dist/render/page.js +5 -0
- package/dist/render/template.d.ts +3 -1
- package/dist/render/template.js +10 -3
- package/package.json +4 -2
- package/tech_magazine/AlphaZeroChess/cover01.png +0 -0
- package/tech_magazine/AlphaZeroChess/cover02.png +0 -0
- package/tech_magazine/AlphaZeroChess/cover03.png +0 -0
- package/tech_magazine/AlphaZeroChess/cover04.png +0 -0
- package/tech_magazine/AlphaZeroChess/magazine.json +9 -0
package/dist/render/template.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readTextAsset } from "../assets.js";
|
|
2
2
|
import { escapeHtml } from "../html.js";
|
|
3
3
|
import { DEFAULT_LANG, strings } from "../i18n.js";
|
|
4
|
-
import { fontFaceCss, serifFontFaceCss } from "./fonts.js";
|
|
4
|
+
import { fontFaceCss, magazineFontFaceCss, serifFontFaceCss } from "./fonts.js";
|
|
5
|
+
import { isMagazineTheme } from "../options.js";
|
|
5
6
|
import { katexCss } from "./katex.js";
|
|
6
7
|
import { version } from "../version.js";
|
|
7
8
|
export { escapeHtml };
|
|
@@ -21,11 +22,17 @@ const THEME_FILES = {
|
|
|
21
22
|
light: ["theme.css"],
|
|
22
23
|
dark: ["theme.css", "theme-dark.css"],
|
|
23
24
|
academic_basic: ["theme.css", "theme-academic-basic.css"],
|
|
25
|
+
tech_magazine: ["theme.css", "theme-tech-magazine.css"],
|
|
26
|
+
"tech_magazine-dark": ["theme.css", "theme-tech-magazine.css", "theme-tech-magazine-dark.css"],
|
|
24
27
|
};
|
|
25
28
|
/** Stylesheets of a built-in theme, with the fonts it adds to the text and code ones. */
|
|
26
29
|
export function builtinThemeCss(theme) {
|
|
27
30
|
const css = THEME_FILES[theme].map(asset);
|
|
28
|
-
|
|
31
|
+
if (theme === "academic_basic")
|
|
32
|
+
return [serifFontFaceCss(), ...css];
|
|
33
|
+
if (isMagazineTheme(theme))
|
|
34
|
+
return [magazineFontFaceCss(), ...css];
|
|
35
|
+
return css;
|
|
29
36
|
}
|
|
30
37
|
/** Stylesheet for a density other than "normal", applied after the theme. */
|
|
31
38
|
export function densityCss(density) {
|
|
@@ -47,7 +54,7 @@ function titleBlock(parts) {
|
|
|
47
54
|
const meta = [author ? withSuperscripts(author) : undefined, date ? escapeHtml(date) : undefined];
|
|
48
55
|
const metaText = meta.filter(Boolean).join(" · ");
|
|
49
56
|
return [
|
|
50
|
-
`<header class="doc-header">`,
|
|
57
|
+
`<header class="doc-header${parts.headerClass ? ` ${escapeHtml(parts.headerClass)}` : ""}">`,
|
|
51
58
|
kicker ? `<p class="doc-kicker">${escapeHtml(kicker)}</p>` : "",
|
|
52
59
|
`<h1 class="doc-title">${escapeHtml(title)}</h1>`,
|
|
53
60
|
subtitle ? `<p class="doc-subtitle">${escapeHtml(subtitle)}</p>` : "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imontene/mdrender",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Command-line app for Windows and Linux that renders Markdown — with LaTeX equations and Mermaid diagrams — to PDF and HTML set in Manrope or Inter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"!dist/**/*.map",
|
|
41
41
|
"README.md",
|
|
42
42
|
"LICENSE",
|
|
43
|
-
"CHANGELOG.md"
|
|
43
|
+
"CHANGELOG.md",
|
|
44
|
+
"tech_magazine"
|
|
44
45
|
],
|
|
45
46
|
"engines": {
|
|
46
47
|
"node": ">=22.12"
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"dependencies": {
|
|
68
69
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
69
70
|
"@fontsource/manrope": "^5.3.0",
|
|
71
|
+
"@fontsource/newsreader": "^5.3.0",
|
|
70
72
|
"@fontsource/stix-two-text": "^5.3.0",
|
|
71
73
|
"@puppeteer/browsers": "^3.2.3",
|
|
72
74
|
"chokidar": "^5.0.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accent": "#2f6bff",
|
|
3
|
+
"covers": {
|
|
4
|
+
"1": { "ink": "dark", "veil": "rgba(255, 255, 255, 0.6)" },
|
|
5
|
+
"2": { "ink": "light", "veil": "rgba(8, 14, 28, 0.85)" },
|
|
6
|
+
"3": { "ink": "dark", "veil": "rgba(246, 238, 228, 0.65)" },
|
|
7
|
+
"4": { "ink": "light", "veil": "rgba(20, 10, 4, 0.65)" }
|
|
8
|
+
}
|
|
9
|
+
}
|