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

fo-markdown-note

v1.1.8

Published

**fo-markdown-note** is a **Vue.js** component that provides a simple Markdown editor that can be included in your Vue.js project.

Downloads

15

Readme

fo-markdown-note Component for Vue.js

fo-markdown-note is a Vue.js component that provides a simple Markdown editor that can be included in your Vue.js project.

fo-markdown-note is a thin Vue.js wrapper around the SimpleMDE Markdown editor JavaScript control. SimpleMDE can be found at:

  • https://simplemde.com/
  • https://github.com/sparksuite/simplemde-markdown-editor

What's New in Version 1.1

fo-markdown-note is now entirely built with Vue CLI3 and its GUI project manager. This greatly simplifies the build process and yields a distributable that is backwards-compatible with older ECMAScript versions through the CLI's use of Babel.

The previous version 1.0 of fo-markown-note was laboriously hand-rolled using rollup.js. Vue CLI3 fully automates the build process and uses webpack to bundle the distributable. This bundling comes for free: we needn't have any knowledge of webpack and don't have to work with it directly. This saves us a tremendous amount of work.

Getting fo-markdown-note

fo-markdown-note is distributed using Node Package Manager (NPM). If you are using NPM directly (i.e. without Vue CLI3), you can install it into your project using the following command:

npm install fo-markdown-note

The preferred way to include fo-markdown-note (or any NPM package) in your Vue project is to use the Vue CLI3 GUI project manager, which you can access using the command

vue ui

After creating your project in the GUI project manager, open it in the GUI and click the Dependencies tab at the left side of the project page. Then click the Install dependency button in the upper-right corner of the page. In the Install new dependency dialog box that appears, select either Main dependency or Development dependency, then search for "fo-markdown-note" and install it.

Using fo-markdown-note

To include fo-markdown-note in your project, include the following import statement at the top of your JavaScript:

import FoMarkdownNote from 'fo-markdown-note'

Then include it as a component in your Vue.js model:

var vueModel = new Vue({
    el: '#app',
    components: {
        FoMarkdownNote
    }
})

This will make the <fo-markdown-note> tag available for use within your project's HTML.

If you are creating a single-file Vue component using a .vue file, your JavaScript will look like this:

<script>
    import FoMarkdownNote from 'fo-markdown-note'

    export default {
        name: 'app',
        components: {
            FoMarkdownNote
        },
    ...

When fo-markdown-note first appears in your application's UI, it is in Preview Mode. This shows the formatted output rendered from the Markdown source. When a user clicks in the body of the note, fo-markdown-note switches into Edit Mode, showing the editable Markdown source. To return to Preview Mode, the user can either press the Escape key or click anywhere outside the note.

Attributes

The following attributes can be included in an <fo-markdown-note> tag:

  • id   Required; every <fo-markdown-note> instance must have a unique id value
  • note   The initial contents of the note

Values for the following attributes are expressed using CSS syntax:

  • bgcolor   The markdown note's background color
  • color   The note's text color
  • fontFamily   The typeface to use
  • fontSize   How big you want the type to be

Events

on-change is the only event fo-markdown-note explicitly raises.

Example

<fo-markdown-note
    id="note1"
    note="Remember to do what I forgot to do."
    bgcolor="LemonChiffon"
    v-on:change="noteOnChange()">
</fo-markdown-note>

Building fo-markdown-note and running the test application

If you want to build fo-markdown-note yourself and run its test application, clone this repository and then open its direcory in the Vue CLI3 GUI project manager. With the project open in the GUI, click the Tasks tab at the left side of the page and then click Serve on the sub-menu that appears.

Dependencies

To see fo-markdown-note's dependencies, open the project in the Vue CLI3 project manager and click the Dependencies tab at the left side of the page.

The distributable bundle contains two dependencies, simplemde and vue itself.

The test application uses interactjs for resizing, but this dependency is not required by fo-markdown-note and isn't bundled in the distributable.

Acknowledgements

Like most open source projects, fo-markdown-note is based on the work of others. The small value fo-markdown-note adds is to wrap and bundle these components into a single-file Vue.js component. The greater value is provided by these amazing projects: