From a4cc39479e420e318b5372691b56aa00fe8b8fc9 Mon Sep 17 00:00:00 2001 From: chvmvd Date: Sat, 15 Oct 2022 22:01:07 +0900 Subject: [PATCH] =?UTF-8?q?Answer=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E3=82=92=E4=BD=9C=E6=88=90(?= =?UTF-8?q?=E4=B8=80=E8=A1=8C=E7=A9=BA=E3=81=91=E3=82=8C=E3=81=B0=E3=80=81?= =?UTF-8?q?=E4=B8=AD=E3=81=ABMarkdown=E3=82=92=E6=9B=B8=E3=81=8F=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=82=E5=8F=AF=E8=83=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/python/expressions/index.mdx | 6 +++--- docs/python/get-started/index.mdx | 6 +++--- docs/python/variables/index.mdx | 6 +++--- src/components/Answer.tsx | 9 +++++++++ 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 src/components/Answer.tsx diff --git a/docs/python/expressions/index.mdx b/docs/python/expressions/index.mdx index c0b02a45d..371ab3c12 100644 --- a/docs/python/expressions/index.mdx +++ b/docs/python/expressions/index.mdx @@ -3,6 +3,7 @@ sidebar_position: 3 --- import ViewSource from "@site/src/components/ViewSource/ViewSource"; +import Answer from "@site/src/components/Answer"; # 式と演算子 @@ -43,7 +44,6 @@ Python では様々な計算ができます。 球の体積( $\frac{4}{3}\pi r^3$ )を求めてみましょう。$\pi=3.14, r=2$ とします。 -
- 解答 + -
+ diff --git a/docs/python/get-started/index.mdx b/docs/python/get-started/index.mdx index be5600eae..967dd213c 100644 --- a/docs/python/get-started/index.mdx +++ b/docs/python/get-started/index.mdx @@ -3,6 +3,7 @@ sidebar_position: 2 --- import ViewSource from "@site/src/components/ViewSource/ViewSource"; +import Answer from "@site/src/components/Answer"; # はじめての Python @@ -22,10 +23,9 @@ import ViewSource from "@site/src/components/ViewSource/ViewSource"; `Hello from Python!` と出力するようなプログラムを書いてみましょう。 -
- 解答 + -
+ ## コメント diff --git a/docs/python/variables/index.mdx b/docs/python/variables/index.mdx index 3e17bbf46..de5a5bf26 100644 --- a/docs/python/variables/index.mdx +++ b/docs/python/variables/index.mdx @@ -3,6 +3,7 @@ sidebar_position: 4 --- import ViewSource from "@site/src/components/ViewSource/ViewSource"; +import Answer from "@site/src/components/Answer"; # 変数 @@ -35,7 +36,6 @@ Python では定数は使えないようです。慣習的に定数は大文字 [式と演算子の項](/docs/python/expressions/#問題)の問題を変数を使って解いてみましょう。 -
- 解答 + -
+ diff --git a/src/components/Answer.tsx b/src/components/Answer.tsx new file mode 100644 index 000000000..41c5d7a42 --- /dev/null +++ b/src/components/Answer.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import Details from "@theme/Details"; + +/** + * 解答を書くための、コンポーネント + */ +export default function Answer({ children }) { + return
解答}>{children}
; +}