ソース情報
- リポジトリ
- yuin/goldmark
- ソースの最終更新活動
- 2026年8月27日 06:44
- 検出された SKILL.md の言語
- 英語
- スター
- 4,978
- フォーク
- 308
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/yuin/goldmark --skill migrate-goldmark-extension-v1-to-v2コマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
| name | migrate-goldmark-extension-v1-to-v2 |
| context | fork |
| description | Migrate goldmark extension 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.
type Option interface {
myOption()
}
type ParserOption interface {
Option
applyParserOption(*parserConfig)
}
type RendererOption interface {
Option
applyRendererOption(*rendererConfig)
}
func New(opts ...Option) goldmark.Extender { // takes unified options
// ...
}
type ParserOption interface {
applyParserOption(*parserConfig)
}
type HTMLRendererOption interface { // explicitly named for **HTML**
applyRendererOption(*htmlRendererConfig) // you can access the shared renderer config like `XHTML` or `Unsafe` in the renderer config
}
func NewParser(opts ...ParserOption) parser.Extension { // takes parser options
// ...
}
var Parser = NewParser() // Default instance of parser extension
func NewHTMLRenderer(opts ...HTMLRendererOption) html.Extension { // takes renderer options
// ...
}
var HTMLRenderer = NewHTMLRenderer() // Default instance of renderer extension
text.Value(single line), text.MultiLineValue(multi-line) instead of []byte for values that can be parsed from source text in inline AST nodes.
text.Decoder implementation to decode the source value
text.IdentityDecoder : for raw contents like inline HTMLs, inline code, etc.reader.Decoder : other contents like text, links, etc. This decoder decodes entity references, \ escapes, etc.text.Decoder. DO NOT use text.IdentityDecoder unless you have a clear intention to do so.text.Lines instead of []text.Segment for values in block AST nodes that have raw contents like HTML blocks, code blocks, etc.text.Value as possible.
// Dump implements Node.Dump.
func (n *Text) Dump(_ []byte) *NodeDump {
m := map[string]any{
"Value": n.Value, // text.Value
}
fs := textFlagsString(n.flags)
if len(fs) != 0 {
m["Flags"] = fs
}
return NewNodeDump(n, m)
}
// Dump implements Node.Dump.
func (n *Text) Dump(source []byte) *NodeDump {
m := map[string]any{
"Value": n.Value.Str(source), // string
}
fs := textFlagsString(n.flags)
if len(fs) != 0 {
m["Flags"] = fs
}
return NewNodeDump(n, m)
}
text.Value which has almost the same specification as HTML attributes.
goldmark_v1_attribute build tag to continue using v1 attributes as they are.SetPos appropriately.text.Value and text.Lines can be rendered using the WriteTo method whenever possible. Also, the output destination of WriteTo should use html.ContextHTMLWriter(rc) or html.ContextTextWriter(rc).
tw := html.ContextTextWriter(rc)
_, _ = n.Value.WriteTo(tw, source)
WriteTo is fast because it does not allocate new memory. On the other hand, if you write Value directly like tw.Write(n.Value.Value(source)), it may copy the contents of Value, which can degrade performance.myext.NewParser() and myext.NewHTMLRenderer() for the extension constructors.
meta extension
meta.NewParser(), meta.NewHTMLRenderer()myext.Parser and myext.HTMLRenderer as the default extension values.
var Parser = NewParser(), var HTMLRenderer = NewHTMLRenderer()myext.ParserOption and myext.HTMLRendererOption for functional options.
type ParseOption func(*parserConfig), type HTMLRendererOption func(*htmlRendererConfig)main or master. User must create a new branch like 'v2' to work on the migration before using this skill.
main or master, STOP this skill and ask human to create a new branch like 'v2' to work on the migration.go.mod file is updated to use github.com/yuin/goldmark/v2 instead of github.com/yuin/goldmark. User must add goldmark/v2 before using this skill.
go.mod file is not updated, STOP this skill and ask human to update go.mod file to use github.com/yuin/goldmark/v2 instead of github.com/yuin/goldmark.go.mod file with new major version. For example, change github.com/you/yourextension to github.com/you/yourextension/v2.
go.mod file before proceeding with the migration.
go.mod file with new major version.