This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Jekyll-based documentation website for Ray.Di, a PHP dependency injection framework inspired by Google Guice. The site is hosted at https://ray-di.github.io/ and serves comprehensive documentation in both English and Japanese.
./bin/serve_docker.shThis starts a Docker container with Jekyll server accessible at http://localhost:4000
Prerequisites: Ruby 3.2.3 (not later versions)
# Install dependencies
gem install jekyll bundler
bundle install
# Start development server
./bin/serve_local.shThe development server runs with --watch for automatic rebuilding.
Jekyll automatically builds the site when serving. The built site is output to _site/.
ruby bin/merge_md_files.rbThis script combines all manual markdown files into single-page versions for both languages.
php bin/generate_llms_full.phpThis script generates llms-full.txt by expanding linked markdown files from llms.txt for comprehensive AI assistant documentation.
manuals/1.0/en/- English documentation markdown filesmanuals/1.0/ja/- Japanese documentation markdown files_layouts/- Jekyll layout templatesdocs-en.html- English documentation layoutdocs-ja.html- Japanese documentation layoutindex.html- Homepage layout
_includes/manuals/1.0/- Reusable template components_site/- Generated static site (ignored in git)css/- Stylesheetsjs/- JavaScript filesimages/- Static assets
- Documentation files use Jekyll front matter with layout, title, category, and permalink
- English files use
layout: docs-en, Japanese files uselayout: docs-ja - Permalinks follow pattern
/manuals/1.0/{lang}/{filename}.html - The site automatically detects browser language and redirects to appropriate locale
llms-full.txt- Comprehensive Ray.Di documentation for AI assistants (based on llms.txt standard)- AI Assistant page (
ai-assistant.md) provides instructions for using Ray.Di with various AI tools - llms.txt Standard Compliance: Markdown files are directly accessible for AI consumption
- Responsive design with Bootstrap and custom CSS
- Table of contents generation for documentation pages
- Uses Kramdown markdown processor with Rouge syntax highlighter
- Configured for GitHub Pages compatibility
- Development server runs on port 4000
- Documentation files use descriptive names without numeric prefixes (e.g.,
installation.md,motivation.md) - Files are ordered explicitly in
bin/merge_md_files.rbfor generating combined pages - Best practices files in
bp/subdirectory use descriptive hyphenated names
- Uses Ruby 3.2 base image
- Installs build-essential and libffi-dev for native gem compilation
- Serves on all interfaces (0.0.0.0) for container access
- Duplicate content structure for English and Japanese
- JavaScript-based locale detection for homepage
- Shared layout templates with language-specific includes
- Markdown files are manually copied to
_sitedirectory for direct access - The
bin/copy_markdown_files.shscript copies all markdown files after Jekyll build - Development scripts (
serve_local.shand Docker) automatically run the copy script - URLs follow pattern:
/manuals/1.0/{lang}/{filename}.md(AI-accessible) and/manuals/1.0/{lang}/{filename}.html(human-readable) - Supports llms.txt standard for AI assistants to access clean markdown content
llms-full.txtprovides comprehensive framework documentation for AI consumption
The project includes Ray.Di framework as a Composer dependency for documentation examples and AI documentation generation:
composer install # Install Ray.Di framework dependencyIf building manually without the scripts:
bundle exec jekyll build
./bin/copy_markdown_files.shThe site includes a comprehensive tutorial system with a hierarchical structure:
manuals/1.0/{lang}/tutorial/- Main tutorial directory- Numbered directories (01-foundations, 02-basic-bindings, etc.) organize content progressively
- Each tutorial section has both complete implementations and incremental examples
- Tutorial navigation is automatically generated from directory structure
- English tutorials serve as the canonical source
- Japanese tutorials should mirror English structure but may have cultural adaptations
- New English tutorials require corresponding Japanese translations
- Use
manuals/1.0/en/tutorial/index.mdto understand the complete tutorial flow
When modifying documentation:
- Always read the corresponding file in both languages before making changes
- Check
bin/merge_md_files.rbfor file ordering in combined pages - Verify that changes maintain Jekyll front matter consistency
- Test both languages' navigation and linking after modifications
- Tutorial files follow
{section-number}-{topic-name}/{subtopic}.mdpattern - Best practices files use
bp/{DescriptiveName}.mdformat - All documentation requires Jekyll front matter with
layout,title,category, andpermalink - Front matter must be stripped from AI-accessible markdown copies in
_site/