feat: Add optional MkDocs documentation setup with Material theme#4
Merged
feat: Add optional MkDocs documentation setup with Material theme#4
Conversation
## Summary
Add comprehensive MkDocs documentation system that integrates seamlessly with the `make init` process as an optional (default-on) feature.
## Features
- **Optional Integration**: Prompted during `make init` with default "yes"
- **Generic Templates**: Placeholder-based templates that generate project-specific docs
- **Complete Setup**: MkDocs + Material theme + mkdocstrings + GitHub Pages deployment
- **Template Documentation**: Current docs explain how to use the template itself
- **Generated Documentation**: Created docs describe the specific project being built
## Implementation
### Template System
- `templates/` directory with placeholder-based files (`{project_name}`, `{author_name}`, etc.)
- Templates for: mkdocs.yml, docs structure, GitHub Actions workflow
- Auto-generation during `make init` based on user inputs
### Integration Points
- Added to `scripts/init_project.py` as optional step after example code choice
- Makefile targets for docs operations (build, serve, check, clean)
- Conditional tests that work with or without docs enabled
- GitHub Actions workflow for automated deployment
### User Experience
```bash
make init
# → Project name, description, author (existing flow)
# → Documentation setup? (Y/n) [y] ← NEW optional step
# → Creates fully customized documentation for the project
```
## Technical Details
- Uses proven patterns from working MkDocs setups
- Integrates with existing uv-based dependency management
- Follows project's quality standards (tests, linting, type checking)
- Maintains backward compatibility for projects that skip docs
## Benefits
1. **Professional Documentation**: Every project can have beautiful, searchable docs
2. **Low Maintenance**: Auto-generated API docs + simple content structure
3. **GitHub Pages Ready**: Automatic deployment on main branch pushes
4. **Developer Friendly**: Local development server with hot reload
5. **Template Evolution**: Documentation setup improves as template updates
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix os.makedirs error when output_path has no parent directory - Fix docs_choice variable scope issue by using docs_enabled flag - Clarify example code prompt to show (1/2/3) for clearer default indication These fixes address issues discovered during UX testing of the documentation setup flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive MkDocs documentation system that integrates seamlessly with the
make initprocess as an optional (default-on) feature.🎯 Key Features
✅ Seamless Integration
make initworkflow: Prompted after example code choice✅ Generic Template System
{project_name},{author_name},{project_module_name}, etc.✅ Professional Documentation
make docs-serve🚀 User Experience
🛠️ What Gets Generated
When users choose "yes" for documentation:
📁 Implementation Details
New Files
templates/: Placeholder-based template filesmkdocs.yml.templatedocs/index.md.templatedocs/getting-started.md.templatedocs/reference/api.md.template.github/workflows/docs.yml.templateEnhanced Files
scripts/init_project.py: Addedsetup_documentation()functionMakefile: Added docs targets (install, build, serve, check, clean)docs/: Updated to describe template usage vs. project usagetests/test_docs_setup.py: Comprehensive conditional test coverageIntegration Points
dependency-groups.dev🧪 Testing
📊 Benefits
🔄 Backward Compatibility
This enhancement significantly increases the value proposition of the template by providing professional documentation setup out of the box while maintaining complete flexibility for projects that don't need it.
🤖 Generated with Claude Code