colonynote 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/README.md +108 -65
- package/README.zh.md +106 -63
- package/dist/client/assets/{arc-Ezd9GmKE.js → arc-CQThWgzz.js} +1 -1
- package/dist/client/assets/architecture-YZFGNWBL-DtP_HzvZ.js +1 -0
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-BmLJotd1.js → architectureDiagram-Q4EWVU46-CduhJNdk.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-ZqrNO8HM.js → blockDiagram-DXYQGD6D-Bge_LBJ4.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-BJWyymhT.js → c4Diagram-AHTNJAMY-CIoq2al4.js} +1 -1
- package/dist/client/assets/channel-CkBCwOh7.js +1 -0
- package/dist/client/assets/{chunk-2KRD3SAO-B1G2AY6H.js → chunk-2KRD3SAO-DWEU0E2x.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-mLNpdiNK.js → chunk-4BX2VUAB-D9btov2c.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-BsRi3qra.js → chunk-4TB4RGXK-CWGCiPPE.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-BkCqG_Mc.js → chunk-55IACEB6-Bko5tMmv.js} +1 -1
- package/dist/client/assets/{chunk-67CJDMHE-Cz-mqdi4.js → chunk-67CJDMHE-BNJbWbd3.js} +1 -1
- package/dist/client/assets/{chunk-7N4EOEYR-BFd0Oy6w.js → chunk-7N4EOEYR-BZ6bA78p.js} +1 -1
- package/dist/client/assets/{chunk-AA7GKIK3-D77gJjH7.js → chunk-AA7GKIK3-Dpen34JB.js} +1 -1
- package/dist/client/assets/{chunk-CIAEETIT-DxQTGSBH.js → chunk-CIAEETIT-CyiIj1js.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-DglU8MxC.js → chunk-EDXVE4YY-DIUgGcqH.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-B_1_v8GP.js → chunk-FMBD7UC4-CRj4bnZr.js} +1 -1
- package/dist/client/assets/{chunk-FOC6F5B3-CEMl5H_U.js → chunk-FOC6F5B3-BL67Wbz_.js} +1 -1
- package/dist/client/assets/{chunk-K5T4RW27-Dzh5Xx8O.js → chunk-K5T4RW27-C8czLGM6.js} +1 -1
- package/dist/client/assets/{chunk-KGLVRYIC-Be2dMs_W.js → chunk-KGLVRYIC-DMMvz8yi.js} +1 -1
- package/dist/client/assets/{chunk-LIHQZDEY-BGBWPKdn.js → chunk-LIHQZDEY-CJaus4QW.js} +1 -1
- package/dist/client/assets/{chunk-ORNJ4GCN-W_NT507t.js → chunk-ORNJ4GCN-TM5MkxJb.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-BV6RCL_j.js → chunk-OYMX7WX6-DZJR2tbT.js} +1 -1
- package/dist/client/assets/chunk-QZHKN3VN-2Ges7DwK.js +1 -0
- package/dist/client/assets/{chunk-YZCP3GAM-CDitFgw3.js → chunk-YZCP3GAM-P9O7utk9.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-ChQeyBcv.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BALSptE2.js +1 -0
- package/dist/client/assets/clone-D3BIJwxV.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-YQtZwRYb.js → cose-bilkent-S5V4N54A-BaWITYex.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-DvMqAy8J.js → dagre-KV5264BT-BR2SAWWM.js} +1 -1
- package/dist/client/assets/{dagre-Cs_hK0RA.js → dagre-wVYwri9O.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-BwrN8bUG.js → diagram-5BDNPKRD-D-6-Gum5.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-Cqaj-jnn.js → diagram-G4DWMVQ6-knal8ynW.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-DNA312HK.js → diagram-MMDJMWI5-Cq28VT9h.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-BujcYOHW.js → diagram-TYMM5635-_ahIpIbu.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-ZjZZH-zN.js → erDiagram-SMLLAGMA-DWWpmrCX.js} +1 -1
- package/dist/client/assets/{flatten-DA7ZzNkq.js → flatten-CMqdPloh.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-CeIGHswO.js → flowDiagram-DWJPFMVM-QgTx1hit.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-BeGMFmHq.js → ganttDiagram-T4ZO3ILL-BrlOV7sd.js} +1 -1
- package/dist/client/assets/gitGraph-7Q5UKJZL-CaJwRPFW.js +1 -0
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-2fnUKQRp.js → gitGraphDiagram-UUTBAWPF-C1hAcDJi.js} +1 -1
- package/dist/client/assets/{graphlib-DRri47Ms.js → graphlib-HzYvs4aA.js} +1 -1
- package/dist/client/assets/{index-Ts5WhtRB.js → index-C9TyPVfK.js} +143 -143
- package/dist/client/assets/index-ZllE5QRx.css +2 -0
- package/dist/client/assets/info-OMHHGYJF-DsnC4r6b.js +1 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-KL_uq6JQ.js → infoDiagram-42DDH7IO-CaDp7AXt.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DYWG2VdA.js → ishikawaDiagram-UXIWVN3A-rIk_ch8r.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-DT7IVz7z.js → journeyDiagram-VCZTEJTY-AKlpEShH.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-CHPPLj8n.js → kanban-definition-6JOO6SKY-DG7E5YsZ.js} +1 -1
- package/dist/client/assets/{linear-CizMozZt.js → linear-BhtBzbUW.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-Bpqvb2jv.js → mermaid-parser.core-C5TKoM7K.js} +2 -2
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-Dov77gi8.js → mindmap-definition-QFDTVHPH-DJ__gZG0.js} +1 -1
- package/dist/client/assets/packet-4T2RLAQJ-B7X34Q_f.js +1 -0
- package/dist/client/assets/pie-ZZUOXDRM-BfvCWICT.js +1 -0
- package/dist/client/assets/{pieDiagram-DEJITSTG-DwmqzTu7.js → pieDiagram-DEJITSTG-MP7sf0Hn.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CdCBXbvb.js → quadrantDiagram-34T5L4WZ-C5-YkrxD.js} +1 -1
- package/dist/client/assets/radar-PYXPWWZC-BQu_7Ie9.js +1 -0
- package/dist/client/assets/{reduce-DV5GRzs4.js → reduce-Cb52axiO.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-32eCbPFl.js → requirementDiagram-MS252O5E-CA27k-YW.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-BBDL_wPZ.js → sankeyDiagram-XADWPNL6-DXKCqxys.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-Ck7ukfb7.js → sequenceDiagram-FGHM5R23-DgqvjCb6.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-BKJrixhp.js → stateDiagram-FHFEXIEX-CLQg0ba3.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BojxKOV4.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-B_D-q7Kc.js → timeline-definition-GMOUNBTQ-CeOHNNzc.js} +1 -1
- package/dist/client/assets/treeView-SZITEDCU-9OOXnf4D.js +1 -0
- package/dist/client/assets/treemap-W4RFUUIX-BdE-jrpA.js +1 -0
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CvHqv3h2.js → vennDiagram-DHZGUBPP-b_x_2tJx.js} +1 -1
- package/dist/client/assets/wardley-RL74JXVD-Tmb0J3Ps.js +1 -0
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-CYRpN4xk.js → wardleyDiagram-NUSXRM2D-C8WSLFLG.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-Dh0MaaMp.js → xychartDiagram-5P7HB3ND-CLRgesgk.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/api.js +63 -6
- package/package.json +1 -1
- package/dist/client/assets/architecture-YZFGNWBL-Dns9u0e5.js +0 -1
- package/dist/client/assets/channel-C-zEXS3V.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-B0CMV9NG.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-XeqY_hie.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-D5yY32qd.js +0 -1
- package/dist/client/assets/clone-AnN0418d.js +0 -1
- package/dist/client/assets/gitGraph-7Q5UKJZL-Dib3-KZp.js +0 -1
- package/dist/client/assets/index-DKyd5iCm.css +0 -2
- package/dist/client/assets/info-OMHHGYJF-oQ5--hGK.js +0 -1
- package/dist/client/assets/packet-4T2RLAQJ-Cuyyn0tM.js +0 -1
- package/dist/client/assets/pie-ZZUOXDRM-DajTPYmY.js +0 -1
- package/dist/client/assets/radar-PYXPWWZC-DWe78GFc.js +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Bio1QBYF.js +0 -1
- package/dist/client/assets/treeView-SZITEDCU-BQ27_5HI.js +0 -1
- package/dist/client/assets/treemap-W4RFUUIX-D2TpEq--.js +0 -1
- package/dist/client/assets/wardley-RL74JXVD-DoAmhKVb.js +0 -1
package/README.md
CHANGED
|
@@ -1,120 +1,163 @@
|
|
|
1
|
+
<img src="public/logo.png" alt="ColonyNote" width="120">
|
|
2
|
+
|
|
1
3
|
# ColonyNote
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**A modern Markdown online editor with real-time preview.**
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Edit server-side Markdown files directly in your browser — no upload, no download, just open and write.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
[简体中文](README.zh.md) · English
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
---
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
- **Real-time Preview** - Live rendering as you type
|
|
13
|
-
- **Mermaid Support** - Render flowcharts, sequence diagrams, Gantt charts, and more
|
|
14
|
-
- **LaTeX Formulas** - Full support for mathematical expressions
|
|
15
|
-
- **Code Highlighting** - Syntax highlighting for various programming languages
|
|
16
|
-
- **Dark Theme** - Follow system preference or manual toggle
|
|
17
|
-
- **Mobile Friendly** - Responsive design optimized for mobile devices
|
|
18
|
-
- **Real-time Sync** - WebSocket-based file change notifications
|
|
13
|
+
## Screenshots
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
<table style="min-width: 50px;">
|
|
16
|
+
<colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><img src="screenshots/light-editor.png" alt="Light Theme Editor" width="100%"></td><td colspan="1" rowspan="1"><img src="screenshots/dark-editor.png" alt="Dark Theme Editor" width="100%"></td></tr><tr><td colspan="1" rowspan="1" style="text-align: center;"><p>Light Theme</p></td><td colspan="1" rowspan="1" style="text-align: center;"><p>Dark Theme</p></td></tr><tr><td colspan="1" rowspan="1"><img src="screenshots/search.png" alt="Full-text Search" width="100%"></td><td colspan="1" rowspan="1"><img src="screenshots/mobile-editor.png" alt="Mobile Editor" width="100%"></td></tr><tr><td colspan="1" rowspan="1" style="text-align: center;"><p>Full-text Search</p></td><td colspan="1" rowspan="1" style="text-align: center;"><p>Mobile Editor</p></td></tr></tbody>
|
|
17
|
+
</table>
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Server-side Editing** — Edit Markdown files on your server directly in the browser. No file upload or download needed.
|
|
22
|
+
- **WYSIWYG + Source Mode** — Switch between rich text editing and raw Markdown source with one click.
|
|
23
|
+
- **Real-time Preview** — Live rendering as you type, powered by TipTap 3.
|
|
24
|
+
- **Mermaid Diagrams** — Render flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, and user journey maps.
|
|
25
|
+
- **LaTeX Math** — Full support for mathematical expressions via KaTeX.
|
|
26
|
+
- **Code Highlighting** — Syntax highlighting for 15+ programming languages with copy-to-clipboard.
|
|
27
|
+
- **Full-text Search** — Search across all your documents with ripgrep-powered fuzzy matching.
|
|
28
|
+
- **Multi-directory Support** — Manage multiple document directories simultaneously, each with its own file tree.
|
|
29
|
+
- **Multi-tab** — Open multiple files in tabs, with dirty-state indicators and auto-save.
|
|
30
|
+
- **Real-time Sync** — WebSocket-based file change notifications keep all connected clients in sync.
|
|
31
|
+
- **External Change Detection** — Automatically detect and handle file changes from outside the editor.
|
|
32
|
+
- **Dark / Light / System Theme** — Choose your preferred theme or follow the system setting.
|
|
33
|
+
- **Mobile-first Design** — Optimized for mobile devices with responsive layout and touch-friendly interactions.
|
|
25
34
|
|
|
26
|
-
##
|
|
35
|
+
## Quick Start
|
|
27
36
|
|
|
28
|
-
###
|
|
37
|
+
### Install
|
|
29
38
|
|
|
30
39
|
```bash
|
|
31
|
-
colonynote
|
|
40
|
+
npm install -g colonynote
|
|
32
41
|
```
|
|
33
42
|
|
|
34
|
-
###
|
|
35
|
-
|
|
36
|
-
| Option | Alias | Description | Default |
|
|
37
|
-
|--------|-------|-------------|---------|
|
|
38
|
-
| `--dir` | `-d` | Directory for documents | Current directory |
|
|
39
|
-
| `--port` | `-p` | Server port | `5787` |
|
|
40
|
-
| `--host` | | Server host | `0.0.0.0` |
|
|
41
|
-
| `--config` | `-c` | Config file path | `colonynote.config.js` |
|
|
42
|
-
| `--help` | `-h` | Show help | |
|
|
43
|
-
| `--version` | | Show version | |
|
|
44
|
-
|
|
45
|
-
### Examples
|
|
43
|
+
### Start
|
|
46
44
|
|
|
47
45
|
```bash
|
|
48
|
-
# Start with
|
|
46
|
+
# Start with current directory
|
|
49
47
|
colonynote
|
|
50
48
|
|
|
51
|
-
# Specify directory
|
|
49
|
+
# Specify a directory
|
|
52
50
|
colonynote -d /path/to/docs
|
|
53
51
|
|
|
52
|
+
# Specify multiple directories
|
|
53
|
+
colonynote -d ./docs -d ./notes
|
|
54
|
+
|
|
54
55
|
# Specify port
|
|
55
56
|
colonynote -p 3000
|
|
56
57
|
|
|
57
|
-
#
|
|
58
|
-
colonynote
|
|
59
|
-
|
|
60
|
-
# Combine options
|
|
61
|
-
colonynote -d ./docs -p 8080
|
|
58
|
+
# Specify host
|
|
59
|
+
colonynote --host 127.0.0.1
|
|
62
60
|
```
|
|
63
61
|
|
|
62
|
+
Then open `http://localhost:5787` in your browser.
|
|
63
|
+
|
|
64
|
+
### CLI Options
|
|
65
|
+
|
|
66
|
+
| Option | Alias | Description | Default |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `--dir` | `-d` | Root directory (can be specified multiple times) | Current directory |
|
|
69
|
+
| `--port` | `-p` | Server port | `5787` |
|
|
70
|
+
| `--host` | | Server host | `0.0.0.0` |
|
|
71
|
+
|
|
64
72
|
## Configuration
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
ColonyNote reads configuration from `~/.colonynote/config.json` (production) or `~/.colonynote/config.dev.json` (development).
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
Create the config file manually:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"dirs": [
|
|
81
|
+
{ "path": "/path/to/docs", "name": "Docs" }
|
|
82
|
+
],
|
|
83
|
+
"allowedExtensions": [".md", ".markdown", ".mdown", ".mkdn"],
|
|
84
|
+
"showHiddenFiles": false,
|
|
85
|
+
"theme": {
|
|
86
|
+
"default": "system"
|
|
76
87
|
},
|
|
77
|
-
editor: {
|
|
78
|
-
autosave: true,
|
|
79
|
-
debounceMs: 300
|
|
88
|
+
"editor": {
|
|
89
|
+
"autosave": true,
|
|
90
|
+
"debounceMs": 300
|
|
80
91
|
},
|
|
92
|
+
"ignore": {
|
|
93
|
+
"patterns": [
|
|
94
|
+
"node_modules",
|
|
95
|
+
".git",
|
|
96
|
+
".next",
|
|
97
|
+
"dist",
|
|
98
|
+
"build"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
81
101
|
}
|
|
82
102
|
```
|
|
83
103
|
|
|
104
|
+
The configuration is automatically reloaded when the file changes — no server restart needed.
|
|
105
|
+
|
|
106
|
+
### Configuration Fields
|
|
107
|
+
|
|
108
|
+
| Field | Type | Description |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `dirs` | `Array<{path, name?, exclude?}>` | Document directories to serve |
|
|
111
|
+
| `allowedExtensions` | `string[]` | File extensions to show in the file tree |
|
|
112
|
+
| `showHiddenFiles` | `boolean` | Whether to show dotfiles |
|
|
113
|
+
| `theme.default` | \`"light" | "dark" |
|
|
114
|
+
| `editor.autosave` | `boolean` | Enable auto-save |
|
|
115
|
+
| `editor.debounceMs` | `number` | Auto-save debounce delay in milliseconds |
|
|
116
|
+
| `ignore.patterns` | `string[]` | Global ignore patterns (glob syntax) |
|
|
117
|
+
|
|
84
118
|
## Development
|
|
85
119
|
|
|
86
120
|
```bash
|
|
87
121
|
# Clone the repository
|
|
88
122
|
git clone https://github.com/opencolony/note.git
|
|
123
|
+
cd note
|
|
89
124
|
|
|
90
125
|
# Install dependencies
|
|
91
|
-
|
|
126
|
+
pnpm install
|
|
92
127
|
|
|
93
|
-
# Start development server (backend + frontend
|
|
94
|
-
|
|
128
|
+
# Start development server (backend + frontend hot reload)
|
|
129
|
+
pnpm dev
|
|
95
130
|
|
|
96
131
|
# Frontend only (Vite dev server, port 5787)
|
|
97
|
-
|
|
132
|
+
pnpm dev:frontend
|
|
98
133
|
|
|
99
134
|
# Backend only (Hono server, port 5788)
|
|
100
|
-
|
|
135
|
+
pnpm dev:backend
|
|
101
136
|
|
|
102
137
|
# Build for production
|
|
103
|
-
|
|
138
|
+
pnpm build
|
|
104
139
|
|
|
105
140
|
# Run production build
|
|
106
|
-
|
|
141
|
+
pnpm start
|
|
142
|
+
|
|
143
|
+
# Type check
|
|
144
|
+
pnpm typecheck
|
|
145
|
+
|
|
146
|
+
# Run tests
|
|
147
|
+
pnpm test
|
|
107
148
|
```
|
|
108
149
|
|
|
109
150
|
## Tech Stack
|
|
110
151
|
|
|
111
|
-
- **Backend**: Hono
|
|
112
|
-
- **Frontend**: React 18
|
|
113
|
-
- **UI Components**: shadcn/ui (Radix UI)
|
|
114
|
-
- **Editor**: TipTap 3
|
|
115
|
-
- **Diagrams**: Mermaid
|
|
116
|
-
- **
|
|
117
|
-
- **
|
|
152
|
+
- **Backend**: [Hono](https://hono.dev) + [@hono/node-server](https://github.com/honojs/node-server) + [ws](https://github.com/websockets/ws)
|
|
153
|
+
- **Frontend**: [React 18](https://react.dev) + [Vite](https://vitejs.dev) + [Tailwind CSS v4](https://tailwindcss.com)
|
|
154
|
+
- **UI Components**: [shadcn/ui](https://ui.shadcn.com) (based on [Radix UI](https://www.radix-ui.com))
|
|
155
|
+
- **Editor**: [TipTap 3](https://tiptap.dev) + [tiptap-markdown](https://github.com/aguingand/tiptap-markdown)
|
|
156
|
+
- **Diagrams**: [Mermaid](https://mermaid.js.org)
|
|
157
|
+
- **Math**: [KaTeX](https://katex.org)
|
|
158
|
+
- **Search**: ripgrep (server-side) + FlexSearch (client-side index)
|
|
159
|
+
- **Code Highlighting**: [lowlight](https://github.com/wooorm/lowlight)
|
|
160
|
+
- **Icons**: [lucide-react](https://lucide.dev)
|
|
118
161
|
|
|
119
162
|
## License
|
|
120
163
|
|
|
@@ -122,4 +165,4 @@ MIT
|
|
|
122
165
|
|
|
123
166
|
## Author
|
|
124
167
|
|
|
125
|
-
岳晓亮
|
|
168
|
+
岳晓亮 [hi@yuexiaoliang.com](mailto:hi@yuexiaoliang.com)
|
package/README.zh.md
CHANGED
|
@@ -1,120 +1,163 @@
|
|
|
1
|
+
<img src="public/logo.png" alt="ColonyNote" width="120">
|
|
2
|
+
|
|
1
3
|
# ColonyNote
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**支持实时预览的现代 Markdown 在线编辑器。**
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
直接在浏览器中编辑服务器上的 Markdown 文件 —— 无需上传下载,打开即写。
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
[English](README.md) · 简体中文
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
---
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
- **实时预览** - 实时渲染输入内容
|
|
13
|
-
- **Mermaid 支持** - 渲染流程图、时序图、甘特图等
|
|
14
|
-
- **LaTeX 公式** - 完整支持数学公式
|
|
15
|
-
- **代码高亮** - 支持多种编程语言的语法高亮
|
|
16
|
-
- **深色主题** - 跟随系统偏好或手动切换
|
|
17
|
-
- **移动端适配** - 响应式设计,适配移动设备
|
|
18
|
-
- **实时同步** - 基于 WebSocket 的文件变更通知
|
|
13
|
+
## 界面预览
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
<table style="min-width: 50px;">
|
|
16
|
+
<colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><img src="screenshots/light-editor.png" alt="浅色主题编辑器" width="100%"></td><td colspan="1" rowspan="1"><img src="screenshots/dark-editor.png" alt="深色主题编辑器" width="100%"></td></tr><tr><td colspan="1" rowspan="1" style="text-align: center;"><p>浅色主题</p></td><td colspan="1" rowspan="1" style="text-align: center;"><p>深色主题</p></td></tr><tr><td colspan="1" rowspan="1"><img src="screenshots/search.png" alt="全文搜索" width="100%"></td><td colspan="1" rowspan="1"><img src="screenshots/mobile-editor.png" alt="移动端编辑器" width="100%"></td></tr><tr><td colspan="1" rowspan="1" style="text-align: center;"><p>全文搜索</p></td><td colspan="1" rowspan="1" style="text-align: center;"><p>移动端编辑器</p></td></tr></tbody>
|
|
17
|
+
</table>
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
## 功能特性
|
|
20
|
+
|
|
21
|
+
- **服务端文件编辑** — 直接在浏览器中编辑服务器上的 Markdown 文件,无需上传下载。
|
|
22
|
+
- **所见即所得 + 源码模式** — 一键切换富文本编辑和原始 Markdown 源码。
|
|
23
|
+
- **实时预览** — 基于 TipTap 3,输入内容实时渲染。
|
|
24
|
+
- **Mermaid 图表** — 支持流程图、时序图、类图、状态图、ER 图、甘特图、饼图和用户旅程图。
|
|
25
|
+
- **LaTeX 数学公式** — 通过 KaTeX 完整支持数学公式渲染。
|
|
26
|
+
- **代码高亮** — 支持 15+ 编程语言的语法高亮,带一键复制功能。
|
|
27
|
+
- **全文搜索** — 基于 ripgrep 的模糊匹配搜索,快速定位文档内容。
|
|
28
|
+
- **多目录管理** — 同时管理多个文档目录,每个目录独立文件树。
|
|
29
|
+
- **多标签页** — 支持多文件标签页打开,带脏状态提示和自动保存。
|
|
30
|
+
- **实时同步** — 基于 WebSocket 的文件变更通知,多端保持同步。
|
|
31
|
+
- **外部变更检测** — 自动检测并处理编辑器外的文件修改。
|
|
32
|
+
- **深色 / 浅色 / 跟随系统** — 自由选择主题或跟随系统设置。
|
|
33
|
+
- **移动端优先** — 针对移动设备优化的响应式布局和触摸交互。
|
|
25
34
|
|
|
26
|
-
##
|
|
35
|
+
## 快速开始
|
|
27
36
|
|
|
28
|
-
###
|
|
37
|
+
### 安装
|
|
29
38
|
|
|
30
39
|
```bash
|
|
31
|
-
colonynote
|
|
40
|
+
npm install -g colonynote
|
|
32
41
|
```
|
|
33
42
|
|
|
34
|
-
###
|
|
35
|
-
|
|
36
|
-
| 选项 | 别名 | 描述 | 默认值 |
|
|
37
|
-
|------|------|------|--------|
|
|
38
|
-
| `--dir` | `-d` | 目录 | 当前目录 |
|
|
39
|
-
| `--port` | `-p` | 服务器端口 | `5787` |
|
|
40
|
-
| `--host` | | 服务器地址 | `0.0.0.0` |
|
|
41
|
-
| `--config` | `-c` | 配置文件路径 | `colonynote.config.js` |
|
|
42
|
-
| `--help` | `-h` | 显示帮助 | |
|
|
43
|
-
| `--version` | | 显示版本 | |
|
|
44
|
-
|
|
45
|
-
### 示例
|
|
43
|
+
### 启动
|
|
46
44
|
|
|
47
45
|
```bash
|
|
48
|
-
#
|
|
46
|
+
# 使用当前目录启动
|
|
49
47
|
colonynote
|
|
50
48
|
|
|
51
49
|
# 指定目录
|
|
52
50
|
colonynote -d /path/to/docs
|
|
53
51
|
|
|
52
|
+
# 指定多个目录
|
|
53
|
+
colonynote -d ./docs -d ./notes
|
|
54
|
+
|
|
54
55
|
# 指定端口
|
|
55
56
|
colonynote -p 3000
|
|
56
57
|
|
|
57
|
-
#
|
|
58
|
-
colonynote
|
|
59
|
-
|
|
60
|
-
# 组合选项
|
|
61
|
-
colonynote -d ./docs -p 8080
|
|
58
|
+
# 指定监听地址
|
|
59
|
+
colonynote --host 127.0.0.1
|
|
62
60
|
```
|
|
63
61
|
|
|
62
|
+
然后在浏览器中打开 `http://localhost:5787`。
|
|
63
|
+
|
|
64
|
+
### CLI 选项
|
|
65
|
+
|
|
66
|
+
| 选项 | 别名 | 描述 | 默认值 |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `--dir` | `-d` | 文档根目录(可多次指定) | 当前目录 |
|
|
69
|
+
| `--port` | `-p` | 服务器端口 | `5787` |
|
|
70
|
+
| `--host` | | 服务器监听地址 | `0.0.0.0` |
|
|
71
|
+
|
|
64
72
|
## 配置
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
ColonyNote 从 `~/.colonynote/config.json`(生产环境)或 `~/.colonynote/config.dev.json`(开发环境)读取配置。
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
手动创建配置文件:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"dirs": [
|
|
81
|
+
{ "path": "/path/to/docs", "name": "文档" }
|
|
82
|
+
],
|
|
83
|
+
"allowedExtensions": [".md", ".markdown", ".mdown", ".mkdn"],
|
|
84
|
+
"showHiddenFiles": false,
|
|
85
|
+
"theme": {
|
|
86
|
+
"default": "system"
|
|
76
87
|
},
|
|
77
|
-
editor: {
|
|
78
|
-
autosave: true,
|
|
79
|
-
debounceMs: 300
|
|
88
|
+
"editor": {
|
|
89
|
+
"autosave": true,
|
|
90
|
+
"debounceMs": 300
|
|
80
91
|
},
|
|
92
|
+
"ignore": {
|
|
93
|
+
"patterns": [
|
|
94
|
+
"node_modules",
|
|
95
|
+
".git",
|
|
96
|
+
".next",
|
|
97
|
+
"dist",
|
|
98
|
+
"build"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
81
101
|
}
|
|
82
102
|
```
|
|
83
103
|
|
|
104
|
+
配置文件修改后会自动重新加载 —— 无需重启服务器。
|
|
105
|
+
|
|
106
|
+
### 配置字段说明
|
|
107
|
+
|
|
108
|
+
| 字段 | 类型 | 说明 |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `dirs` | `Array<{path, name?, exclude?}>` | 要服务的文档目录 |
|
|
111
|
+
| `allowedExtensions` | `string[]` | 文件树中显示的文件扩展名 |
|
|
112
|
+
| `showHiddenFiles` | `boolean` | 是否显示隐藏文件(以点开头的文件) |
|
|
113
|
+
| `theme.default` | \`"light" | "dark" |
|
|
114
|
+
| `editor.autosave` | `boolean` | 是否启用自动保存 |
|
|
115
|
+
| `editor.debounceMs` | `number` | 自动保存防抖延迟(毫秒) |
|
|
116
|
+
| `ignore.patterns` | `string[]` | 全局忽略模式(支持 glob 语法) |
|
|
117
|
+
|
|
84
118
|
## 开发
|
|
85
119
|
|
|
86
120
|
```bash
|
|
87
121
|
# 克隆仓库
|
|
88
122
|
git clone https://github.com/opencolony/note.git
|
|
123
|
+
cd note
|
|
89
124
|
|
|
90
125
|
# 安装依赖
|
|
91
|
-
|
|
126
|
+
pnpm install
|
|
92
127
|
|
|
93
128
|
# 启动开发服务器(后端 + 前端热更新)
|
|
94
|
-
|
|
129
|
+
pnpm dev
|
|
95
130
|
|
|
96
131
|
# 仅前端开发(Vite 开发服务器,端口 5787)
|
|
97
|
-
|
|
132
|
+
pnpm dev:frontend
|
|
98
133
|
|
|
99
134
|
# 仅后端开发(Hono 服务器,端口 5788)
|
|
100
|
-
|
|
135
|
+
pnpm dev:backend
|
|
101
136
|
|
|
102
137
|
# 构建生产版本
|
|
103
|
-
|
|
138
|
+
pnpm build
|
|
104
139
|
|
|
105
140
|
# 运行生产版本
|
|
106
|
-
|
|
141
|
+
pnpm start
|
|
142
|
+
|
|
143
|
+
# 类型检查
|
|
144
|
+
pnpm typecheck
|
|
145
|
+
|
|
146
|
+
# 运行测试
|
|
147
|
+
pnpm test
|
|
107
148
|
```
|
|
108
149
|
|
|
109
150
|
## 技术栈
|
|
110
151
|
|
|
111
|
-
- **后端**: Hono
|
|
112
|
-
- **前端**: React 18
|
|
113
|
-
- **UI 组件**: shadcn/ui
|
|
114
|
-
- **编辑器**: TipTap 3
|
|
115
|
-
- **图表**: Mermaid
|
|
116
|
-
-
|
|
117
|
-
-
|
|
152
|
+
- **后端**: [Hono](https://hono.dev) + [@hono/node-server](https://github.com/honojs/node-server) + [ws](https://github.com/websockets/ws)
|
|
153
|
+
- **前端**: [React 18](https://react.dev) + [Vite](https://vitejs.dev) + [Tailwind CSS v4](https://tailwindcss.com)
|
|
154
|
+
- **UI 组件**: [shadcn/ui](https://ui.shadcn.com)(基于 [Radix UI](https://www.radix-ui.com))
|
|
155
|
+
- **编辑器**: [TipTap 3](https://tiptap.dev) + [tiptap-markdown](https://github.com/aguingand/tiptap-markdown)
|
|
156
|
+
- **图表**: [Mermaid](https://mermaid.js.org)
|
|
157
|
+
- **数学公式**: [KaTeX](https://katex.org)
|
|
158
|
+
- **搜索**: ripgrep(服务端)+ FlexSearch(客户端索引)
|
|
159
|
+
- **代码高亮**: [lowlight](https://github.com/wooorm/lowlight)
|
|
160
|
+
- **图标**: [lucide-react](https://lucide.dev)
|
|
118
161
|
|
|
119
162
|
## 许可证
|
|
120
163
|
|
|
@@ -122,4 +165,4 @@ MIT
|
|
|
122
165
|
|
|
123
166
|
## 作者
|
|
124
167
|
|
|
125
|
-
岳晓亮
|
|
168
|
+
岳晓亮 [hi@yuexiaoliang.com](mailto:hi@yuexiaoliang.com)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./path-yo4Xej8w.js";import{Ct as n,St as r,_t as i,bt as a,dt as o,ft as s,ht as c,mt as l,pt as u,vt as d,xt as f,yt as p}from"./index-
|
|
1
|
+
import{n as e,t}from"./path-yo4Xej8w.js";import{Ct as n,St as r,_t as i,bt as a,dt as o,ft as s,ht as c,mt as l,pt as u,vt as d,xt as f,yt as p}from"./index-C9TyPVfK.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,i,a,o,s){var c=e-n,l=t-i,u=(s?o:-o)/r(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=i+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=a-o,w=m*_-g*h,T=(x<0?-1:1)*r(d(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(a/C-1),y11:D*(a/C-1)}}function x(){var d=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+d.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-i,_=T.apply(this,arguments)-i,v=o(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>n-1e-12)D.moveTo(h*c(g),h*f(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*c(_),m*f(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):r(m*m+h*h)),R=p(o(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=u(L/m*f(I)),W=u(L/h*f(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*c(A),K=h*f(A),q=m*c(N),J=m*f(N);if(R>1e-12){var Y=h*c(j),X=h*f(j),Z=m*c(M),Q=m*f(M),$;if(v<a)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/f(s((ee*ne+te*re)/(r(ee*ee+te*te)*r(ne*ne+re*re)))/2),ae=r($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,l(V.y01,V.x01),l(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,l(V.y01,V.x01),l(V.y11,V.x11),!k),D.arc(0,0,h,l(V.cy+V.y11,V.cx+V.x11),l(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,l(H.y11,H.x11),l(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,l(V.y01,V.x01),l(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,l(V.y01,V.x01),l(V.y11,V.x11),!k),D.arc(0,0,m,l(V.cy+V.y11,V.cx+V.x11),l(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,l(H.y11,H.x11),l(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+d.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-a/2;return[c(t)*e,f(t)*e]},k.innerRadius=function(t){return arguments.length?(d=typeof t==`function`?t:e(+t),k):d},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-K5T4RW27-C8czLGM6.js";import{n as e}from"./chunk-7N4EOEYR-BZ6bA78p.js";export{e as createArchitectureServices};
|