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

prometheus-markdown

v1.3.0

Published

A simple markdown editor for Vue 2

Downloads

4

Readme

Prometheus Markdown Editor

This is a simple markdown editor I made for my website written in Vue2. It was also mainly for me to learn and improve my package development skills, and understand a little more about the build process for front end scripts.

Installation

To install run:

npm i prometheus-markdown

This will add it to your package.json dependencies. The module is exported as a library with its styles inlined, so you can import it into your vue projects.

Usage

I currently only use this in a Laravel Project, so have registered the vue component in my app.js file, which comes as the default with Laravel:

require('./bootstrap');
window.Vue = require('vue').default;

Vue.component('prometheus-markdown', require('prometheus-markdown').default);

const app = new Vue({
    el: '#app',
});

Supported Features

This package uses the marked library to generate a preview of the markdown, and it follows the GitHub Flavoured Markdown syntax (I think).

The toolbar supports the following features

  • Bold Text
  • Italic Text
  • H1, 2, 3, 4
  • Unordered Lists
  • Check Lists
  • Code Blocks
  • Block Quotes
  • Image Upload

The package supports highlighting the text you want to format and then clicking the button wraps the text appropriately.

Clicking without the buttons adds the annotations to the page on a new line.

Shortcut Keys

I have only configured two shortcut keys currently. They are for making text bold and italic. Due to the mappings on your browser, you will either have to disable the browser mappings for your bookmark tab or use the secondary keymappings I have added

Bold - CTRL + ALT + B / CTRL + B Italic - CTRL + ALT + I / CTRL + I

There is an issue with the italic secondary key mapping currently which requires some remapping of your keys. I am open to suggestions for better keymapping alternatives. Feel free to open an issue on GitHub with suggestions.

Uploading Images

The vue component takes a prop of uploadUrl - this accepts a URL, to which a file with a key of file will be posted. The endpoint which receives this should upload the file and return a JSON array with a key of url and a value of the URL pointing to the uploaded file.

If you are using Laravel, there is a companion package, available here: https://packagist.org/packages/drewdan/asset-handler which will add a route to your Laravel application, which is the default setting for this application. Please check the configuration of this package, and add any appropriate middleware to prevent anyone without the correct access from uploading to this endpoint. By default the route is unprotected.