Skip to content

fix: update index.html for Redoc#67

Merged
shimomo merged 1 commit intogh-pagesfrom
feature/add-openapi-docs
Aug 31, 2025
Merged

fix: update index.html for Redoc#67
shimomo merged 1 commit intogh-pagesfrom
feature/add-openapi-docs

Conversation

@shimomo
Copy link
Contributor

@shimomo shimomo commented Aug 31, 2025

index.html の書き方を間違えていたので修正しました。

Summary by CodeRabbit

  • 新機能

  • バグ修正

  • ドキュメント

    • API ドキュメントの表示方式を調整し、ReDoc のスクリプト読み込み位置を最適化して表示の安定性を向上。
    • ReDoc の参照先をローカルから公開ホストの OpenAPI 仕様 URL に更新し、常に最新の仕様を反映。
    • ヘッダー内の不要なスクリプト参照を削除し、読み込み順序を整理。

@coderabbitai
Copy link

coderabbitai bot commented Aug 31, 2025

Walkthrough

docs/v2/index.htmlで、ReDocの読み込み位置をheadからbody末尾へ移動し、spec-urlをローカルopenapi.jsonからhttps://boatraceopenapi.github.io/programs/v2/openapi.jsonに変更。末尾にRedocバンドルのscriptタグを追加。

Changes

Cohort / File(s) Summary
Docs: ReDoc 埋め込み調整
docs/v2/index.html
head内のRedocスクリプト削除/body末尾にRedocスクリプト追加、ReDocのspec-urlをopenapi.jsonからhttps://boatraceopenapi.github.io/programs/v2/openapi.jsonへ更新

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant U as User
    participant B as Browser
    participant H as docs/v2/index.html
    participant S as Redoc Bundle
    participant R as ReDoc
    participant O as OpenAPI Spec (GH Pages)

    U->>B: アクセス
    B->>H: HTML取得
    Note over H,B: スクリプトがbody末尾に配置(変更点)
    B->>S: Redocバンドル読み込み
    S->>R: 初期化
    R->>O: GET https://boatraceopenapi.github.io/programs/v2/openapi.json(変更点)
    O-->>R: OpenAPI JSON
    R-->>B: ドキュメント描画
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

ぼくは跳ねるドキュメント兎、ぴょんぴょん
headからbodyへ、タグをお引越し
URLも新しい巣へ一直線
ReDocがひらく海路の地図
風は軽く、リンクはまっすぐ 🌊🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add-openapi-docs

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/v2/index.html (1)

9-9: script タグ内の不要な空白の削除+CDNバージョン固定の検討

  • 末尾の空白テキストノードは不要なので削除を。
  • 「latest」では将来の破壊的変更の影響を受け得るため、可能なら CDN の特定バージョンに固定する運用を検討してください。

適用例(空白削除のみ):

-    <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script>
+    <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 20d310c and 6c13fab.

📒 Files selected for processing (1)
  • docs/v2/index.html (1 hunks)
🔇 Additional comments (1)
docs/v2/index.html (1)

8-8: spec-url の絶対URL化は妥当。公開場所の恒久性だけ確認してください。
GitHub Pages 上で当該 JSON が常時このパスで配信される前提(将来の配置変更やファイル名変更がないこと)と、正しい Content-Type で配信されているかを確認してください。

@shimomo shimomo merged commit 595b933 into gh-pages Aug 31, 2025
6 checks passed
@shimomo shimomo deleted the feature/add-openapi-docs branch August 31, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant