md-lv 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -19,12 +19,12 @@ A lightweight local server that renders Markdown files as beautiful HTML pages,
19
19
  ## Installation
20
20
 
21
21
  ```bash
22
- npm install -g markdown-viewer
22
+ npm install -g md-lv
23
23
  ```
24
24
 
25
25
  Or use npx:
26
26
  ```bash
27
- npx markdown-viewer
27
+ npx md-lv
28
28
  ```
29
29
 
30
30
  ## Usage
@@ -33,16 +33,16 @@ npx markdown-viewer
33
33
 
34
34
  ```bash
35
35
  # Serve current directory
36
- mdv
36
+ mdlv
37
37
 
38
38
  # Serve specific directory
39
- mdv --dir /path/to/docs
39
+ mdlv --dir /path/to/docs
40
40
 
41
41
  # Serve on custom port
42
- mdv --port 8080
42
+ mdlv --port 8080
43
43
 
44
44
  # Open README.md automatically
45
- mdv readme
45
+ mdlv readme
46
46
  ```
47
47
 
48
48
  ### CLI Options
@@ -58,13 +58,13 @@ mdv readme
58
58
 
59
59
  ### Subcommands
60
60
 
61
- #### `mdv readme`
61
+ #### `mdlv readme`
62
62
 
63
63
  Find and display the nearest README.md file:
64
64
 
65
65
  ```bash
66
66
  cd /path/to/project
67
- mdv readme
67
+ mdlv readme
68
68
  ```
69
69
 
70
70
  This command searches up the directory tree to find README.md and opens it in your browser.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-lv",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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
- "mdv": "bin/mdv.js"
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/mdv.js",
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: 'default',
92
+ theme: mermaidTheme,
89
93
  securityLevel: 'loose',
90
94
  flowchart: {
91
95
  useMaxWidth: true,
@@ -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('mdv readme')
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('mdv')
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)
@@ -15,7 +15,7 @@ const LOG_LEVELS = {
15
15
  class Logger {
16
16
  constructor(level = 'INFO') {
17
17
  this.level = LOG_LEVELS[level.toUpperCase()] ?? LOG_LEVELS.INFO;
18
- this.prefix = '[mdv]';
18
+ this.prefix = '[mdlv]';
19
19
  }
20
20
 
21
21
  /**
File without changes