+288
CONTRIBUTING.md
+288
CONTRIBUTING.md
···
1
+
# Contributing to WhiteWind to Leaflet Converter
2
+
3
+
Thank you for your interest in contributing to the WhiteWind to Leaflet converter! This guide will help you get started with contributing to this project.
4
+
5
+
## π Getting Started
6
+
7
+
### Prerequisites
8
+
9
+
- **Node.js** (version 18 or higher recommended)
10
+
- **npm** (comes with Node.js)
11
+
- Basic knowledge of TypeScript, Svelte, and web development
12
+
13
+
### Setting Up the Development Environment
14
+
15
+
1. **Fork the repository** on GitHub
16
+
1. **Clone your fork** locally:
17
+
18
+
```bash
19
+
git clone https://github.com/YOUR_USERNAME/whtwnd-to-leaflet.git
20
+
cd whtwnd-to-leaflet
21
+
```
22
+
1. **Install dependencies**:
23
+
24
+
```bash
25
+
npm install
26
+
```
27
+
1. **Start the development server**:
28
+
29
+
```bash
30
+
npm run dev
31
+
```
32
+
1. **Open your browser** and navigate to `http://localhost:5173`
33
+
34
+
## π Project Structure
35
+
36
+
Understanding the project structure will help you navigate and contribute effectively:
37
+
38
+
```
39
+
src/
40
+
βββ routes/
41
+
β βββ +layout.svelte # Global layout
42
+
β βββ +page.svelte # Main application page
43
+
βββ lib/
44
+
β βββ convert.ts # Core conversion logic
45
+
β βββ styles.css # Custom styles
46
+
β βββ variables.css # CSS custom properties
47
+
βββ types/
48
+
β βββ file-saver.d.ts # Type declarations
49
+
βββ app.css # Global styles entry point
50
+
```
51
+
52
+
### Key Files to Understand
53
+
54
+
- **`src/lib/convert.ts`** - Contains all conversion logic including:
55
+
- TID generation
56
+
- Markdown to Leaflet blocks parsing
57
+
- Rich text processing with facets
58
+
- URL conversion utilities
59
+
- **`src/routes/+page.svelte`** - The main UI component with:
60
+
- Form handling
61
+
- State management
62
+
- User interaction logic
63
+
- **`src/lib/styles.css`** - Custom styling that works with CSS custom properties
64
+
65
+
## π οΈ Development Workflow
66
+
67
+
### Code Style
68
+
69
+
This project uses **Prettier** for code formatting. The configuration is in `.prettierrc`:
70
+
71
+
- **Tabs** for indentation
72
+
- **Single quotes** for strings
73
+
- **No trailing commas**
74
+
- **100 character** print width
75
+
76
+
Before submitting, ensure your code is formatted:
77
+
78
+
```bash
79
+
npm run format
80
+
```
81
+
82
+
### Type Checking
83
+
84
+
The project uses **TypeScript** with strict settings. Run type checking with:
85
+
86
+
```bash
87
+
npm run check
88
+
```
89
+
90
+
For continuous type checking during development:
91
+
92
+
```bash
93
+
npm run check:watch
94
+
```
95
+
96
+
### Building and Testing
97
+
98
+
Build the project to ensure everything works:
99
+
100
+
```bash
101
+
npm run build
102
+
```
103
+
104
+
Preview the built version:
105
+
106
+
```bash
107
+
npm run preview
108
+
```
109
+
110
+
## π― Areas for Contribution
111
+
112
+
### High Priority Areas
113
+
114
+
1. **Conversion Logic Improvements**
115
+
- Better markdown parsing edge cases
116
+
- Enhanced rich text facet extraction
117
+
- More robust error handling
118
+
1. **User Experience**
119
+
- Better error messages and validation
120
+
- Progress indicators for long operations
121
+
- Improved responsive design
122
+
1. **Testing**
123
+
- Unit tests for conversion functions
124
+
- Integration tests for UI components
125
+
- End-to-end testing
126
+
127
+
### Medium Priority Areas
128
+
129
+
1. **Additional Features**
130
+
- Batch processing improvements
131
+
- Export format options
132
+
- Configuration presets
133
+
1. **Documentation**
134
+
- Code comments and documentation
135
+
- User guide improvements
136
+
- API documentation
137
+
1. **Performance**
138
+
- Large file handling optimization
139
+
- Memory usage improvements
140
+
- Bundle size optimization
141
+
142
+
## π Contribution Guidelines
143
+
144
+
### Before You Start
145
+
146
+
1. **Check existing issues** to see if someone is already working on what you want to do
147
+
1. **Open an issue** to discuss major changes before implementing them
148
+
1. **Search existing pull requests** to avoid duplicate work
149
+
150
+
### Making Changes
151
+
152
+
1. **Create a new branch** for your feature or bugfix:
153
+
154
+
```bash
155
+
git checkout -b feature/your-feature-name
156
+
# or
157
+
git checkout -b fix/issue-description
158
+
```
159
+
1. **Make your changes** following the projectβs coding standards
160
+
1. **Test your changes** thoroughly:
161
+
- Test the conversion with various WhiteWind export formats
162
+
- Verify the output works with Leaflet
163
+
- Check responsive design on different screen sizes
164
+
1. **Commit your changes** with clear, descriptive messages:
165
+
166
+
```bash
167
+
git commit -m "feat: add support for nested blockquotes"
168
+
# or
169
+
git commit -m "fix: handle empty content fields gracefully"
170
+
```
171
+
172
+
### Pull Request Process
173
+
174
+
1. **Update documentation** if your changes affect user-facing functionality
175
+
1. **Ensure all checks pass**:
176
+
177
+
```bash
178
+
npm run format
179
+
npm run check
180
+
npm run build
181
+
```
182
+
1. **Create a pull request** with:
183
+
- Clear title describing the change
184
+
- Detailed description of what was changed and why
185
+
- Screenshots if UI changes are involved
186
+
- Reference to related issues
187
+
1. **Respond to feedback** promptly and make requested changes
188
+
189
+
## π Bug Reports
190
+
191
+
When reporting bugs, please include:
192
+
193
+
- **Browser and version**
194
+
- **Steps to reproduce** the issue
195
+
- **Expected vs actual behavior**
196
+
- **Sample WhiteWind JSON** that causes the issue (if applicable)
197
+
- **Console errors** (if any)
198
+
199
+
Use this template:
200
+
201
+
```markdown
202
+
**Bug Description:**
203
+
A clear description of the bug.
204
+
205
+
**Steps to Reproduce:**
206
+
1. Go to...
207
+
2. Click on...
208
+
3. Enter...
209
+
210
+
**Expected Behavior:**
211
+
What should have happened.
212
+
213
+
**Actual Behavior:**
214
+
What actually happened.
215
+
216
+
**Environment:**
217
+
- Browser: [e.g., Chrome 120]
218
+
- OS: [e.g., Windows 11]
219
+
- Version: [e.g., latest main branch]
220
+
221
+
**Additional Context:**
222
+
Any other relevant information.
223
+
```
224
+
225
+
## π‘ Feature Requests
226
+
227
+
For feature requests, please:
228
+
229
+
1. **Check existing issues** first
230
+
1. **Describe the use case** clearly
231
+
1. **Explain why** the feature would be valuable
232
+
1. **Provide examples** if possible
233
+
234
+
## π§ Technical Details
235
+
236
+
### Key Technologies
237
+
238
+
- **SvelteKit** - Full-stack framework
239
+
- **TypeScript** - Type safety
240
+
- **Tailwind CSS v4** - Utility-first styling
241
+
- **JSZip** - ZIP file generation
242
+
- **File-saver** - File download functionality
243
+
244
+
### Conversion Process
245
+
246
+
The conversion happens in these main steps:
247
+
248
+
1. **Parse WhiteWind JSON** - Handle different export formats
249
+
1. **Generate Publication Record** - Create the main publication schema
250
+
1. **Convert Entries** - Transform each entry into Leaflet documents
251
+
1. **Process Markdown** - Parse markdown into Leaflet blocks
252
+
1. **Handle Rich Text** - Extract and convert text formatting
253
+
1. **Convert URLs** - Transform blob URLs to AT-URIs
254
+
255
+
### AT Protocol Integration
256
+
257
+
This tool works with the **AT Protocol ecosystem**:
258
+
259
+
- **WhiteWind** - Source blog platform
260
+
- **Leaflet** - Target publication platform
261
+
- **AT-URIs** - Proper URI format conversion
262
+
- **DIDs** - Decentralized identity handling
263
+
264
+
## π Code of Conduct
265
+
266
+
- Be respectful and inclusive
267
+
- Provide constructive feedback
268
+
- Focus on the issue, not the person
269
+
- Help create a welcoming environment for all contributors
270
+
271
+
## π Getting Help
272
+
273
+
If you need help:
274
+
275
+
1. **Check the README** for basic usage information
276
+
1. **Look through existing issues** for similar questions
277
+
1. **Open a new issue** with the βquestionβ label
278
+
1. **Be specific** about what youβre trying to do
279
+
280
+
## π Recognition
281
+
282
+
Contributors will be recognized in:
283
+
284
+
- GitHub contributors list
285
+
- Release notes for significant contributions
286
+
- Project documentation
287
+
288
+
Thank you for contributing to making WhiteWind to Leaflet conversion better for everyone! π