Skip to content

Commit 3712164

Browse files
authored
Merge pull request #81 from myoshi2891/coderabbitai/docstrings/f93caad
📝 Add docstrings to `dev`
2 parents f93caad + f69ed58 commit 3712164

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

app/istqb-ctfl-complete-guide/NavBar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import { useEffect } from 'react';
44

55
/**
6-
* ISTQB CTFL v4.0 完全解説ガイド用の左固定サイドバーナビゲーション。
7-
* スクロール位置に応じてアクティブなセクションのリンクに `active` クラスおよび `aria-current="location"` を設定します。
6+
* 左固定の章ナビゲーションを表示します。
7+
*
8+
* スクロール位置に応じて、表示中のセクションに対応するリンクへ `active` クラスと `aria-current="location"` を設定します。
89
*/
910
export default function NavBar() {
1011
useEffect(() => {

app/istqb-ctfl-complete-guide/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import NavBar from './NavBar';
32
import Mermaid from '../../components/Mermaid';
43
import './istqb-ctfl-complete-guide.css';
@@ -8,6 +7,9 @@ export const metadata = {
87
description: 'ISTQB Certified Tester Foundation Level (CTFL) v4.0 のシラバス v4.0.1 に完全準拠した日本語解説ガイド。',
98
};
109

10+
/**
11+
* Renders the ISTQB CTFL v4.0.1 complete guide page.
12+
*/
1113
export default function IstqbCtflCompleteGuide() {
1214
return (
1315
<div className="layout istqb-ctfl-layout">

components/Mermaid.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ interface MermaidProps {
3232
}
3333

3434
/**
35-
* SVG 後処理(fix-mermaid スキルの正準 applySvgFixups 実装)。
35+
* Adjusts a rendered Mermaid SVG for layout and sizing.
3636
*
37-
* - width/height 属性を除去し viewBox 由来の自然 px 幅 + maxWidth:100% を設定する。
38-
* (width:'100%' は intrinsic サイズを持たない SVG をコンテナ全幅へ伸ばすため使わない。)
39-
* - viewBox 高さを +extraHeight px 拡張して下部見切れを防ぐ。
40-
* - overflow:visible で viewBox からの数 px はみ出しを描画する。
37+
* @param chart - The Mermaid diagram source, used to determine the extra bottom padding for some diagram types.
4138
*/
4239
function applySvgFixups(svgEl: SVGSVGElement, chart: string): void {
4340
svgEl.removeAttribute('width');
@@ -70,12 +67,9 @@ function applySvgFixups(svgEl: SVGSVGElement, chart: string): void {
7067
}
7168

7269
/**
73-
* Mermaid ダイアグラムを描画するコンポーネント。
70+
* Renders a Mermaid diagram from a chart definition.
7471
*
75-
* fix-mermaid スキルの正準実装に準拠:
76-
* - SVG 文字列を dangerouslySetInnerHTML で注入した後、ref 経由で実 DOM 上の svg 要素に
77-
* applySvgFixups を適用する(DOMParser+XMLSerializer 往復は foreignObject を破壊するため不使用)。
78-
* - 図表は開発者が直書きした静的定数のみ(外部入力なし)のため外側サニタイズは不要。
72+
* @param chart - Mermaid diagram source code
7973
*/
8074
export default function Mermaid({ chart }: MermaidProps) {
8175
const [svgStr, setSvgStr] = useState<string>('');

0 commit comments

Comments
 (0)