소스 정보
- 저장소
- 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명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? 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.