mirror of
https://gitee.com/huanghongxun/HMCL-docs.git
synced 2026-05-04 23:35:27 +08:00
自动识别 GP / GC 标记并生成对应链接 (#436)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5101a59793
commit
8b05643a2f
@ -9,10 +9,10 @@
|
||||
- GP-3490: 修复 OAuth 登录时轮询过于频繁的问题
|
||||
- GP-3464: 修复在更新日志界面无法拖动启动器窗口的问题
|
||||
- GP-3503: 使用 Zink 渲染器时禁用 DRI3
|
||||
- GC-`5fd52bb`: 皮肤缓存不再保存到 .minecraft 目录
|
||||
- GC-`d5408c3`: 版本特定游戏设置从全局设置复制
|
||||
- GC-`81b3911`: 修复按 ESC 键时文本框内的值没有保存的问题
|
||||
- GC-`260f4b6`: 修复输入对话框中 ESC 键不起作用的问题
|
||||
- GC-`7d12ef6`: 修复内存滑块提示被设备内存进度条覆盖的问题
|
||||
- GC-`78e15d1`: 修复游戏设置中内存没有实时刷新的问题
|
||||
- GC-`6f53da1`: 完善模组下载界面
|
||||
- GC-5fd52bb: 皮肤缓存不再保存到 .minecraft 目录
|
||||
- GC-d5408c3: 版本特定游戏设置从全局设置复制
|
||||
- GC-81b3911: 修复按 ESC 键时文本框内的值没有保存的问题
|
||||
- GC-260f4b6: 修复输入对话框中 ESC 键不起作用的问题
|
||||
- GC-7d12ef6: 修复内存滑块提示被设备内存进度条覆盖的问题
|
||||
- GC-78e15d1: 修复游戏设置中内存没有实时刷新的问题
|
||||
- GC-6f53da1: 完善模组下载界面
|
||||
|
||||
@ -10,6 +10,6 @@
|
||||
错误修复
|
||||
|
||||
- GP-3252: 修复无法补全部分第三方 Minecraft 客户端游戏资源的问题
|
||||
- GC-`56d20a5`, GC-`397edae`: 修复 Linux 平台调整窗口大小的问题
|
||||
- GC-56d20a5, GC-397edae: 修复 Linux 平台调整窗口大小的问题
|
||||
- GP-3531: 修复在 FreeBSD x86-64 平台未正确替换 LWJGL 本地库的问题
|
||||
- GP-3541: 修复安装 MultiMC 整合包后没有设置图标的问题
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
- GP-3594: Java 下载对话框中切换包类型时不应重置版本字段
|
||||
- GP-3598: 修复使用自定义字体时未正确设置字重的问题
|
||||
- GP-3602: 修复使用系统 GLFW/OpenAL 时无法启动部分游戏版本的问题
|
||||
- GC-`ecafc9d`: 修复安装新游戏页面中组件框的高度问题
|
||||
- GC-ecafc9d: 修复安装新游戏页面中组件框的高度问题
|
||||
|
||||
@ -52,21 +52,21 @@
|
||||
- GP-3490: 修复 OAuth 登录时轮询过于频繁的问题
|
||||
- GP-3464: 修复在更新日志界面无法拖动启动器窗口的问题
|
||||
- GP-3503: 使用 Zink 渲染器时禁用 DRI3
|
||||
- GC-`5fd52bb`: 皮肤缓存不再保存到 .minecraft 目录
|
||||
- GC-`81b3911`: 修复按 ESC 键时文本框内的值没有保存的问题
|
||||
- GC-`260f4b6`: 修复输入对话框中 ESC 键不起作用的问题
|
||||
- GC-`7d12ef6`: 修复内存滑块提示被设备内存进度条覆盖的问题
|
||||
- GC-`78e15d1`: 修复游戏设置中内存没有实时刷新的问题
|
||||
- GC-`6f53da1`: 完善模组下载界面
|
||||
- GC-5fd52bb: 皮肤缓存不再保存到 .minecraft 目录
|
||||
- GC-81b3911: 修复按 ESC 键时文本框内的值没有保存的问题
|
||||
- GC-260f4b6: 修复输入对话框中 ESC 键不起作用的问题
|
||||
- GC-7d12ef6: 修复内存滑块提示被设备内存进度条覆盖的问题
|
||||
- GC-78e15d1: 修复游戏设置中内存没有实时刷新的问题
|
||||
- GC-6f53da1: 完善模组下载界面
|
||||
- GP-3252: 修复无法补全部分第三方 Minecraft 客户端游戏资源的问题
|
||||
- GC-`56d20a5`, GC-`397edae`: 修复 Linux 平台调整窗口大小的问题
|
||||
- GC-56d20a5, GC-397edae: 修复 Linux 平台调整窗口大小的问题
|
||||
- GP-3531: 修复在 FreeBSD x86-64 平台未正确替换 LWJGL 本地库的问题
|
||||
- GP-3541: 修复安装 MultiMC 整合包后没有设置版本图标的问题
|
||||
- GP-3549: 修复 macOS 平台 HMCLauncher.sh 不会显示 Java 下载页面的问题
|
||||
- GP-3594: Java 下载对话框中切换包类型时不应重置版本字段
|
||||
- GP-3598: 修复使用自定义字体时未正确设置字重的问题
|
||||
- GP-3602: 修复使用系统 GLFW/OpenAL 时无法启动部分游戏版本的问题
|
||||
- GC-`ecafc9d`: 修复安装新游戏页面中组件框的高度问题
|
||||
- GC-ecafc9d: 修复安装新游戏页面中组件框的高度问题
|
||||
- GP-3618: 修复无法识别 Intel64 架构的问题
|
||||
- GP-3626: 修复离线账户选择 Steve/Alex 皮肤时模型错误的问题
|
||||
- GP-3622: 修复在非官方支持的平台上 Minecraft 1.21 与 Sodium 不兼容的问题
|
||||
|
||||
@ -3,6 +3,15 @@ begin
|
||||
rescue LoadError; end
|
||||
|
||||
module KramdownEnhancer
|
||||
GITHUB_LINK_REGEX = /\b(GP-\d+|GC-[0-9a-f]{7})\b/
|
||||
BLOCKQUOTE_TYPES = {
|
||||
note: "notice--info",
|
||||
tip: "notice--success",
|
||||
important: "notice--primary",
|
||||
warning: "notice--warning",
|
||||
caution: "notice--danger",
|
||||
}
|
||||
|
||||
class << self
|
||||
def webp
|
||||
@webp ||= {}
|
||||
@ -25,16 +34,6 @@ module KramdownEnhancer
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def blockquote_types
|
||||
@blockquote_types ||= {
|
||||
:note => "notice--info",
|
||||
:tip => "notice--success",
|
||||
:important => "notice--primary",
|
||||
:warning => "notice--warning",
|
||||
:caution => "notice--danger",
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
class WebpFile < Jekyll::StaticFile
|
||||
@ -81,7 +80,7 @@ module KramdownEnhancer
|
||||
return super unless first&.type == :text
|
||||
|
||||
text = first.value.downcase
|
||||
KramdownEnhancer.blockquote_types.each do |type, class_name|
|
||||
KramdownEnhancer::BLOCKQUOTE_TYPES.each do |type, class_name|
|
||||
prefix = "[!#{type}]"
|
||||
prefix_with_newline = "#{prefix}\n"
|
||||
|
||||
@ -128,6 +127,29 @@ module KramdownEnhancer
|
||||
super(el, indent)
|
||||
end
|
||||
|
||||
def convert_text(el, indent)
|
||||
return super(el, indent) unless !el.options[:github_link] && KramdownEnhancer::GITHUB_LINK_REGEX.match?(el.value)
|
||||
list = el.value.split(KramdownEnhancer::GITHUB_LINK_REGEX)
|
||||
el.type = :html_element
|
||||
el.value = "span"
|
||||
el.children = list.reject(&:empty?).map do |item|
|
||||
if KramdownEnhancer::GITHUB_LINK_REGEX.match(item)
|
||||
href =
|
||||
if item.start_with?("GP-")
|
||||
"https://github.com/HMCL-dev/HMCL/pull/#{item[3..]}"
|
||||
else
|
||||
"https://github.com/HMCL-dev/HMCL/commit/#{item[3..]}"
|
||||
end
|
||||
link = Kramdown::Element.new(:a, nil, {"href": href, "target": "_blank"})
|
||||
link.children = [Kramdown::Element.new(:text, item, nil, :github_link => true)]
|
||||
link
|
||||
else
|
||||
Kramdown::Element.new(:text, item, nil, :github_link => true)
|
||||
end
|
||||
end
|
||||
convert_html_element(el, indent)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def relative_url(input)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user