First off, thank you for considering contributing to NovelGenerator! 🎉
- How to Contribute
- Development Setup
- Code Style Guidelines
- Making Changes
- Reporting Issues
- Questions and Support
There are many ways to contribute:
- 🐛 Reporting bugs
- 💡 Suggesting enhancements
- 📝 Improving documentation
- 🔧 Submitting fixes
- ✨ Adding new features
-
Fork the repository:
- Visit https://github.com/kazkozdev/NovelGenerator
- Click the "Fork" button in the top right corner
-
Clone your fork:
git clone https://github.com/YOUR-USERNAME/NovelGenerator
cd NovelGenerator
- Set up development environment:
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install spaCy model
python -m spacy download en_core_web_sm
We keep it simple but consistent:
- Use clear, descriptive variable names:
# Good
chapter_content = generate_chapter(topic)
word_count = len(text.split())
# Bad
cont = gen(t)
wc = len(t.split())
- Add comments for complex logic:
# Good
# Calculate average emotion intensity across all chapters
avg_emotion = sum(emotions.values()) / len(emotions)
# Bad
avg_emotion = sum(emotions.values()) / len(emotions) # Calculate average
- Use docstrings for functions:
def improve_text(text: str) -> str:
"""
Improves the quality of generated text.
Args:
text: Input text to improve
Returns:
Improved version of the text
"""
- Keep functions focused and reasonably sized
- Create a new branch for your changes:
git checkout -b fix-issue-description
-
Make your changes and test them
-
Commit your changes:
git add .
git commit -m "brief description of changes"
- Push to your fork:
git push origin fix-issue-description
- Open a Pull Request:
- Visit your fork on GitHub
- Click "Pull Request"
- Fill in description of your changes
- Submit the PR
Keep commit messages clear and descriptive:
Good:
- "fix: memory leak in text generation"
- "add: new writing style option"
- "docs: update installation guide"
Bad:
- "fixed stuff"
- "updates"
- "changes"
When reporting issues, please include:
- What you were trying to do
- What happened instead
- Steps to reproduce the issue
- Python version
- Error messages (if any)
Example:
Title: Error when generating large chapters
Description:
- Tried to generate a 10-chapter book
- Program crashed on chapter 3
- Python 3.8.5
- Error: "Memory allocation failed"
Steps to reproduce:
1. Run novel_generator.py
2. Set chapter count to 10
3. Use topic "Epic Fantasy"
If you have questions:
- Check existing issues
- Create a new issue with the 'question' label
- Provide relevant context and examples
Made with ❤️ by the NovelGenerator community