A WhiteWind blog to Leaflet publication conversion tool
1# Contributing to WhiteWind to Leaflet Converter
2
3Thank 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
151. **Fork the repository** on GitHub
161. **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 ```
221. **Install dependencies**:
23
24 ```bash
25 npm install
26 ```
271. **Start the development server**:
28
29 ```bash
30 npm run dev
31 ```
321. **Open your browser** and navigate to `http://localhost:5173`
33
34## 📁 Project Structure
35
36Understanding the project structure will help you navigate and contribute effectively:
37
38```
39src/
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
69This 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
76Before submitting, ensure your code is formatted:
77
78```bash
79npm run format
80```
81
82### Type Checking
83
84The project uses **TypeScript** with strict settings. Run type checking with:
85
86```bash
87npm run check
88```
89
90For continuous type checking during development:
91
92```bash
93npm run check:watch
94```
95
96### Building and Testing
97
98Build the project to ensure everything works:
99
100```bash
101npm run build
102```
103
104Preview the built version:
105
106```bash
107npm run preview
108```
109
110## 🎯 Areas for Contribution
111
112### High Priority Areas
113
1141. **Conversion Logic Improvements**
115- Better markdown parsing edge cases
116- Enhanced rich text facet extraction
117- More robust error handling
1181. **User Experience**
119- Better error messages and validation
120- Progress indicators for long operations
121- Improved responsive design
1221. **Testing**
123- Unit tests for conversion functions
124- Integration tests for UI components
125- End-to-end testing
126
127### Medium Priority Areas
128
1291. **Additional Features**
130- Batch processing improvements
131- Export format options
132- Configuration presets
1331. **Documentation**
134- Code comments and documentation
135- User guide improvements
136- API documentation
1371. **Performance**
138- Large file handling optimization
139- Memory usage improvements
140- Bundle size optimization
141
142## 📝 Contribution Guidelines
143
144### Before You Start
145
1461. **Check existing issues** to see if someone is already working on what you want to do
1471. **Open an issue** to discuss major changes before implementing them
1481. **Search existing pull requests** to avoid duplicate work
149
150### Making Changes
151
1521. **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 ```
1591. **Make your changes** following the project’s coding standards
1601. **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
1641. **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
1741. **Update documentation** if your changes affect user-facing functionality
1751. **Ensure all checks pass**:
176
177 ```bash
178 npm run format
179 npm run check
180 npm run build
181 ```
1821. **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
1871. **Respond to feedback** promptly and make requested changes
188
189## 🐛 Bug Reports
190
191When 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
199Use this template:
200
201```markdown
202**Bug Description:**
203A clear description of the bug.
204
205**Steps to Reproduce:**
2061. Go to...
2072. Click on...
2083. Enter...
209
210**Expected Behavior:**
211What should have happened.
212
213**Actual Behavior:**
214What 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:**
222Any other relevant information.
223```
224
225## 💡 Feature Requests
226
227For feature requests, please:
228
2291. **Check existing issues** first
2301. **Describe the use case** clearly
2311. **Explain why** the feature would be valuable
2321. **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
246The conversion happens in these main steps:
247
2481. **Parse WhiteWind JSON** - Handle different export formats
2491. **Generate Publication Record** - Create the main publication schema
2501. **Convert Entries** - Transform each entry into Leaflet documents
2511. **Process Markdown** - Parse markdown into Leaflet blocks
2521. **Handle Rich Text** - Extract and convert text formatting
2531. **Convert URLs** - Transform blob URLs to AT-URIs
254
255### AT Protocol Integration
256
257This 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
273If you need help:
274
2751. **Check the README** for basic usage information
2761. **Look through existing issues** for similar questions
2771. **Open a new issue** with the “question” label
2781. **Be specific** about what you’re trying to do
279
280## 🎉 Recognition
281
282Contributors will be recognized in:
283
284- GitHub contributors list
285- Release notes for significant contributions
286- Project documentation
287
288Thank you for contributing to making WhiteWind to Leaflet conversion better for everyone! 🍃