Skip to content

Commit 4ed2864

Browse files
author
Tuan
authored
Merge pull request #15 from avixiii-dev/develop
docs: enhance project documentation
2 parents 8166704 + 5729fba commit 4ed2864

File tree

3 files changed

+513
-3
lines changed

3 files changed

+513
-3
lines changed

.github/pull_request_template.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Description
2+
<!-- Provide a brief description of the changes in this PR -->
3+
4+
This PR enhances the project documentation by adding comprehensive API reference, user guide, and contributing guidelines.
5+
6+
### Changes Made
7+
- Add comprehensive API documentation with examples
8+
- Include detailed user guide with practical examples
9+
- Add best practices section covering performance, SEO, security, and monitoring
10+
- Create CONTRIBUTING.md with detailed contribution guidelines
11+
- Update README.md with quick-start contributing section
12+
13+
## Type of Change
14+
<!-- Mark the appropriate option with an [x] -->
15+
16+
- [ ] Bug fix (non-breaking change which fixes an issue)
17+
- [ ] New feature (non-breaking change which adds functionality)
18+
- [x] Documentation update
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20+
21+
## Testing
22+
<!-- Describe the testing you have performed -->
23+
24+
- [x] Verified all documentation links are working
25+
- [x] Checked code examples for accuracy
26+
- [x] Validated markdown formatting
27+
- [x] Ensured consistency with existing documentation
28+
29+
## Checklist
30+
<!-- Mark completed items with an [x] -->
31+
32+
- [x] My code follows the style guidelines of this project
33+
- [x] I have performed a self-review of my own changes
34+
- [x] I have commented my code, particularly in hard-to-understand areas
35+
- [x] I have made corresponding changes to the documentation
36+
- [x] My changes generate no new warnings
37+
- [x] I have added tests that prove my fix is effective or that my feature works
38+
- [x] New and existing unit tests pass locally with my changes
39+
- [x] Any dependent changes have been merged and published in downstream modules
40+
41+
## Additional Notes
42+
<!-- Add any additional notes or context about the PR here -->
43+
44+
The documentation improvements aim to make the project more accessible to new contributors and provide clearer guidance for users implementing SEO optimization in their Django projects.

CONTRIBUTING.md

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Contributing to Django SEO Optimizer
2+
3+
First off, thank you for considering contributing to Django SEO Optimizer! It's people like you that make Django SEO Optimizer such a great tool.
4+
5+
## Code of Conduct
6+
7+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
13+
Before creating bug reports, please check the issue list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
14+
15+
* Use a clear and descriptive title
16+
* Describe the exact steps which reproduce the problem
17+
* Provide specific examples to demonstrate the steps
18+
* Describe the behavior you observed after following the steps
19+
* Explain which behavior you expected to see instead and why
20+
* Include details about your configuration and environment
21+
22+
### Suggesting Enhancements
23+
24+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
25+
26+
* Use a clear and descriptive title
27+
* Provide a step-by-step description of the suggested enhancement
28+
* Provide specific examples to demonstrate the steps
29+
* Describe the current behavior and explain which behavior you expected to see instead
30+
* Explain why this enhancement would be useful
31+
32+
### Pull Requests
33+
34+
* Fill in the required template
35+
* Do not include issue numbers in the PR title
36+
* Follow the Python style guide
37+
* Include thoughtfully-worded, well-structured tests
38+
* Document new code
39+
* End all files with a newline
40+
41+
## Development Process
42+
43+
1. Fork the repo and create your branch from `develop`
44+
2. Install development dependencies:
45+
```bash
46+
pip install -e ".[dev]"
47+
```
48+
3. Run tests to ensure everything is working:
49+
```bash
50+
pytest
51+
```
52+
4. Make your changes and add tests
53+
5. Run the test suite again
54+
6. Push to your fork and submit a pull request
55+
56+
## Testing
57+
58+
We use pytest for our test suite. To run tests:
59+
60+
```bash
61+
# Run all tests
62+
pytest
63+
64+
# Run specific test file
65+
pytest tests/test_fields.py
66+
67+
# Run with coverage report
68+
pytest --cov=seo_optimizer
69+
```
70+
71+
### Writing Tests
72+
73+
* Write test docstrings
74+
* Each test should have a single assertion
75+
* Use descriptive test names
76+
* Follow the Arrange-Act-Assert pattern
77+
78+
Example:
79+
```python
80+
def test_metadata_field_validates_max_length():
81+
"""Test that MetadataField correctly validates max_length."""
82+
# Arrange
83+
field = MetadataField(max_length=10)
84+
85+
# Act & Assert
86+
with pytest.raises(ValidationError):
87+
field.clean("This is too long")
88+
```
89+
90+
## Style Guide
91+
92+
We follow PEP 8 with some modifications:
93+
94+
* Line length limit is 100 characters
95+
* Use double quotes for strings
96+
* Use trailing commas in multi-line structures
97+
* Sort imports using isort
98+
99+
Use black for code formatting:
100+
```bash
101+
black seo_optimizer
102+
```
103+
104+
## Documentation
105+
106+
* Use Google-style docstrings
107+
* Update the README.md if needed
108+
* Add docstrings to all public methods
109+
* Include code examples in docstrings
110+
* Update type hints
111+
112+
Example:
113+
```python
114+
def get_metadata(
115+
self,
116+
path: str,
117+
language: Optional[str] = None
118+
) -> Dict[str, Any]:
119+
"""Get metadata for the given path and language.
120+
121+
Args:
122+
path: The URL path to get metadata for
123+
language: Optional language code (e.g., 'en', 'es')
124+
125+
Returns:
126+
Dictionary containing metadata fields
127+
128+
Example:
129+
>>> meta = MetadataManager().get_metadata('/products/')
130+
>>> print(meta['title'])
131+
'Our Products'
132+
"""
133+
```
134+
135+
## Commit Messages
136+
137+
* Use the present tense ("Add feature" not "Added feature")
138+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
139+
* Limit the first line to 72 characters or less
140+
* Reference issues and pull requests liberally after the first line
141+
142+
Example:
143+
```
144+
Add async support for metadata retrieval
145+
146+
- Implement AsyncMetadataManager
147+
- Add async_get_metadata method
148+
- Update documentation with async examples
149+
150+
Fixes #123
151+
```
152+
153+
## Release Process
154+
155+
1. Update version in `seo_optimizer/version.py`
156+
2. Update CHANGELOG.md
157+
3. Create release notes
158+
4. Tag the release
159+
5. Push to PyPI
160+
161+
## Questions?
162+
163+
Feel free to contact the project maintainers if you have any questions or need help with the contribution process.
164+
165+
## License
166+
167+
By contributing, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)