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
Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
How Can I Contribute?
Reporting Bugs
Before creating bug reports, please check the existing 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:
**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:
- Fork the repository
- Create a branch from
main:git checkout -b feature/your-feature-name - Make your changes with clear commit messages
- Test thoroughly - ensure all existing functionality works
- Update documentation if needed
- 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 featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, semicolons, etc.)refactor: Code refactoringtest: Adding or updating testschore: 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
# 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 logicsrc/shared/slide-paginator.js- Auto-pagination algorithmsrc/renderer/js/app.js- Main application controllersrc/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
/**
* 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
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
# 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:
- Update relevant documentation in
docs/ - Add examples to demonstrate usage
- Update README.md if user-facing changes
- Write bilingual docs (EN + TH) when possible
Questions?
- Open an issue with the
questionlabel - Join discussions in existing issues
- Check documentation first
Thai
จรรยาบรรณ
โปรเจกต์นี้และทุกคนที่เข้าร่วมอยู่ภายใต้ จรรยาบรรณ ของเรา การเข้าร่วมหมายความว่าคุณยอมรับจรรยาบรรณนี้
ฉันสามารถมีส่วนร่วมได้อย่างไร?
รายงานบั๊ก
ก่อนสร้างรายงานบั๊ก โปรดตรวจสอบ issues ที่มีอยู่ เพื่อหลีกเลี่ยงการซ้ำซ้อน
เมื่อสร้างรายงานบั๊ก โปรดระบุ:
- หัวข้อและคำอธิบายที่ชัดเจน
- ขั้นตอนการทำซ้ำ ปัญหา
- พฤติกรรมที่คาดหวัง กับ พฤติกรรมจริง
- ภาพหน้าจอ ถ้ามี
- รายละเอียดสภาพแวดล้อม:
- เวอร์ชัน OS (Windows/macOS/Linux)
- เวอร์ชัน Node.js (
node --version) - เวอร์ชัน Electron
- เวอร์ชันแอปพลิเคชัน
แนะนำการปรับปรุง
การแนะนำการปรับปรุงจะถูกติดตามเป็น GitHub issues เมื่อสร้างข้อเสนอแนะ:
- ใช้หัวข้อที่ชัดเจนและอธิบายได้
- ให้คำอธิบายโดยละเอียด ของการปรับปรุงที่แนะนำ
- อธิบายว่าทำไมการปรับปรุงนี้มีประโยชน์
- แสดงทางเลือกอื่น ที่คุณพิจารณา
Pull Requests
กระบวนการ:
- Fork repository
- สร้าง branch จาก
main:git checkout -b feature/ชื่อฟีเจอร์ของคุณ - ทำการเปลี่ยนแปลง พร้อม commit messages ที่ชัดเจน
- ทดสอบอย่างละเอียด - ตรวจสอบว่าฟังก์ชันทั้งหมดทำงาน
- อัปเดตเอกสาร ถ้าจำเป็น
- ส่ง 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
เริ่มต้น
# โคลน 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)
การทดสอบ
# รันเทสต์ (เมื่อถูกสร้าง)
npm test
# รัน linter
npm run lint
เอกสาร
เมื่อเพิ่มฟีเจอร์ใหม่:
- อัปเดตเอกสารที่เกี่ยวข้อง ใน
docs/ - เพิ่มตัวอย่าง เพื่อแสดงการใช้งาน
- อัปเดต README.md ถ้ามีการเปลี่ยนแปลงที่ผู้ใช้เห็น
- เขียนเอกสารสองภาษา (EN + TH) เมื่อเป็นไปได้
มีคำถาม?
- เปิด issue พร้อมป้ายกำกับ
question - เข้าร่วมการสนทนาใน issues ที่มีอยู่
- ตรวจสอบ เอกสาร ก่อน
Thank you for contributing! 🎉 ขอบคุณสำหรับการมีส่วนร่วม! 🎉