React Markdown + MUI v5(Material-UI)

목차


  • About this post
  • Using Markdown in your project
  • About "mui-markdown" package
  • Some of "mui-markdown" features
  • Package usage
  • Documentations

  • 이 게시물 정보

    Are you going to use markdown in your React web app? In this post, I want to introduce my new package to you. That will help you to render the markdown fast and nicely.

    프로젝트에서 마크다운 사용하기

    As you know, with MD or MDX you can write rich formatted content real quick, and it's pretty readable even before you convert it to HTML. There are also some other benefits that you can read about them as well.
    So, if we are all in the same boat, chances are that like me, you need to use markdown in almost every single project. Even though you can find some npm or yarn packages that help you to render markdown as you wish, almost every time you need to configure that or write some extra CSS to gain the style you want.

    "mui-markdown" 패키지 정보

    "mui-markdown" "markdown-to-jsx""mui" . 나는 이 두 가지가 함께 작동하는 것이 정말 간단하고 좋다는 것을 알았습니다. 이 패키지는 MUI(구 Material-UI)를 사용하는 경우 유용합니다. 또한 11.70Kb(압축 해제 크기는 87.1Kb)로 매우 가볍습니다.

    "mui-markdown" 기능 중 일부

    • Code highlight and language detect
    • Inline code highlight
    • Blockquote component
    • MUI button component support
    • Nice Links
    • Flexible and Overridable

    패키지 사용

    The package is available on npm and yarn.

    To install it, simply run:

    # with npm
    npm i mui-markdown
    
    # with yarn
    yarn add mui-markdown
    

    Then pass the markdown as children:

    import React from 'react';
    import MuiMarkdown from 'mui-markdown';
    
    import md from './myMarkdown.md';
    
    const App = () => {
      return(
          <MuiMarkdown>{md}</MuiMarkdown>;
      )
    };
    
    export default App;
    

    문서

    To get more familiar with this package you can read the documentation on GitHub 또는 NPM .

    좋은 웹페이지 즐겨찾기