Skip to content

codeAntu/md

Repository files navigation

Md compiler

GitHub release (with filter) npm version License: MIT

MD Compiler

This is a simple markdown compiler that takes a markdown file as input and outputs an React component that can be used to render the markdown.

Getting Started

Installation

  npm install @codeantu/md

Usage

import React from "react";
import { useState } from "react";
import MDComponent from "@codeantu/md";

function App() {
  const [text, setText] = useState("## Hello World");

  return (
    <>
      <div>Hello</div>
      <textarea value={text} onChange={(e) => setText(e.target.value)} />
      <MDComponent text={text} />
    </>
  );
}

export default App;

Supported Markdown Syntax

  • Heading : # Hello World - ###### Hello World

  • Bold : **Hello World**

  • Italic : *Hello World*

  • Link : [Hello World](https://www.google.com)

  • Image : ![Hello World](https://www.google.com)

  • Strike : ~~Hello World~~

  • Blockquote : > Hello World

  • List : * Hello World

  • Code : ``` console.log("Hello World") ```

  • Code block : `javascript console.log("Hello World")`

  • Horizontal Rule : ---

  • Image : ![Hello World](https://www.google.com)

  • ul : * Hello World

  • ol : 1. Hello World

  • li : - Hello World

  • hr : ---

  • paragraph : Hello World

  • span : <span>Hello World</span>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published