mystx.ext.github_readme_stats.stats#

GitHub 用户统计卡片指令。

GitHubStatsDirective 使用 GitHub Readme Stats 服务生成用户统计卡片, 支持选项 themeshow_iconshide 控制外观与显示内容。

Classes#

GitHubStatsDirective

渲染 GitHub 用户基础统计卡片。

Module Contents#

class mystx.ext.github_readme_stats.stats.GitHubStatsDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[源代码]#

Bases: mystx.ext.github_readme_stats.base.BaseGitHubCardDirective

渲染 GitHub 用户基础统计卡片。

选项: - username`(必填):GitHub 用户名; - `theme`(可选):主题名称,默认为 `default; - show_icons`(可选 flag):出现该选项即开启图标显示; - `hide`(可选):以逗号分隔的统计项列表,例如 `issues,contribs

示例(reStructuredText):

.. github-stats::
   :username: octocat
   :theme: dark
   :show_icons:
   :hide: issues,contribs
option_spec[源代码]#

Mapping of option names to validator functions.

run()[源代码]#

根据选项构建统计卡片 URL 并返回 HTML 节点。

Returns:

list[nodes.Node]: 单元素列表,包含原始 HTML <img> 节点。