md-lv 1.0.0 → 1.0.1
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/package.json +3 -3
- package/public/js/app.js +5 -1
- package/public/styles/modern.css +8 -0
- package/src/cli.js +2 -2
- package/src/utils/logger.js +1 -1
- /package/bin/{mdv.js → mdlv.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "md-lv",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Serve Markdown files as HTML with live features - syntax highlighting, Mermaid diagrams, and MathJax formulas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "src/index.js",
|
|
10
10
|
"bin": {
|
|
11
|
-
"
|
|
11
|
+
"mdlv": "bin/mdlv.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin/",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"CHANGELOG.md"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"start": "node bin/
|
|
23
|
+
"start": "node bin/mdlv.js",
|
|
24
24
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
25
25
|
"test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js tests/unit",
|
|
26
26
|
"test:integration": "node --experimental-vm-modules node_modules/jest/bin/jest.js tests/integration",
|
package/public/js/app.js
CHANGED
|
@@ -82,10 +82,14 @@ async function renderMermaid() {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
try {
|
|
85
|
+
// ダークモードを検出してテーマを決定
|
|
86
|
+
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
87
|
+
const mermaidTheme = isDarkMode ? 'dark' : 'default';
|
|
88
|
+
|
|
85
89
|
// Mermaid を初期化(まだ初期化されていない場合)
|
|
86
90
|
window.mermaid.initialize({
|
|
87
91
|
startOnLoad: false,
|
|
88
|
-
theme:
|
|
92
|
+
theme: mermaidTheme,
|
|
89
93
|
securityLevel: 'loose',
|
|
90
94
|
flowchart: {
|
|
91
95
|
useMaxWidth: true,
|
package/public/styles/modern.css
CHANGED
|
@@ -194,16 +194,24 @@ table {
|
|
|
194
194
|
overflow: hidden;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
table th,
|
|
198
|
+
table td {
|
|
199
|
+
border-color: var(--color-border);
|
|
200
|
+
}
|
|
201
|
+
|
|
197
202
|
table th {
|
|
198
203
|
background-color: var(--color-bg-secondary);
|
|
204
|
+
color: var(--color-text);
|
|
199
205
|
}
|
|
200
206
|
|
|
201
207
|
table tr {
|
|
208
|
+
background-color: var(--color-bg);
|
|
202
209
|
border-top: 1px solid var(--color-border);
|
|
203
210
|
}
|
|
204
211
|
|
|
205
212
|
table tr:nth-child(2n) {
|
|
206
213
|
background-color: var(--color-bg-secondary);
|
|
214
|
+
color: var(--color-text);
|
|
207
215
|
}
|
|
208
216
|
|
|
209
217
|
/* ============================================
|
package/src/cli.js
CHANGED
|
@@ -32,7 +32,7 @@ export function parseCLI(argv) {
|
|
|
32
32
|
if (isReadmeCommand) {
|
|
33
33
|
// Parse readme subcommand with its options
|
|
34
34
|
program
|
|
35
|
-
.name('
|
|
35
|
+
.name('mdlv readme')
|
|
36
36
|
.description('Find and display the nearest README.md')
|
|
37
37
|
.option('-p, --port <number>', 'Server port', validatePort, 3000);
|
|
38
38
|
|
|
@@ -75,7 +75,7 @@ export function parseCLI(argv) {
|
|
|
75
75
|
|
|
76
76
|
// Default: parse as regular server options
|
|
77
77
|
program
|
|
78
|
-
.name('
|
|
78
|
+
.name('mdlv')
|
|
79
79
|
.description('Serve Markdown files as HTML')
|
|
80
80
|
.version('2.0.0')
|
|
81
81
|
.option('-p, --port <number>', 'Server port', validatePort, 3000)
|
package/src/utils/logger.js
CHANGED
/package/bin/{mdv.js → mdlv.js}
RENAMED
|
File without changes
|