मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)5.1k · #15050

migrate-goldmark-app-v1-to-v2

यह क्या करती है

यह goldmark v2 के लिए ज़रूरी बदलावों की योजना बनाती है और उन्हें लागू करती है: पहले ऐसी योजना जिसे आप मंज़ूर करें, और अंत में टेस्ट। यह उन Go डेवलपर्स के लिए है जो अपने ऐप में goldmark इस्तेमाल करते हैं।

कब इस्तेमाल करें

  • ✓जब आपकी Go ऐप goldmark v1 इस्तेमाल करती है और आप v2 पर जाना चाहते हैं।
  • ✓जब आपको goldmark v1 और v2 के बीच टूटने वाले बदलाव (breaking changes) देखने हैं।
  • ✓जब आप कोड बदलने से पहले माइग्रेशन योजना की पुष्टि चाहते हैं।

Skill का लिंक

https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-app-v1-to-v2/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/yuin/goldmark/blob/v2/.agent-plugins/migrate-goldmark-v1-to-v2/skills/migrate-goldmark-app-v1-to-v2/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी Go ऐप को goldmark v1 से v2 पर ले जाने में मदद कीजिए, और कोड बदलने से पहले योजना मुझसे जाँच लीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

आपका एजेंट आपकी पुष्टि के लिए माइग्रेशन योजना लिखता है, कोड अपडेट करता है, टेस्ट ठीक करता है, और goldmark v2 पर उन्हें चलाता है। वह टूटने वाले बदलावों के संदर्भ नोट्स का इस्तेमाल करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

migrate-goldmark-app-v1-to-v2

Description

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.

Knowledges

  • CommonMark key points : List of key points of CommonMark spec that you should be aware of when implementing a goldmark extension.
  • Breaking changes in v2 : List of breaking changes in goldmark v2 that you should be aware of when migrating your extension from v1 to v2.

Migration steps

Overview of the migration process

  • Create a migration plan for the application.
  • MUST ask human to confirm that the migration plan is acceptable before proceeding with the migration.
  • MUST ask human to how to test the application after migration before proceeding with the migration.
    • e.g. : "How do you want to test the application after migration? Do you have any test cases or examples that you want to use for testing?"
  • Execute the migration plan to update the application code to be compatible with goldmark v2.
  • Update the test cases to ensure that the application works as expected with goldmark v2.
  • Test the application with goldmark v2 to ensure that it works as expected. If there are any issues, fix them and re-test until the application works as expected.
  • Update the documentation to reflect any changes made during the migration process.

Create a migration plan

Task

  • Make sure you have read and understood the Breaking changes in v2 document.
  • Make sure you have read and understood the How to create an extension document.
  • You create a ./features/goldmark-migration-plan.md file that contains a migration plan for the extension.

Extension

  • If the application contains own extensions, you can use /migrate-goldmark-extension-v1-to-v2 skill to migrate the extensions.
  • If the application contains third-party extensions, you need to check if the extensions provide v2 compatible version. - If not, STOP the migration.

Key points to consider when migrating your application

goldmark.Markdown alternatives
  • In v2, goldmark.Markdown is removed. Therefore, you need to replace it with one of the following two patterns:
    • Pattern 1: Use parser.Parser and renderer.Renderer to create your own goldmark.Markdown alternative.
      • Example:
        // 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
            }
        }
        
    • Pattern 2: Use parser.Parser and renderer.Renderer separately.
      • Example:
        var buf bytes.Buffer
        p := parser.New(parser.WithAttribute(), parser.WithExtensions(extension.NewStrikethroughParser()))
        r := html.New(html.WithXHTML(), html.WithUnsafe(), html.WithExtensions(extension.NewStrikethroughHTMLRenderer()))
        doc := p.Parse(b)
        err := r.Render(&buf, b, doc)
        
  • Extensions MUST NOT be shared among multiple parsers/renderers. Create them with the New* constructors (e.g. extension.NewTableParser()) for each parser/renderer instead of using the deprecated default instances (e.g. extension.TableParser).
AST
  • In v1, AST values are mostly 'raw' values; entities references and \ escapes are not resolved. In v2, AST values are resolved values.
    • You need to check if your application relies on the 'raw' values of AST nodes.
      • If your application relies on the resolved values of AST nodes, you should replace Value.Bytes and Value.Str methods with Value.Value method.
      • Otherwise, you should replace Value.Bytes and Value.Str methods with Value.Value method.
  • In v2, to make the AST more semantic, some breaking changes have occurred.
अक्सर पूछे जाने वाले सवाल

क्या एजेंट तुरंत कोड बदलना शुरू कर देता है?

नहीं। स्किल के लिए ज़रूरी है कि पहले आप माइग्रेशन योजना की पुष्टि करें और बताएँ कि उसे कैसे टेस्ट करना है।

v2 के बदलावों की जानकारी किससे मिलती है?

v2 के टूटने वाले बदलावों और CommonMark की मुख्य बातों पर संदर्भ दस्तावेज़ों से।

क्या extensions के लिए अलग स्किल है?

हाँ। goldmark extension के माइग्रेशन के लिए अलग स्किल है।

जानकारी

लेखक का मूल विवरण

Migrate your application from goldmark v1 to v2.

repo: yuin/goldmark

लोकप्रियता

GitHub स्टार
5.1k
रैंकिंग में स्थान
#15050
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills