Giter VIP home page Giter VIP logo

yamde's Introduction

YAMDE

yamde_logo_light

Y.A.M.D.E - yet another markdown editor.

Demo:

View YAMDE demo


๐ŸŒฑ Features

  • Responsive
  • Light/dark mode support
  • Customizable toolbar
  • Lightweight: Bundlephobia

๐Ÿ”ง Installation

npm install yamde


๐Ÿ’ป Usage

Example implementation:

import React, { useState } from 'react'
import Yamde from 'yamde'

export const App = () => {
  const [text, setText] = useState('')

  return <Yamde value={text} handler={setText} theme="light" />
}

โš™๏ธ Options

๐ŸŽจ Themes

There are two available theme: dark and light. This can be controlled via the theme prop (defaults to light if non specified).

Light

<Yamde value={text} handler={setText} theme="light" />

CleanShot 2021-04-15 at 00 26 39

Dark

<Yamde value={text} handler={setText} theme="dark" />

CleanShot 2021-04-15 at 00 28 50

โŒจ๏ธ Toolbar actions

You can customize the toolbar actions by passing in the toolbar prop (toolbar?: string[]). Omiting this prop will default to showing all available actions.

<Yamde value={text} handler={setText} toolbar={['bold', 'italic', 'strikethrough']} />

Available actions:

Identifier Description
bold Bold text.
italic Italic text.
strikethrough Strikethrough text
heading1 Heading 1 (H1)
heading2 Heading 2 (H2)
heading3 Heading 3 (H3)
ulist Unordered list
olist Ordered list
table Table markdown
image Image markdown
quote Blockquote markdown
code Code highlight
hr Horizontal rule

required prop

If you use YAMDE in a form that uses HTML form validation, you can set the required prop to true (by default this is set to false):

<Yamde value={text} handler={setText} required />

yamde's People

Contributors

adrianapan avatar joepio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yamde's Issues

Remove some options from toolbar

In toolbar, currently we have couple of actions such as bold, italic, strike through, etc. is it possible to remove one or two items from the toolbar via config/options?

Feature request: Side-by-side mode

Thanks for the project, I have been using yamde in some of my projects, but I think it would be helpful to have an side-by-side mode as an option so users can edit while having an preview.

Support customize theme

I found this lib so good. You should update to support fully customizing the styles, nice to have custom icon toolbars

Developing/testing question

Hi! I'd found my way over here from the reddit article that you'd posted a few days ago. I'm interested in contributing to your package! ๐Ÿ˜€

Today when I cloned your repo though, I only see that you committed the /src files related to your package. Out of curiosity, how do you actually run and test YAMDE? Is there separate "test harness" code that you develop/test with but didn't commit?

Of course, I could set up webpack locally, build a dummy "harness" container, and instantiate a YAMDE component from there, but I was just curious about your process?

Thanks for sharing your code though! I look forward to contributing! ๐Ÿ‘

Local Storage

is it possible to save the text changes in the textarea into localstorage and make logic that if the web is reloaded it will take the text value from localstorage if there is no then use samplecontent?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.