Skip to content

[Feature]: Zenn の :::message と Qiita の :::note の自動相互変換 #48

@sotashimozono

Description

@sotashimozono

動機

Zenn と Qiita は「メッセージボックス」を独自記法で書ける:

  • Zenn: `:::message` / `:::message alert`
  • Qiita: `:::note info` / `:::note warn`

drafts に書くときは片方の記法で統一し、convert.js がもう片方に変換してくれると、両プラットフォームで同じ見た目になる。

対応方針案

drafts では Zenn 記法を canonical として書く。convert.js が Qiita 出力時に対応する `:::note` に変換。

drafts (Zenn 記法) Qiita 出力
`:::message` `:::note info`
`:::message alert` `:::note warn`
`:::details` `
Details` HTML タグ ? (要調査)

`:::` を含むパーサーは body の split で扱う必要があり、code block と同様に「変換すべきかどうか」の文脈判断が必要。

受け入れ基準

  • Zenn 記法で書いた message ボックスが Qiita でも同等に表示される
  • 既存記事 (`:::` を使っていないもの) に対して非互換変更なし

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions