Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Consider a JSONRenderer

オープン
#131 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
32/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend

調査の方向性

まず既存の HTML renderer を読み、出力を要求された JSONRenderer の形状と比較します。リンクされた vdom 仕様と提供された CommonMark の例を確認し、タグ、属性、テキスト、ネストされた子要素をどのように表現すべきかを定義します。同等の入力に対して renderer が要求された構造を生成すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I'd love to see a "JSONRenderer" which would be equivalent to the HTML renderer's output, except in a form like this:

{
  tagName: "h1",
  children: "whatever",
  attributes: {} 
}

Effectively, what I'm hoping for is something that would match (or be similar to) the vdom type currently being implemented in Jupyter frontends.

Example input:

## Try CommonMark

You can try CommonMark here.  This dingus is powered by
[commonmark.js](https://github.com/jgm/commonmark.js), the
JavaScript reference implementation.

1. item one
2. item two
   - sublist
   - sublist

Example output (click to expand me):
{
  "attributes": {
    "attributes": {},
    "children": [
      {
        "attributes": {},
        "children": "Try CommonMark",
        "tagName": "h2"
      },
      {
        "attributes": {},
        "children": [
          "You can try CommonMark here.  This dingus is powered by",
          {
            "attributes": { "href": "https://github.com/jgm/commonmark.js" },
            "children": "commonmark.js",
            "tagName": "a"
          },
          ", the\nJavaScript reference implementation."
        ],
        "tagName": "p"
      },
      {
        "attributes": {},
        "children": [
          { "attributes": {}, "children": "item one", "tagName": "li" },
          { "attributes": {}, "children": "item two", "tagName": "li" },
          {
            "attributes": {},
            "children": [
              {
                "attributes": {},
                "children": "sublist",
                "tagName": "li"
              },
              { "attributes": {}, "children": "sublist", "tagName": "li" }
            ],
            "tagName": "ul"
          }
        ],
        "tagName": "ol"
      }
    ]
  },
  "children": [
    {
      "attributes": {},
      "children": "Try CommonMark",
      "tagName": "h2"
    },
    {
      "attributes": {},
      "children": [
        "You can try CommonMark here.  This dingus is powered by",
        {
          "attributes": { "href": "https://github.com/jgm/commonmark.js" },
          "children": "commonmark.js",
          "tagName": "a"
        },
        ", the\nJavaScript reference implementation."
      ],
      "tagName": "p"
    },
    {
      "attributes": {},
      "children": [
        { "attributes": {}, "children": "item one", "tagName": "li" },
        { "attributes": {}, "children": "item two", "tagName": "li" },
        {
          "attributes": {},
          "children": [
            { "attributes": {}, "children": "sublist", "tagName": "li" },
            { "attributes": {}, "children": "sublist", "tagName": "li" }
          ],
          "tagName": "ul"
        }
      ],
      "tagName": "ol"
    }
  ],
  "tagName": "div"
}

主要言語
JavaScript
スター
1.6k
フォーク
234
平均マージ
1日 27分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commonmark/commonmark.js のほかの issue

commonmark/commonmark.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。