Skip to content

Commit

Permalink
✨ 优化链接索引
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Aug 31, 2024
1 parent 4645b85 commit f023f3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions litedoc/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"type" : "Type",
"or" : "or",
"view_on_github": "View on GitHub",
"default_value": "Default",
},
"zh-Hans": {
"docstring": {
Expand All @@ -37,6 +38,7 @@
"type" : "类型",
"or" : "或",
"view_on_github": "在GitHub上查看",
"default_value": "默认值",
},
"zh-Hant": {
"docstring": {
Expand All @@ -52,6 +54,7 @@
"type" : "類型",
"or" : "或",
"view_on_github": "於GitHub上查看",
"default_value": "默認值",
},
"ja" : {
"docstring": {
Expand All @@ -67,6 +70,7 @@
"type" : "タイプ",
"or" : "または",
"view_on_github": "GitHubで表示",
"default_value": "デフォルト",
},
} # @litedoc-hide

Expand Down
8 changes: 5 additions & 3 deletions litedoc/syntax/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f023f3c

Please sign in to comment.