用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yuin/goldmark --skill migrate-goldmark-app-v1-to-v2命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | migrate-goldmark-app-v1-to-v2 |
| context | fork |
| description | Migrate your application from goldmark v1 to v2. |
| allowed-tools | Bash Read |
This skill helps you migrate a goldmark (https://github.com/yuin/goldmark) extension from version 1 to version 2. It provides guidance on the changes needed to update your project to be compatible with the new version of goldmark.
/migrate-goldmark-extension-v1-to-v2 skill to migrate the extensions.goldmark.Markdown is removed. Therefore, you need to replace it with one of the following two patterns:
parser.Parser and renderer.Renderer to create your own goldmark.Markdown alternative.
// MarkdownToStringFunc is a function type that converts markdown to HTML.
type MarkdownToStringFunc func(source string) (string, error)
// NewMarkdownToStringFunc returns a MarkdownToStringFunc that uses the given parser and renderer.
func NewMarkdownToStringFunc(p parser.Parser, r html.Renderer) MarkdownToStringFunc {
return func(source string) (string, error) {
var buf bytes.Buffer
b := util.StringToReadOnlyBytes(source)
doc := p.Parse(b)
if err := r.Render(&buf, b, doc); err != nil {
return "", err
}
return buf.String(), nil
}
}
parser.Parser and renderer.Renderer separately.
var buf bytes.Buffer
p := parser.New(parser.WithAttribute(), parser.WithExtensions(extension.StrikethroughParser))
r := html.New(html.WithXHTML(), html.WithUnsafe(), html.WithExtensions(extension.StrikethroughHTMLRenderer))
doc := p.Parse(b)
err := r.Render(&buf, b, doc)
\ escapes are not resolved. In v2, AST values are resolved values.
Value.Bytes and Value.Str methods with Value.Value method.Value.Bytes and Value.Str methods with Value.Value method.parser.IDGenerator instead of parser.IDs.renderer.Renderer has renderer.Context; if the application mimics context for rendering, it should be updated to use renderer.Context.