メソッド署名に since/until バージョンバッジを表示する#272
Merged
Merged
Conversation
bitclust#132 P3。MethodEntry の名前別 since_map/until_map(P2)を 実際に画面へ描画する。<span class="method-since-badge">Ruby X から </span> / <span class="method-until-badge">Ruby X で削除</span> を <dt class="method-heading"> の </code> の直後・permalink の手前に出す。 - 共通ロジックは BitClust::VersionBadges(lib/bitclust/version_badges.rb) に切り出し、RDCompiler と TemplateScreen の両方に include する (MDCompiler は RDCompiler#method_signature を再利用しているので そのまま両対応になる)。 - since/until は独立に判定する: エイリアス全名が同じバージョンなら 「一様」とみなし最初の <dt> にだけ出す。名前ごとに値が異なる/一部 にしか無い場合は、該当する名前の <dt> にだけ出す。 - 唯一 compile_method を経由しない data/bitclust/template/class (動的サーバー配信用)は、署名行ごとに個別の <a><code>...</code></a> を組み立てて自分の名前のバッジを付けるよう最小限に再構成した (from TemplateScreen#method_row_signature_html)。 - カタログキー "since Ruby %s" / "removed in Ruby %s" を追加 (ja_JP.UTF-8 のみ既存。C ロケールはキーがそのまま英語文になる)。 - 両テーマ(default/lillia)にピル型バッジの CSS を追加。 since/until が空(既存データは全て空)なら何も出ないため、RDCompiler の 既存の全出力は不変(既存テストはそのまま green)。default テンプレートの 署名欄のみ、別名ごとにバッジを付けられるよう構造を変えている。 RBS は VersionBadges に自己型 `: Translatable, HTMLUtils` を付けて _()/escape_html の呼び出しを通した。rbs validate / steep check とも エラー0。 refs rurema#132 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#132 の P3: バージョンバッジ表示です(P2 の算出サブコマンド PR がベース。P2 マージ後にレビュー・マージしてください)。
P1/P2 で DB に入る名前別 since/until を画面に描画します。データが空(現状の全 DB)なら出力は従来と完全同一で、
methodsinceを流した DB からバッジが現れます。<dt class="method-heading">に、</code>直後・permalink の手前でバッジを挿入<span class="method-since-badge">Ruby 3.2 から</span>/ until:<span class="method-until-badge">Ruby 4.0 で削除</span>(カタログキーsince Ruby %s/removed in Ruby %s。C ロケールは英語キーのまま表示)BitClust::VersionBadges(新規 mixin)に切り出し、RDCompilerとTemplateScreenの両方に includeRDCompiler#method_signatureへの 1 行挿入で、メソッドページ(全4テンプレート系統)と offline/epub/lillia のクラスページのインライン本文をすべてカバー(MDCompiler は同メソッドを再利用しているので Markdown 原稿も両対応)template/classの署名欄のみ、別名ごとに<a><code>…</code></a>+自分のバッジの行に最小限再構成(バッジを名前単位で付けるため。空マップでも構造は変わるが表示テキストは同一。statichtml には影響なし)ul.class-toc)へのコンパクト表示は今回は見送り(多段組の名前リストに文言バッジは密度的に厳しいため。必要なら表記を決めて追加します)検証
rbs validate・steep checkエラーなし(mixin は自己型: Translatable, HTMLUtils)methodsinceを適用済みの db-1.9.3 複製に対し template.offline で描画 →String#prependのメソッドページにRuby 1.9.3 からバッジ・floor のString#length(+別名 size)は完全無出力・String クラスページはインライン本文に 30 個のバッジを確認refs #132
🤖 Generated with Claude Code