Skip to content

Commit fb96594

Browse files
authored
Merge pull request #18 from be-framework/refactor-manual-chapters
Refactor manual chapters ja/en
2 parents 1639d3b + 76c3535 commit fb96594

45 files changed

Lines changed: 1679 additions & 2659 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CLAUDE.md‎

Lines changed: 51 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,82 +4,59 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This is a Jekyll-based documentation website for the Be Framework, a PHP framework focused on ontological programming concepts. The site serves as the manual and documentation hub, supporting both English and Japanese languages.
7+
Jekyll-based documentation website for the Be Framework, a PHP framework focused on ontological programming. Supports English and Japanese.
88

99
## Development Commands
1010

11-
### Local Development Server
1211
```bash
13-
./bin/serve.sh
12+
./bin/serve.sh # Start Jekyll dev server via Docker on port 4000
13+
docker compose up # Same as above
14+
bundle exec jekyll serve # If Ruby/Jekyll installed locally
1415
```
15-
This starts a Docker container running Jekyll server on port 4000.
16-
17-
### Alternative Development Methods
18-
- **Docker Compose**: `docker compose up` (same as serve.sh)
19-
- **Bundle/Jekyll**: `bundle exec jekyll serve` (if working locally with Ruby/Jekyll installed)
20-
21-
### Build Process
22-
Jekyll automatically builds the site when serving. The generated site is output to `_site/` directory.
23-
24-
## Architecture & Structure
25-
26-
### Core Structure
27-
- **Jekyll Configuration**: `_config.yml` - Main Jekyll configuration
28-
- **Content**: `manuals/1.0/` - Documentation content organized by version and language
29-
- **Layouts**: `_layouts/` - Jekyll templates for different page types
30-
- **Includes**: `_includes/` - Reusable template components, especially navigation
31-
- **Assets**: Static assets are in root and `_site/` after build
32-
33-
### Multi-language Support
34-
- **English**: `/manuals/1.0/en/`
35-
- **Japanese**: `/manuals/1.0/ja/`
36-
- Navigation templates automatically switch between languages
37-
- Layout templates: `docs-en.html` and `docs-ja.html`
38-
39-
### Manual Structure
40-
The Be Framework manual is organized in 12 chapters:
41-
1. Overview - Introduction to being-oriented programming
42-
2. Input Classes - Starting points of transformation
43-
3. Being Classes - Intermediate transformations
44-
4. Final Objects - Transformation destinations
45-
5. Metamorphosis Patterns - Transformation patterns
46-
6. Semantic Variables - Domain validation and type safety
47-
7. Type-Driven Metamorphosis - Self-determining objects
48-
8. Reason Layer - Ontological capabilities
49-
9. Error Handling - Semantic exceptions
50-
10. Philosophy Behind - Framework philosophy
51-
11. Semantic Logging - Metamorphosis tracking
52-
12. From Doing to Being - Paradigm overview
53-
54-
### Navigation System
55-
- Main navigation is defined in `_includes/manuals/1.0/en/contents.html` (and ja version)
56-
- Navigation automatically highlights current page
57-
- Language switching functionality built into templates
58-
- Table of contents generated dynamically for articles
59-
60-
### Jekyll Setup
61-
- Uses `minima` theme
62-
- Rouge syntax highlighter
63-
- Kramdown markdown processor
64-
- GitHub Pages compatible configuration
65-
- Docker-based development environment
66-
67-
## Key Files for Content Updates
68-
69-
### Adding New Manual Pages
70-
1. Create markdown file in appropriate language directory (`manuals/1.0/en/` or `/ja/`)
71-
2. Update navigation in `_includes/manuals/1.0/[lang]/contents.html`
72-
3. Add appropriate frontmatter with layout (`docs-en` or `docs-ja`)
73-
74-
### Modifying Site Structure
75-
- Main site configuration: `_config.yml`
76-
- Page layouts: `_layouts/`
77-
- Reusable components: `_includes/`
78-
- Styling: Source styles live under your theme or `assets/` (do not edit `_site/`; it is build output)
79-
80-
### Content Guidelines
81-
- Manual pages use specific Jekyll layouts (`docs-en`, `docs-ja`)
82-
- Index page uses special `index` layout
83-
- Navigation must be manually updated when adding pages
84-
- Consistent frontmatter required for proper rendering
85-
- Use page permalinks (`.html`) for cross-links, e.g., `./02-input-classes.html` (avoid linking to `.md`)
16+
17+
Jekyll builds to `_site/` automatically. Never edit files in `_site/` — it is build output.
18+
19+
## Architecture
20+
21+
### Page Rendering Pipeline
22+
23+
1. Markdown files in `manuals/1.0/{en,ja}/` with frontmatter
24+
2. Layout templates in `_layouts/` (`docs-en.html`, `docs-ja.html`, `index.html`, `index_ja.html`)
25+
3. Shared header/footer in `_includes/manuals/1.0/` (header, footer, language-specific contents)
26+
4. `_plugins/sidebar_generator.rb` auto-generates sidebar navigation from pages with `category: Manual`
27+
5. `_includes/manuals/1.0/{en,ja}/contents.html` renders the sidebar using Liquid, iterating `site.pages`
28+
29+
### Language Switching
30+
31+
Language toggle works by replacing `/en/` ↔ `/ja/` in the page's permalink. For this to work, English and Japanese pages must have **mirrored permalink paths** — e.g., `/manuals/1.0/en/01-overview.html` and `/manuals/1.0/ja/01-overview.html`.
32+
33+
### Required Page Frontmatter
34+
35+
Every manual page must include:
36+
37+
```yaml
38+
---
39+
layout: docs-en # or docs-ja
40+
title: "1. Overview"
41+
category: Manual
42+
permalink: /manuals/1.0/en/01-overview.html
43+
---
44+
```
45+
46+
- `layout` determines language-specific template and sidebar
47+
- `category: Manual` is required for sidebar inclusion
48+
- `permalink` must follow the pattern `/manuals/1.0/{lang}/{filename}.html`
49+
- Pages under `convention/` or with `sidebar: false` are excluded from sidebar
50+
51+
### Adding a New Manual Page
52+
53+
1. Create `.md` file in `manuals/1.0/en/` and `manuals/1.0/ja/` with proper frontmatter
54+
2. File naming: `NN-slug.md` (number prefix controls sort order in sidebar)
55+
3. Navigation sidebar is auto-generated — no manual nav update needed
56+
4. Cross-link to other pages using `.html` extensions (not `.md`): `./02-input-classes.html`
57+
58+
### Other Files
59+
60+
- `llms.txt` / `llms-full.txt` — LLM-friendly project documentation (linked from header as "LLMs")
61+
- `_plugins/sidebar_data.rb` / `sidebar_generator.rb` — Jekyll generators for sidebar data
62+
- `Dockerfile` — `jekyll/jekyll:pages` image with webrick

0 commit comments

Comments
 (0)