From f023f3c4cbf0708915177d628640f14fa9b90b0c Mon Sep 17 00:00:00 2001 From: snowykami Date: Sat, 31 Aug 2024 08:20:31 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BC=98=E5=8C=96=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litedoc/i18n.py | 4 ++++ litedoc/syntax/node.py | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/litedoc/i18n.py b/litedoc/i18n.py index 11dcec6..0451457 100644 --- a/litedoc/i18n.py +++ b/litedoc/i18n.py @@ -22,6 +22,7 @@ "type" : "Type", "or" : "or", "view_on_github": "View on GitHub", + "default_value": "Default", }, "zh-Hans": { "docstring": { @@ -37,6 +38,7 @@ "type" : "类型", "or" : "或", "view_on_github": "在GitHub上查看", + "default_value": "默认值", }, "zh-Hant": { "docstring": { @@ -52,6 +54,7 @@ "type" : "類型", "or" : "或", "view_on_github": "於GitHub上查看", + "default_value": "默認值", }, "ja" : { "docstring": { @@ -67,6 +70,7 @@ "type" : "タイプ", "or" : "または", "view_on_github": "GitHubで表示", + "default_value": "デフォルト", }, } # @litedoc-hide diff --git a/litedoc/syntax/node.py b/litedoc/syntax/node.py index 90971ae..b4384ce 100644 --- a/litedoc/syntax/node.py +++ b/litedoc/syntax/node.py @@ -49,11 +49,13 @@ def markdown(self, lang: str, **kwargs) -> str: """ vd = kwargs.get("vd", "var") md = "" - md += f"### {vd} `{self.name}` = `{self.value}`\n\n" - if self.type != TypeHint.NO_TYPEHINT: - md += f"- **{get_text(lang, 'type')}**: `{self.type}`\n\n" + md += f"### {vd} `{self.name}`\n\n" if self.docs is not None: md += f"- **{get_text(lang, 'desc')}**: {self.docs}\n\n" + if self.type != TypeHint.NO_TYPEHINT: + md += f"- **{get_text(lang, 'type')}**: `{self.type}`\n\n" + md += f"- **{get_text(lang, 'default_value')}**: `{self.value}`\n\n" + return md