docnest 0.1.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.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +83 -0
  5. package/dist/config.d.ts +36 -0
  6. package/dist/config.js +79 -0
  7. package/dist/server.d.ts +20 -0
  8. package/dist/server.js +814 -0
  9. package/package.json +60 -0
  10. package/server/favicon.ico +0 -0
  11. package/server/static/css/highlight.css +72 -0
  12. package/server/static/css/styles.css +5762 -0
  13. package/server/static/favicon.ico +0 -0
  14. package/server/static/img/404-deep-space-light.webp +0 -0
  15. package/server/static/img/404-deep-space.webp +0 -0
  16. package/server/static/js/core/doc-client-nav.js +260 -0
  17. package/server/static/js/core/doc-pdf-export.js +579 -0
  18. package/server/static/js/core/mermaid-init.js +36 -0
  19. package/server/static/js/core/sidebar.js +141 -0
  20. package/server/static/js/core/theme.js +138 -0
  21. package/server/static/js/diagram/diagram-controls.js +90 -0
  22. package/server/static/js/diagram/diagram-download.js +594 -0
  23. package/server/static/js/diagram/diagram-drag.js +157 -0
  24. package/server/static/js/diagram/diagram-viewer.js +405 -0
  25. package/server/static/js/diagram/diagram-zoom.js +67 -0
  26. package/server/static/js/utils/app.js +14 -0
  27. package/server/static/js/utils/modal-stack.js +33 -0
  28. package/server/views/dir.ejs +142 -0
  29. package/server/views/doc.ejs +483 -0
  30. package/server/views/index.ejs +77 -0
  31. package/server/views/not-found.ejs +57 -0
  32. package/server/views/partials/breadcrumbs.ejs +15 -0
  33. package/server/views/partials/diagram-viewer.ejs +16 -0
  34. package/server/views/partials/header.ejs +37 -0
  35. package/server/views/partials/sidebar.ejs +19 -0
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "docnest",
3
+ "version": "0.1.0",
4
+ "description": "可复用的本地 Markdown 文档中心",
5
+ "type": "commonjs",
6
+ "bin": {
7
+ "docnest": "dist/cli.js"
8
+ },
9
+ "exports": {
10
+ "./config": "./dist/config.js",
11
+ "./server": "./dist/server.js",
12
+ ".": "./dist/config.js"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "server/favicon.ico",
17
+ "server/static/css",
18
+ "server/static/favicon.ico",
19
+ "server/static/img/404-deep-space-light.webp",
20
+ "server/static/img/404-deep-space.webp",
21
+ "server/static/js",
22
+ "server/views"
23
+ ],
24
+ "engines": {
25
+ "node": ">=20"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.json",
29
+ "dev": "tsx src/cli.ts serve",
30
+ "start": "node dist/cli.js serve",
31
+ "test": "npm run build && node --test",
32
+ "pack:check": "npm run build && npm pack --dry-run",
33
+ "prepublishOnly": "npm run pack:check"
34
+ },
35
+ "keywords": [
36
+ "markdown",
37
+ "documentation",
38
+ "mermaid",
39
+ "docs-server"
40
+ ],
41
+ "license": "MIT",
42
+ "dependencies": {
43
+ "chokidar": "^3.5.3",
44
+ "dompurify": "^3.2.7",
45
+ "ejs": "^3.1.9",
46
+ "express": "^4.18.2",
47
+ "github-markdown-css": "^5.8.1",
48
+ "highlight.js": "^11.9.0",
49
+ "html2canvas": "^1.4.1",
50
+ "jspdf": "^2.5.1",
51
+ "markdown-it": "^14.0.0",
52
+ "mermaid": "^10.9.5",
53
+ "socket.io": "^4.7.2"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^22.10.0",
57
+ "tsx": "^4.19.2",
58
+ "typescript": "^5.7.2"
59
+ }
60
+ }
Binary file
@@ -0,0 +1,72 @@
1
+ /* GitHub 风格的代码高亮样式 */
2
+ .hljs {
3
+ display: block;
4
+ overflow-x: auto;
5
+ padding: 0.5em;
6
+ color: #24292e;
7
+ background: #f6f8fa;
8
+ }
9
+
10
+ .hljs-comment,
11
+ .hljs-quote {
12
+ color: #6a737d;
13
+ font-style: italic;
14
+ }
15
+
16
+ .hljs-keyword,
17
+ .hljs-selector-tag,
18
+ .hljs-type {
19
+ color: #d73a49;
20
+ }
21
+
22
+ .hljs-string,
23
+ .hljs-literal,
24
+ .hljs-number {
25
+ color: #032f62;
26
+ }
27
+
28
+ .hljs-title,
29
+ .hljs-section,
30
+ .hljs-attribute {
31
+ color: #6f42c1;
32
+ }
33
+
34
+ .hljs-variable,
35
+ .hljs-template-variable {
36
+ color: #e36209;
37
+ }
38
+
39
+ .hljs-regexp,
40
+ .hljs-link {
41
+ color: #032f62;
42
+ }
43
+
44
+ .hljs-symbol,
45
+ .hljs-bullet {
46
+ color: #005cc5;
47
+ }
48
+
49
+ .hljs-built_in,
50
+ .hljs-builtin-name {
51
+ color: #005cc5;
52
+ }
53
+
54
+ .hljs-meta {
55
+ color: #6a737d;
56
+ }
57
+
58
+ .hljs-deletion {
59
+ background: #ffeef0;
60
+ }
61
+
62
+ .hljs-addition {
63
+ background: #f0fff4;
64
+ }
65
+
66
+ .hljs-emphasis {
67
+ font-style: italic;
68
+ }
69
+
70
+ .hljs-strong {
71
+ font-weight: bold;
72
+ }