All Projects → uiwjs → React Markdown Preview

uiwjs / React Markdown Preview

Licence: mit
React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Markdown Preview

Blog
My blog created with React, Gatsby & Markdown
Stars: ✭ 29 (-14.71%)
Mutual labels:  markdown
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (-14.71%)
Mutual labels:  react-component
Go Strip Markdown
Remove Markdown formatting. Written in Go.
Stars: ✭ 32 (-5.88%)
Mutual labels:  markdown
Laradown
Markdown parser for Laravel built on parsedown
Stars: ✭ 29 (-14.71%)
Mutual labels:  markdown
Hint
重构到 ---> https://github.com/hustcc/lint-md
Stars: ✭ 30 (-11.76%)
Mutual labels:  markdown
Soffes.blog
Redis + Git backed blog
Stars: ✭ 31 (-8.82%)
Mutual labels:  markdown
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+2679.41%)
Mutual labels:  markdown
React Animated Weather
Animated weather component for React inspired by Skycons http://darkskyapp.github.io/skycons/ ☀️
Stars: ✭ 34 (+0%)
Mutual labels:  react-component
Distro Delves
YouTube web-series looking at operating systems in an informational & entertaining format.
Stars: ✭ 31 (-8.82%)
Mutual labels:  markdown
Manuskript
A open-source tool for writers
Stars: ✭ 960 (+2723.53%)
Mutual labels:  markdown
Nvim Completion Manager
⚠️ PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
Stars: ✭ 950 (+2694.12%)
Mutual labels:  markdown
Richtextview
iOS Text View (UIView) that Properly Displays LaTeX, HTML, Markdown, and YouTube/Vimeo Links
Stars: ✭ 953 (+2702.94%)
Mutual labels:  markdown
Termd
Render markdown in the terminal
Stars: ✭ 32 (-5.88%)
Mutual labels:  markdown
React Prismazoom
A pan and zoom component for React, using CSS transformations.
Stars: ✭ 29 (-14.71%)
Mutual labels:  react-component
Notes
📝 Migrated to(迁移至) https://github.com/Kuangcp/Note 当前仓库已经废弃, 对应的博客网站:
Stars: ✭ 33 (-2.94%)
Mutual labels:  markdown
Partition
A small library for generating markdown tables
Stars: ✭ 28 (-17.65%)
Mutual labels:  markdown
React Colorful
🎨 A tiny (2,5 KB) color picker component for React and Preact apps
Stars: ✭ 951 (+2697.06%)
Mutual labels:  react-component
Wxparse
wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析
Stars: ✭ 7,618 (+22305.88%)
Mutual labels:  markdown
Markdownview
Android library to display markdown text.
Stars: ✭ 970 (+2752.94%)
Mutual labels:  markdown
React Splide
The Splide component for React.
Stars: ✭ 32 (-5.88%)
Mutual labels:  react-component

React Markdown Preview

React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style. The current document website is converted using this react component.

Quick Start

$ npm install @uiw/react-markdown-preview --save

Usage Example

Open in CodeSandbox

import MarkdownPreview from '@uiw/react-markdown-preview';

const source = `
## MarkdownPreview

> todo: React component preview markdown text.
`;

function Demo() {
  return (
    <MarkdownPreview source={source} />
  )
}

Options Props

import { ReactMarkdownProps } from 'react-markdown';

type MarkdownPreviewProps = {
  className?: string;
  source?: string;
  style?: React.CSSProperties;
  onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
  onMouseOver?: (e: React.MouseEvent<HTMLDivElement>) => void;
} & ReactMarkdownProps;

This ReactMarkdownProps details.

  • source (string, default: '')
    Markdown to parse
  • className (string?)
    Wrap the markdown in a div with this class name
  • allowDangerousHtml (boolean, default: false)
    This project is safe by default and escapes HTML. Use allowDangerousHtml: true to allow dangerous html instead. See security
  • skipHtml (boolean, default: false)
    Ignore HTML in Markdown
  • sourcePos (boolean, default: false)
    Pass a prop to all renderers with a serialized position (data-sourcepos="3:1-3:13")
  • rawSourcePos (boolean, default: false)
    Pass a prop to all renderers with their position (sourcePosition: {start: {line: 3, column: 1}, end:…})
  • includeNodeIndex (boolean, default: false)
    Pass index and parentChildCount in props to all renderers
  • allowedTypes (Array.<string>, default: list of all types)
    Node types to allow (can’t combine w/ disallowedTypes). All types are available at ReactMarkdown.types
  • disallowedTypes (Array.<string>, default: [])
    Node types to disallow (can’t combine w/ allowedTypes)
  • allowNode ((node, index, parent) => boolean?, optional)
    Function called to check if a node is allowed (when truthy) or not. allowedTypes / disallowedTypes is used first!
  • unwrapDisallowed (boolean, default: false)
    Extract (unwrap) the children of not allowed nodes. By default, when strong is not allowed, it and it’s content is dropped, but with unwrapDisallowed the node itself is dropped but the content used
  • linkTarget (string or (url, text, title) => string, optional)
    Target to use on links (such as _blank for <a target="_blank"…)
  • transformLinkUri ((uri) => string, default: [./uri-transformer.js][uri], optional)
    URL to use for links. The default allows only http, https, mailto, and tel, and is available at ReactMarkdown.uriTransformer. Pass null to allow all URLs. See security
  • transformImageUri ((uri) => string, default: [./uri-transformer.js][uri], optional)
    Same as transformLinkUri but for images
  • renderers (Object.<Component>, default: {})
    Object mapping node types to React components. Merged with the default renderers (available at ReactMarkdown.renderers). Which props are passed varies based on the node
  • plugins (Array.<Plugin>, default: [])
    List of remark plugins to use. See the next section for examples on how to pass options

See Options Props for more details.

Development

Runs the project in development mode.

# Step 1, run first, listen to the component compile and output the .js file
npm run ts:watch
# Step 2, listen for compilation output type .d.ts file
npm run types:watch
# Step 3, development mode, listen to compile preview website instance
npm run doc:dev

Builds the app for production to the build folder.

npm run released

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

License

Licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].