File size: 11,207 Bytes
f462b1c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | # Contributing to Chahuadev Markdown Presenter
First off, thank you for considering contributing to Chahuadev Markdown Presenter! It's people like you that make this project such a great tool.
[English](#english) | [ไทย](#thai)
---
## English
### Code of Conduct
This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
### How Can I Contribute?
#### Reporting Bugs
Before creating bug reports, please check the [existing issues](https://github.com/chahuadev/chahuadev-markdown-presenter/issues) to avoid duplicates.
**When you create a bug report, please include:**
- **Clear title and description**
- **Steps to reproduce** the issue
- **Expected behavior** vs **actual behavior**
- **Screenshots** if applicable
- **Environment details**:
- OS version (Windows/macOS/Linux)
- Node.js version (`node --version`)
- Electron version
- Application version
**Example bug report:**
```markdown
**Title:** Auto-pagination fails with code blocks over 10 lines
**Description:**
When a Markdown file contains a code block with more than 10 lines,
the auto-pagination system crashes.
**Steps to Reproduce:**
1. Create a markdown file with a code block > 10 lines
2. Click "Sync Markdown"
3. Observe error in console
**Expected:**
Code block should be split across multiple slides
**Actual:**
Application crashes with TypeError
**Environment:**
- OS: Windows 11
- Node: v18.16.0
- Electron: 28.0.0
```
#### Suggesting Enhancements
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- **Use a clear and descriptive title**
- **Provide detailed description** of the suggested enhancement
- **Explain why this enhancement would be useful**
- **List alternative solutions** you've considered
#### Pull Requests
**Process:**
1. **Fork** the repository
2. **Create a branch** from `main`:
```bash
git checkout -b feature/your-feature-name
```
3. **Make your changes** with clear commit messages
4. **Test thoroughly** - ensure all existing functionality works
5. **Update documentation** if needed
6. **Submit a pull request** with:
- Clear description of changes
- Reference to related issues
- Screenshots/GIFs for UI changes
**Commit Message Guidelines:**
```
type(scope): subject
body (optional)
footer (optional)
```
**Types:**
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation changes
- `style`: Code style changes (formatting, semicolons, etc.)
- `refactor`: Code refactoring
- `test`: Adding or updating tests
- `chore`: Maintenance tasks
**Examples:**
```
feat(pagination): add configurable max lines per slide
fix(parser): handle empty code blocks correctly
docs(readme): update installation instructions
```
### Development Setup
#### Prerequisites
- Node.js 18.0.0+
- npm 8.0.0+
- Git
#### Getting Started
```bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/chahuadev-markdown-presenter.git
# Navigate to directory
cd chahuadev-markdown-presenter
# Add upstream remote
git remote add upstream https://github.com/chahuadev/chahuadev-markdown-presenter.git
# Install dependencies
npm install
# Start development
npm start
```
#### Project Structure
```
src/
├── main/ # Electron main process
├── renderer/ # UI and frontend logic
└── shared/ # Shared modules (parser, paginator, etc.)
```
#### Key Files
- **`src/shared/markdown-parser.js`** - Markdown parsing logic
- **`src/shared/slide-paginator.js`** - Auto-pagination algorithm
- **`src/renderer/js/app.js`** - Main application controller
- **`src/renderer/js/video-renderer.js`** - Video export logic
### Coding Standards
#### JavaScript Style
- Use **ES6+ features** (const/let, arrow functions, template literals)
- Use **ES Modules** (`import`/`export`)
- **2 spaces** for indentation
- **Semicolons** required
- **Single quotes** for strings (except template literals)
#### Code Comments
```javascript
/**
* Calculate visual lines for a content item
* @param {Object} item - Content item with type and content
* @returns {number} Number of visual lines
*/
export function calculateVisualLines(item) {
// Implementation
}
```
#### Error Handling
```javascript
try {
const result = await parseMarkdown(content);
return result;
} catch (error) {
console.error('Failed to parse markdown:', error);
throw new Error(`Markdown parsing failed: ${error.message}`);
}
```
### Testing
```bash
# Run tests (when implemented)
npm test
# Run linter
npm run lint
```
**Test Guidelines:**
- Write unit tests for new features
- Ensure tests pass before submitting PR
- Include test cases for edge cases
### Documentation
When adding new features:
1. **Update relevant documentation** in `docs/`
2. **Add examples** to demonstrate usage
3. **Update README.md** if user-facing changes
4. **Write bilingual docs** (EN + TH) when possible
### Questions?
- Open an issue with the `question` label
- Join discussions in existing issues
- Check [documentation](docs/) first
---
## Thai
### จรรยาบรรณ
โปรเจกต์นี้และทุกคนที่เข้าร่วมอยู่ภายใต้ [จรรยาบรรณ](CODE_OF_CONDUCT.md) ของเรา การเข้าร่วมหมายความว่าคุณยอมรับจรรยาบรรณนี้
### ฉันสามารถมีส่วนร่วมได้อย่างไร?
#### รายงานบั๊ก
ก่อนสร้างรายงานบั๊ก โปรดตรวจสอบ [issues ที่มีอยู่](https://github.com/chahuadev/chahuadev-markdown-presenter/issues) เพื่อหลีกเลี่ยงการซ้ำซ้อน
**เมื่อสร้างรายงานบั๊ก โปรดระบุ:**
- **หัวข้อและคำอธิบายที่ชัดเจน**
- **ขั้นตอนการทำซ้ำ** ปัญหา
- **พฤติกรรมที่คาดหวัง** กับ **พฤติกรรมจริง**
- **ภาพหน้าจอ** ถ้ามี
- **รายละเอียดสภาพแวดล้อม**:
- เวอร์ชัน OS (Windows/macOS/Linux)
- เวอร์ชัน Node.js (`node --version`)
- เวอร์ชัน Electron
- เวอร์ชันแอปพลิเคชัน
#### แนะนำการปรับปรุง
การแนะนำการปรับปรุงจะถูกติดตามเป็น GitHub issues เมื่อสร้างข้อเสนอแนะ:
- **ใช้หัวข้อที่ชัดเจนและอธิบายได้**
- **ให้คำอธิบายโดยละเอียด** ของการปรับปรุงที่แนะนำ
- **อธิบายว่าทำไมการปรับปรุงนี้มีประโยชน์**
- **แสดงทางเลือกอื่น** ที่คุณพิจารณา
#### Pull Requests
**กระบวนการ:**
1. **Fork** repository
2. **สร้าง branch** จาก `main`:
```bash
git checkout -b feature/ชื่อฟีเจอร์ของคุณ
```
3. **ทำการเปลี่ยนแปลง** พร้อม commit messages ที่ชัดเจน
4. **ทดสอบอย่างละเอียด** - ตรวจสอบว่าฟังก์ชันทั้งหมดทำงาน
5. **อัปเดตเอกสาร** ถ้าจำเป็น
6. **ส่ง pull request** พร้อม:
- คำอธิบายการเปลี่ยนแปลงที่ชัดเจน
- อ้างอิงถึง issues ที่เกี่ยวข้อง
- ภาพหน้าจอ/GIFs สำหรับการเปลี่ยนแปลง UI
**แนวทาง Commit Message:**
```
type(scope): เรื่อง
เนื้อหา (ถ้ามี)
footer (ถ้ามี)
```
**ประเภท:**
- `feat`: ฟีเจอร์ใหม่
- `fix`: แก้บั๊ก
- `docs`: เปลี่ยนแปลงเอกสาร
- `style`: เปลี่ยนสไตล์โค้ด (formatting, semicolons, ฯลฯ)
- `refactor`: รีแฟกเตอร์โค้ด
- `test`: เพิ่มหรืออัปเดตเทสต์
- `chore`: งานบำรุงรักษา
### การตั้งค่าการพัฒนา
#### ความต้องการเบื้องต้น
- Node.js 18.0.0+
- npm 8.0.0+
- Git
#### เริ่มต้น
```bash
# โคลน fork ของคุณ
git clone https://github.com/YOUR_USERNAME/chahuadev-markdown-presenter.git
# เข้าไปในโฟลเดอร์
cd chahuadev-markdown-presenter
# เพิ่ม upstream remote
git remote add upstream https://github.com/chahuadev/chahuadev-markdown-presenter.git
# ติดตั้ง dependencies
npm install
# เริ่มพัฒนา
npm start
```
### มาตรฐานการเขียนโค้ด
#### JavaScript Style
- ใช้ **คุณสมบัติ ES6+** (const/let, arrow functions, template literals)
- ใช้ **ES Modules** (`import`/`export`)
- **2 spaces** สำหรับ indentation
- **Semicolons** จำเป็น
- **Single quotes** สำหรับ strings (ยกเว้น template literals)
### การทดสอบ
```bash
# รันเทสต์ (เมื่อถูกสร้าง)
npm test
# รัน linter
npm run lint
```
### เอกสาร
เมื่อเพิ่มฟีเจอร์ใหม่:
1. **อัปเดตเอกสารที่เกี่ยวข้อง** ใน `docs/`
2. **เพิ่มตัวอย่าง** เพื่อแสดงการใช้งาน
3. **อัปเดต README.md** ถ้ามีการเปลี่ยนแปลงที่ผู้ใช้เห็น
4. **เขียนเอกสารสองภาษา** (EN + TH) เมื่อเป็นไปได้
### มีคำถาม?
- เปิด issue พร้อมป้ายกำกับ `question`
- เข้าร่วมการสนทนาใน issues ที่มีอยู่
- ตรวจสอบ [เอกสาร](docs/) ก่อน
---
Thank you for contributing! 🎉
ขอบคุณสำหรับการมีส่วนร่วม! 🎉
|