Skip to content

Commit cd0f0b4

Browse files
yhk1038claude
andcommitted
chore: update docs, lib, and Rakefile for docs verification
- Update README files (en, ja, ko) with latest content - Update editor docs (vscode, vim, neovim, syntax-highlighting) - Enhance DocsExampleExtractor with improved extraction logic - Enhance DocsExampleVerifier with better verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b3cb04a commit cd0f0b4

File tree

18 files changed

+88
-44
lines changed

18 files changed

+88
-44
lines changed

README.ja.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ end
105105
- TypeScript のように、型がコードの中にあります。
106106
- `.trb` で書けば、`trc``.rb``.rbs` の両方を生成します。
107107

108-
```ruby
108+
```trb
109109
# greet.trb
110110
def greet(name: String): String
111111
"Hello, #{name}!"
@@ -149,7 +149,7 @@ trc --version
149149

150150
### 1. `.trb` を書く
151151

152-
```ruby
152+
```trb
153153
# hello.trb
154154
def greet(name: String): String
155155
"Hello, #{name}!"

README.ko.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ end
105105
- TypeScript처럼, 타입이 코드 안에 있습니다.
106106
- `.trb`로 작성하면 `trc``.rb``.rbs`를 모두 생성합니다.
107107

108-
```ruby
108+
```trb
109109
# greet.trb
110110
def greet(name: String): String
111111
"Hello, #{name}!"
@@ -149,7 +149,7 @@ trc --version
149149

150150
### 1. `.trb` 작성
151151

152-
```ruby
152+
```trb
153153
# hello.trb
154154
def greet(name: String): String
155155
"Hello, #{name}!"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ end
110110
- Like TypeScript, types live inside your code.
111111
- Write `.trb`, and `trc` generates both `.rb` and `.rbs`.
112112

113-
```ruby
113+
```trb
114114
# greet.trb
115115
def greet(name: String): String
116116
"Hello, #{name}!"
@@ -154,7 +154,7 @@ trc --version
154154

155155
### 1. Write `.trb`
156156

157-
```ruby
157+
```trb
158158
# hello.trb
159159
def greet(name: String): String
160160
"Hello, #{name}!"

Rakefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@ namespace :docs do
1515
verifier = TRuby::DocsExampleVerifier.new
1616

1717
# Default patterns to check
18+
# Includes both local docs and t-ruby.github.io documentation site
19+
docs_site_path = "../t-ruby.github.io"
1820
patterns = [
1921
"docs/**/*.md",
2022
"README.md",
2123
"README.ja.md",
2224
"README.ko.md",
2325
]
2426

27+
# Add t-ruby.github.io documentation if directory exists
28+
if Dir.exist?(docs_site_path)
29+
patterns += [
30+
"#{docs_site_path}/docs/**/*.md",
31+
"#{docs_site_path}/i18n/ko/docusaurus-plugin-content-docs/current/**/*.md",
32+
"#{docs_site_path}/i18n/ja/docusaurus-plugin-content-docs/current/**/*.md",
33+
]
34+
end
35+
2536
puts "Verifying documentation examples..."
2637
puts
2738

@@ -55,13 +66,22 @@ namespace :docs do
5566
verifier = TRuby::DocsExampleVerifier.new
5667
generator = TRuby::DocsBadgeGenerator.new
5768

69+
docs_site_path = "../t-ruby.github.io"
5870
patterns = [
5971
"docs/**/*.md",
6072
"README.md",
6173
"README.ja.md",
6274
"README.ko.md",
6375
]
6476

77+
if Dir.exist?(docs_site_path)
78+
patterns += [
79+
"#{docs_site_path}/docs/**/*.md",
80+
"#{docs_site_path}/i18n/ko/docusaurus-plugin-content-docs/current/**/*.md",
81+
"#{docs_site_path}/i18n/ja/docusaurus-plugin-content-docs/current/**/*.md",
82+
]
83+
end
84+
6585
puts "Generating documentation coverage badge..."
6686

6787
all_results = []
@@ -87,13 +107,22 @@ namespace :docs do
87107

88108
extractor = TRuby::DocsExampleExtractor.new
89109

110+
docs_site_path = "../t-ruby.github.io"
90111
patterns = [
91112
"docs/**/*.md",
92113
"README.md",
93114
"README.ja.md",
94115
"README.ko.md",
95116
]
96117

118+
if Dir.exist?(docs_site_path)
119+
patterns += [
120+
"#{docs_site_path}/docs/**/*.md",
121+
"#{docs_site_path}/i18n/ko/docusaurus-plugin-content-docs/current/**/*.md",
122+
"#{docs_site_path}/i18n/ja/docusaurus-plugin-content-docs/current/**/*.md",
123+
]
124+
end
125+
97126
all_examples = []
98127
patterns.each do |pattern|
99128
examples = extractor.extract_from_glob(pattern)

docs/neovim/en/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ vim.api.nvim_create_autocmd("FileType", {
203203

204204
1. Create `hello.trb`:
205205

206-
```ruby
206+
```trb
207207
type UserId = String
208208
209209
interface User

docs/neovim/ja/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ vim.api.nvim_create_autocmd("FileType", {
203203

204204
1. `hello.trb`を作成:
205205

206-
```ruby
206+
```trb
207207
type UserId = String
208208
209209
interface User

docs/neovim/ko/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ vim.api.nvim_create_autocmd("FileType", {
203203

204204
1. `hello.trb` 생성:
205205

206-
```ruby
206+
```trb
207207
type UserId = String
208208
209209
interface User

docs/syntax-highlighting/en/guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ T-Ruby syntax highlighting provides visual distinction for:
1919

2020
### Type Aliases
2121

22-
```ruby
22+
```trb
2323
type UserId = String # 'type' keyword, 'UserId' as type name
2424
type Age = Integer # '=' operator, built-in type
2525
type UserMap = Hash<UserId, User> # Generic type
2626
```
2727

2828
### Interfaces
2929

30-
```ruby
30+
```trb
3131
interface Printable # 'interface' keyword, interface name
3232
to_string: String # Member name, type annotation
3333
print: void
@@ -36,7 +36,7 @@ end # 'end' keyword
3636

3737
### Functions with Type Annotations
3838

39-
```ruby
39+
```trb
4040
def greet(name: String): String # Function name, param with type, return type
4141
"Hello, #{name}!"
4242
end
@@ -48,7 +48,7 @@ end
4848

4949
### Union and Intersection Types
5050

51-
```ruby
51+
```trb
5252
type StringOrInt = String | Integer # Union type with '|'
5353
type ReadWrite = Readable & Writable # Intersection type with '&'
5454
type MaybeString = String | nil # Nullable type
@@ -167,7 +167,7 @@ vim.api.nvim_create_autocmd("ColorScheme", {
167167

168168
### Simple Example
169169

170-
```ruby
170+
```trb
171171
# simple.trb - Basic T-Ruby syntax
172172
173173
type UserId = String
@@ -180,7 +180,7 @@ end
180180

181181
### Complex Example
182182

183-
```ruby
183+
```trb
184184
# complex.trb - Advanced T-Ruby syntax
185185
186186
type UserId = String

docs/syntax-highlighting/ja/guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ T-Rubyシンタックスハイライトは以下の要素を視覚的に区別
1919

2020
### 型エイリアス
2121

22-
```ruby
22+
```trb
2323
type UserId = String # 'type'キーワード、'UserId'を型名として
2424
type Age = Integer # '='演算子、組み込み型
2525
type UserMap = Hash<UserId, User> # ジェネリック型
2626
```
2727

2828
### インターフェース
2929

30-
```ruby
30+
```trb
3131
interface Printable # 'interface'キーワード、インターフェース名
3232
to_string: String # メンバー名、型アノテーション
3333
print: void
@@ -36,7 +36,7 @@ end # 'end'キーワード
3636

3737
### 型アノテーション付き関数
3838

39-
```ruby
39+
```trb
4040
def greet(name: String): String # 関数名、型付きパラメータ、戻り値型
4141
"こんにちは、#{name}さん!"
4242
end
@@ -48,7 +48,7 @@ end
4848

4949
### ユニオンとインターセクション型
5050

51-
```ruby
51+
```trb
5252
type StringOrInt = String | Integer # '|'を使ったユニオン型
5353
type ReadWrite = Readable & Writable # '&'を使ったインターセクション型
5454
type MaybeString = String | nil # Nullable型
@@ -167,7 +167,7 @@ vim.api.nvim_create_autocmd("ColorScheme", {
167167

168168
### シンプルな例
169169

170-
```ruby
170+
```trb
171171
# simple.trb - 基本的なT-Ruby構文
172172
173173
type UserId = String
@@ -180,7 +180,7 @@ end
180180

181181
### 複雑な例
182182

183-
```ruby
183+
```trb
184184
# complex.trb - 高度なT-Ruby構文
185185
186186
type UserId = String

docs/syntax-highlighting/ko/guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ T-Ruby 구문 강조는 다음 요소들을 시각적으로 구분합니다:
1919

2020
### 타입 별칭
2121

22-
```ruby
22+
```trb
2323
type UserId = String # 'type' 키워드, 'UserId' 타입명
2424
type Age = Integer # '=' 연산자, 내장 타입
2525
type UserMap = Hash<UserId, User> # 제네릭 타입
2626
```
2727

2828
### 인터페이스
2929

30-
```ruby
30+
```trb
3131
interface Printable # 'interface' 키워드, 인터페이스명
3232
to_string: String # 멤버명, 타입 어노테이션
3333
print: void
@@ -36,7 +36,7 @@ end # 'end' 키워드
3636

3737
### 타입 어노테이션이 있는 함수
3838

39-
```ruby
39+
```trb
4040
def greet(name: String): String # 함수명, 타입이 있는 매개변수, 반환 타입
4141
"안녕하세요, #{name}님!"
4242
end
@@ -48,7 +48,7 @@ end
4848

4949
### 유니온 및 인터섹션 타입
5050

51-
```ruby
51+
```trb
5252
type StringOrInt = String | Integer # '|'를 사용한 유니온 타입
5353
type ReadWrite = Readable & Writable # '&'를 사용한 인터섹션 타입
5454
type MaybeString = String | nil # Nullable 타입
@@ -167,7 +167,7 @@ vim.api.nvim_create_autocmd("ColorScheme", {
167167

168168
### 간단한 예제
169169

170-
```ruby
170+
```trb
171171
# simple.trb - 기본 T-Ruby 구문
172172
173173
type UserId = String
@@ -180,7 +180,7 @@ end
180180

181181
### 복잡한 예제
182182

183-
```ruby
183+
```trb
184184
# complex.trb - 고급 T-Ruby 구문
185185
186186
type UserId = String

0 commit comments

Comments
 (0)