|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is the documentation repository for Doma, a database access framework for Java. The documentation is built using Sphinx and hosted on ReadTheDocs. The repository manages: |
| 8 | + |
| 9 | +- English documentation (primary) |
| 10 | +- Japanese translation via Crowdin integration |
| 11 | +- Multiple output formats (HTML, PDF, ePub) |
| 12 | + |
| 13 | +## Development Commands |
| 14 | + |
| 15 | +### Setup |
| 16 | +```bash |
| 17 | +cd docs |
| 18 | +pip install -r requirements.txt |
| 19 | +``` |
| 20 | + |
| 21 | +### Local Development |
| 22 | +```bash |
| 23 | +# Start auto-rebuilding server for local development |
| 24 | +cd docs |
| 25 | +sphinx-autobuild . _build/html |
| 26 | +# Visit http://127.0.0.1:8000 |
| 27 | +``` |
| 28 | + |
| 29 | +### Building Documentation |
| 30 | +```bash |
| 31 | +cd docs |
| 32 | +# Build HTML |
| 33 | +make html |
| 34 | + |
| 35 | +# Build all formats |
| 36 | +make |
| 37 | +``` |
| 38 | + |
| 39 | +### Localization (for maintainers only) |
| 40 | +```bash |
| 41 | +cd docs |
| 42 | +# Generate POT files for translation |
| 43 | +sphinx-build -b gettext . _build/gettext |
| 44 | + |
| 45 | +# Upload to Crowdin (admin only) |
| 46 | +crowdin push |
| 47 | + |
| 48 | +# Download translations (admin only) |
| 49 | +crowdin pull |
| 50 | +``` |
| 51 | + |
| 52 | +## Architecture |
| 53 | + |
| 54 | +### File Structure |
| 55 | +- `/docs/` - Main documentation source in reStructuredText (.rst) format |
| 56 | +- `/docs/_static/` - Static assets (CSS, images, etc.) |
| 57 | +- `/docs/locale/ja/LC_MESSAGES/` - Japanese translation files (.po) |
| 58 | +- `/docs/conf.py` - Sphinx configuration with version variables and Jinja templating |
| 59 | +- `/docs/requirements.txt` - Python dependencies for Sphinx |
| 60 | + |
| 61 | +### Documentation Organization |
| 62 | +- Documentation follows a hierarchical structure with `index.rst` as the master document |
| 63 | +- Content is organized into logical sections: getting-started, config, basic, domain, entity, query/, etc. |
| 64 | +- Each section can contain multiple .rst files with cross-references |
| 65 | + |
| 66 | +### Version Management |
| 67 | +Version numbers for Doma and related tools are centrally managed in `docs/conf.py` in the `html_context` dictionary: |
| 68 | +- `doma_version`: Core Doma framework version |
| 69 | +- `doma_compile_version`: Compile plugin version |
| 70 | +- `doma_codegen_version`: Code generation plugin version |
| 71 | +- Additional plugin versions as needed |
| 72 | + |
| 73 | +These variables can be used in documentation via Jinja templating. |
| 74 | + |
| 75 | +### Translation Workflow |
| 76 | +- English content is written in .rst files |
| 77 | +- Crowdin integration automatically generates .pot files for translators |
| 78 | +- Japanese translations are managed via Crowdin project: https://crowdin.com/project/doma-docs |
| 79 | +- Translated .po files are stored in `/docs/locale/ja/LC_MESSAGES/` |
| 80 | + |
| 81 | +## Content Guidelines |
| 82 | + |
| 83 | +- Use reStructuredText (.rst) format for all documentation |
| 84 | +- Follow existing section hierarchy and cross-referencing patterns |
| 85 | +- Include code examples with proper syntax highlighting |
| 86 | +- Version-specific information should use the variables from conf.py |
| 87 | +- Images should be placed in `/docs/images/` directory |
0 commit comments