npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@svpkg/md-editor

v0.0.3

Published

Write Better, Faster, and Smarter with MD Editor!

Downloads

14

Readme

@svpkg/md-editor Documentation

Write Better, Faster, and Smarter with Our Markdown Editor!

Welcome to the official documentation for @svpkg/md-editor! Get ready to experience Markdown editing like never before. Our editor is here to make your life easier, more fun, and a bit spicy!

Installation

Step 1: Open your terminal. You know the drill. 🖥️

Step 2: Run the following command to install @svpkg/md-editor:

npm install @svpkg/md-editor

That's it! You're all set to start using the most epic Markdown editor in the galaxy. 🌌

Usage

So, you've installed @svpkg/md-editor. Now what? Let's dive into the awesomeness.

Import the Editor

First, you need to import the editor into your React project:

import React from "react";
import { MdEditor } from "@svpkg/md-editor";

const App = () => {
  return (
    <MdEditor>
      <MdEditor.Previewer />
      <MdEditor.Editor
        value={""}
        onChange={(str) => {
          // set str to state
        }}
      />
    </MdEditor>
  );
};

export default App;

Import the Editor

First, you need to import the editor into your React project:

import React from 'react';
import { MdPreviewer } from '@svpkg/md-editor';

const Previewer = () => {
    return (
        <MdPreviewer value={""} />
    );
};

export default Previewer;

Prop Types

Editor (MdEditor.Editor)

The EditorType defines the properties for the editor component.

  • style: Record<string, string | number> (optional)

    • CSS styles to apply to the editor component.
    • Example: { backgroundColor: 'lightgray', fontSize: 14 }
  • className: string (optional)

    • CSS class name to apply to the editor component.
    • Example: "my-editor"
  • value: string (optional)

    • The initial value of the editor content.
    • Example: "## Hello, Markdown!"
  • getMarkDown: (markDown: string) => void (optional)

    • Callback function to get the current Markdown content from the editor.
    • Example:
      const handleGetMarkdown = (markdown: string) => {
        console.log(markdown);
      };
  • onChange: (value: string) => void (optional)

    • Callback function to handle changes in the editor content.
    • Example:
      const handleChange = (value: string) => {
        console.log("Editor content changed:", value);
      };

Previewer (MdPreviewer)

The PreviewerTypes defines the properties for the previewer component.

  • style: Record<string, string | number> (optional)

    • CSS styles to apply to the previewer component.
    • Example: { padding: '10px', border: '1px solid #ddd' }
  • html: string (optional)

    • HTML content to display in the previewer. If provided, this will override the value prop.
    • Example: "<h2>Hello, Markdown!</h2>"
  • value: string (optional)

    • The Markdown content to convert and display as HTML in the previewer.
    • Example: "## Hello, Markdown!"

Basic Markdown Syntax

Here's a rundown of the Markdown syntax you can use with our editor, complete with examples:

1. Headers

Use # for headers. The more #, the smaller the header.

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6

2. Bold

Wrap your text with ** to make it bold. Because who doesn't like a little emphasis? 💪

   **This is bold text**

3. Italic

Wrap your text with * to italicize it. Get those fancy words slanted! 🎨

_This is italic text_

4. Links

Create links with ease. Wrap the link text in [] and the URL in ().

[Click me!](https://example.com)

5. Horizontal line

Create Horizontal so simple. Just add --- in new line.

---

6. Block Quote

Lets learn to add block quote. Wrapping text into (`).

`Text`

7. Images

Want to show off your cat? No problem! Use the following syntax:

![Cute Cat](https://images.pexels.com/photos/1366630/pexels-photo-1366630.jpeg?auto=compress&cs=tinysrgb&w=600)

8. Lists

Create lists with * or -. Perfect for jotting down your groceries or world domination plans. 📝

Unordered List:

- Item 1
- Item 2
- Item 3

Ordered List:

1. Step 1
2. Step 2
3. Step 3

9. Tables

Tables are a bit tricky, but we've got you covered. Use to create columns.

Header 1 | Header 2
Cell 1 | Cell 2  
 Cell 3 | Cell 4

10. Keyboard Shortcuts

Speed up your workflow with these nifty shortcuts:

Bold: <kbd>Ctrl + B </kbd>
Italic: <kbd>Ctrl + I</kbd>

Just select your text and hit the shortcuts. Magic! 🎩✨