Skip to content

Commit 8a3dabd

Browse files
committed
first
0 parents  commit 8a3dabd

38 files changed

+12500
-0
lines changed

.github/workflows/test.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
name: Run Tests
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
node-version: [18.x, 20.x, 22.x]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Run tests
33+
run: npm test
34+
env:
35+
FORCE_COLOR: 0
36+
37+
- name: Upload coverage to Codecov
38+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
39+
uses: codecov/codecov-action@v4
40+
with:
41+
files: ./coverage/lcov.info
42+
flags: unittests
43+
name: codecov-umbrella
44+
fail_ci_if_error: false
45+
46+
lint:
47+
name: Lint Code
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '20.x'
58+
cache: 'npm'
59+
60+
- name: Install dependencies
61+
run: npm ci
62+
63+
- name: Run ESLint
64+
run: npm run lint --if-present

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules/
2+
*.log
3+
.DS_Store
4+
.env
5+
dist/
6+
build/
7+
coverage/
8+
.nyc_output/
9+
10+
.claude/
11+
12+
# Allow dev-files directory but ignore any user-added test files
13+
# The default test files are tracked in git
14+
dev-files/*.local.md

.npmignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Development files
2+
dev-files/
3+
tests/
4+
coverage/
5+
.github/
6+
.claude/
7+
8+
# Configuration files
9+
.swcrc
10+
jest.config.js
11+
.gitignore
12+
.npmignore
13+
14+
# Documentation (except what's in "files" in package.json)
15+
CONTRIBUTING.md
16+
TESTING.md
17+
IMPLEMENTATION_STATUS.md
18+
19+
# Development dependencies
20+
node_modules/
21+
22+
# Build artifacts
23+
*.log
24+
*.tgz
25+
26+
# OS files
27+
.DS_Store
28+
Thumbs.db
29+
30+
# Editor files
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
*~
36+
37+
# Test files
38+
*.test.js
39+
*.test.jsx
40+
*.spec.js
41+
*.spec.jsx
42+
43+
# Assets not needed in npm package
44+
splitmark-logo.png
45+
screenshots/
46+
demos/

.swcrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"jsc": {
3+
"parser": {
4+
"syntax": "ecmascript",
5+
"jsx": true
6+
},
7+
"transform": {
8+
"react": {
9+
"runtime": "automatic"
10+
}
11+
},
12+
"target": "es2022"
13+
},
14+
"module": {
15+
"type": "es6"
16+
}
17+
}

CONFIG.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Splitmark Configuration
2+
3+
Splitmark supports user configuration through a `.splitmarkrc` file in your home directory.
4+
5+
## Configuration File Location
6+
7+
- **Linux/macOS**: `~/.splitmarkrc`
8+
- **Windows**: `C:\Users\YourUsername\.splitmarkrc`
9+
10+
## Automatic Creation
11+
12+
On first run, splitmark will automatically create a default configuration file if one doesn't exist.
13+
14+
## Platform-Specific Default Location
15+
16+
Splitmark automatically detects the correct Documents folder for your platform:
17+
18+
- **Windows**: Uses PowerShell to detect your actual Documents folder (handles OneDrive redirection)
19+
- Example: `C:\Users\YourName\OneDrive\Documents\Splitmark`
20+
- Or: `C:\Users\YourName\Documents\Splitmark` (if not using OneDrive)
21+
- **macOS**: `~/Documents/Splitmark`
22+
- **Linux**: Uses XDG Documents directory or `~/Documents/Splitmark`
23+
24+
## Default Configuration
25+
26+
```json
27+
{
28+
"defaultLocation": "~/Documents/Splitmark",
29+
"layout": "side",
30+
"showPreview": true,
31+
"columnWidthRatio": 75,
32+
"theme": {
33+
"editor": {
34+
"background": "#1e1e1e",
35+
"foreground": "#d4d4d4",
36+
"lineNumber": "#858585",
37+
"cursor": "#ffffff",
38+
"selection": "#264f78"
39+
},
40+
"syntax": {
41+
"keyword": "#C586C0",
42+
"string": "#CE9178",
43+
"number": "#B5CEA8",
44+
"comment": "#6A9955",
45+
"function": "#DCDCAA",
46+
"variable": "#9CDCFE",
47+
"type": "#4EC9B0",
48+
"operator": "#D4D4D4"
49+
},
50+
"preview": {
51+
"background": "#1e1e1e",
52+
"foreground": "#d4d4d4",
53+
"heading": "#ffffff",
54+
"link": "#3794ff",
55+
"code": {
56+
"background": "#2d2d2d",
57+
"foreground": "#d4d4d4"
58+
}
59+
}
60+
}
61+
}
62+
```
63+
64+
## Configuration Options
65+
66+
### `defaultLocation`
67+
- **Type**: String (file path)
68+
- **Default**: `~/Documents/Splitmark`
69+
- **Description**: Default directory for saving markdown files when no path is specified
70+
71+
### `layout`
72+
- **Type**: String
73+
- **Values**: `"side"` or `"bottom"`
74+
- **Default**: `"side"`
75+
- **Description**: Default preview layout (side-by-side or top-bottom)
76+
77+
### `showPreview`
78+
- **Type**: Boolean
79+
- **Default**: `true`
80+
- **Description**: Whether to show the preview pane by default
81+
82+
### `columnWidthRatio`
83+
- **Type**: Number
84+
- **Values**: `25`, `50`, or `75`
85+
- **Default**: `75`
86+
- **Description**: Editor width percentage in side-by-side layout (75%, 50%, or 25%)
87+
88+
### `theme`
89+
- **Type**: Object
90+
- **Description**: Color theme settings for editor, syntax highlighting, and preview
91+
- **Note**: Currently uses VSCode Dark+ theme colors by default
92+
93+
## File Path Resolution
94+
95+
Splitmark intelligently resolves file paths based on your configuration:
96+
97+
### Simple Filename
98+
```bash
99+
splitmark notes.md
100+
# Creates: ~/Documents/Splitmark/notes.md
101+
```
102+
103+
### Folder + Filename
104+
```bash
105+
splitmark projects/myapp/README.md
106+
# Creates: ~/Documents/Splitmark/projects/myapp/README.md
107+
# Automatically creates folders if they don't exist
108+
```
109+
110+
### Relative Paths (Current Directory)
111+
```bash
112+
splitmark ./local.md
113+
# Uses current directory, not default location
114+
```
115+
116+
### Relative Paths (Parent Directory)
117+
```bash
118+
splitmark ../parent.md
119+
# Uses parent directory, not default location
120+
```
121+
122+
### Absolute Paths
123+
```bash
124+
splitmark /absolute/path/to/file.md
125+
# Uses exact path specified
126+
```
127+
128+
## CLI Option Overrides
129+
130+
Command-line options override configuration file settings:
131+
132+
```bash
133+
# Override layout
134+
splitmark file.md --layout bottom
135+
136+
# Disable preview
137+
splitmark file.md --no-preview
138+
```
139+
140+
## Example Workflows
141+
142+
### Personal Notes
143+
```bash
144+
# Quick note - saved to ~/Documents/Splitmark/
145+
splitmark quick-note.md
146+
147+
# Organized notes
148+
splitmark meetings/2024-01-15.md
149+
splitmark ideas/project-alpha.md
150+
```
151+
152+
### Project Documentation
153+
```bash
154+
# Change default location in config
155+
{
156+
"defaultLocation": "~/projects/docs"
157+
}
158+
159+
# Now all files go to ~/projects/docs by default
160+
splitmark api.md # ~/projects/docs/api.md
161+
splitmark guides/setup.md # ~/projects/docs/guides/setup.md
162+
```
163+
164+
## Customizing Your Config
165+
166+
Edit `~/.splitmarkrc` with your preferred settings:
167+
168+
```json
169+
{
170+
"defaultLocation": "/path/to/your/notes",
171+
"layout": "bottom",
172+
"showPreview": true,
173+
"columnWidthRatio": 50
174+
}
175+
```
176+
177+
Changes take effect the next time you launch splitmark.

0 commit comments

Comments
 (0)