- Add complete Sphinx documentation structure - Include API reference, tutorials, and examples - Add GitHub Actions workflow for auto-deployment - Include custom CSS and JavaScript for enhanced UI - Add Makefile with build commands - Include requirements for documentation dependencies - Add quick start tutorial and getting started guide - Configure Read the Docs theme with custom styling - Add spell checking, link checking, and quality tools - Set up automatic deployment to GitHub Pages Documentation includes: - Getting started guide with installation and basic usage - Comprehensive examples for all major features - Complete API reference with type hints - Tutorials for different use cases - Custom styling with SemantiCore branding - Mobile-responsive design - Dark mode support - Performance optimization guides
SemantiCore Documentation
This directory contains the complete documentation for SemantiCore, built using Sphinx.
📁 Directory Structure
docs/
├── conf.py # Sphinx configuration
├── index.rst # Main documentation index
├── getting_started.rst # Getting started guide
├── examples.rst # Comprehensive examples
├── api/ # API documentation
│ └── index.rst # API reference index
├── tutorials/ # Tutorial guides
├── examples/ # Code examples
├── _static/ # Static assets
│ ├── css/ # Custom CSS
│ │ └── custom.css
│ └── js/ # Custom JavaScript
│ └── custom.js
├── _templates/ # Custom templates
├── Makefile # Build commands
└── README.md # This file
🚀 Quick Start
Prerequisites
- Python 3.8+
- pip
Installation
-
Install documentation dependencies:
pip install -e ".[docs]" -
Or install manually:
pip install sphinx sphinx-rtd-theme sphinx-copybutton sphinx-tabs myst-parser
Building Documentation
-
Build HTML documentation:
cd docs make html -
Serve locally:
make serve -
Build all formats:
make all
📋 Available Commands
Basic Commands
make html- Build HTML documentationmake pdf- Build PDF documentationmake epub- Build EPUB documentationmake clean- Clean build directory
Quality Checks
make linkcheck- Check for broken linksmake doctest- Run doctestsmake spelling- Spell check documentation
Development
make serve- Serve documentation locallymake dev- Build and serve (development)make full- Full build with all checks
Advanced
make install-deps- Install documentation dependenciesmake api- Generate API documentationmake update- Update all documentationmake deploy- Deploy to GitHub Pages
🎨 Customization
CSS Customization
Edit _static/css/custom.css to customize the appearance:
:root {
--semanticore-primary: #2980B9;
--semanticore-secondary: #27AE60;
--semanticore-accent: #8E44AD;
}
JavaScript Customization
Edit _static/js/custom.js to add interactive features:
// Add custom functionality
document.addEventListener('DOMContentLoaded', function() {
// Your custom code here
});
Theme Configuration
Modify conf.py to change theme options:
html_theme_options = {
'navigation_depth': 4,
'titles_only': False,
'collapse_navigation': False,
'sticky_navigation': True,
}
📝 Writing Documentation
RST Files
Use reStructuredText (RST) for documentation:
Title
=====
Section
--------
Subsection
~~~~~~~~~~
.. code-block:: python
def example():
return "Hello, World!"
.. note::
This is a note.
.. warning::
This is a warning.
Markdown Files
Use MyST Markdown for simpler syntax:
# Title
## Section
### Subsection
```python
def example():
return "Hello, World!"
::: note This is a note. :::
::: warning This is a warning. :::
### Code Examples
Include code examples with syntax highlighting:
```rst
.. code-block:: python
from semanticore import SemantiCore
core = SemantiCore()
result = core.process_document("document.pdf")
API Documentation
Use autodoc for automatic API documentation:
.. automodule:: semanticore.core.engine
:members:
:undoc-members:
:show-inheritance:
🔧 Configuration
Sphinx Configuration
Key settings in conf.py:
- Extensions: List of Sphinx extensions
- Theme: Read the Docs theme
- Static files: CSS and JavaScript
- Intersphinx: Links to other documentation
Build Configuration
Environment variables:
export SPHINXOPTS="-W --keep-going"
export SPHINXBUILD=sphinx-build
🚀 Deployment
GitHub Pages
-
Automatic deployment (via GitHub Actions):
- Push to
mainbranch - Documentation builds automatically
- Deployed to
gh-pagesbranch
- Push to
-
Manual deployment:
make deploy
Read the Docs
- Connect repository to Read the Docs
- Documentation builds automatically
- Available at
https://semanticore.readthedocs.io
🧪 Testing
Link Checking
make linkcheck
Spell Checking
make spelling
Doctests
make doctest
Full Test Suite
make full
📊 Analytics
The documentation includes Google Analytics 4 tracking:
- Page views
- User engagement
- Performance metrics
Configure in _static/js/custom.js:
gtag('config', 'G-XXXXXXXXXX'); // Replace with actual GA4 ID
🤝 Contributing
Adding New Documentation
- Create new RST or MD file
- Add to appropriate toctree
- Follow style guidelines
- Test locally before submitting
Style Guidelines
- Use clear, concise language
- Include code examples
- Add appropriate warnings/notes
- Test all links
- Spell check content
Review Process
- Build documentation locally
- Check for broken links
- Verify code examples work
- Submit pull request
- Automated checks run
- Manual review by maintainers
🐛 Troubleshooting
Common Issues
Build fails with import errors:
pip install -e ".[docs]"
Missing dependencies:
make install-deps
Broken links:
make linkcheck
Spelling errors:
make spelling
Performance Issues
- Use
make cleanbefore rebuilding - Check for large images
- Optimize CSS/JS files
- Use appropriate image formats
📚 Resources
📞 Support
- Documentation Issues: GitHub Issues
- Questions: GitHub Discussions
- Community: Discord Server
- Email: docs@semanticore.io
This documentation is built with ❤️ by the SemantiCore community.