How to add HTML extension

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
html, react, typescript

調査の方向性

Start with the linked HTML-block extension documentation and reproduce its demo using YfmStaticView. Read src/extensions/additional/index.ts to verify whether yfmHtmlBlock is exported, and inspect the shown HtmlRenderer example for the missing useMemo syntax and configuration. Done means the documentation contains an executable example with the correct imports, hook usage, and extension export guidance, and the demo runs without reported errors.

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

説明

"@gravity-ui/markdown-editor": "^15.11.0"
In hte doc How to add HTML extension: https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-html-block--docs, The code inside cannot be executed and all errors are reported,please update this doc demo,tell me How to integrate YFM HTML block extension?

For example

// render
const HtmlRenderer = React.forwardRef<HTMLDivElement, HtmlRendererProps>((props, ref) => {
  // ...
  const theme = useThemeType(); // your hook for get theme

  const yfmHtmlBlockConfig = useYfmHtmlBlockStyles();
    () => ({
      theme,
      zoom: {showMenu: true, bindKeys: true, resetOnBlur: true},
    }),
    [theme],
  );

  // ...
  return (
    <div>
      <YfmStaticView
        html={html}
        meta={meta}
        ref={elementRef}
        yfmHtmlBlockConfig={yfmHtmlBlockConfig}
      />
      {props.children}
    </div>
  );
});

() => ({
theme,
zoom: {showMenu: true, bindKeys: true, resetOnBlur: true},
}),
[theme],
);
what this in the react component?

  1. markdown-editor/src/extensions/additional//index.ts
    only export GPT
    export * from './GPT';
    not export yfmHtmlBlock
主要言語
TypeScript
スター
428
フォーク
48
平均マージ
5日 15時間
マージ済み PR(30日)
47

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

gravity-ui/markdown-editor のほかの issue

gravity-ui/markdown-editor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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