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

dessert-markdown-core

v0.2.1

Published

WASM core for showdown module

Downloads

15

Readme

Dessert Markdown

npm-badge license-badge

Exposes the base API for the showdown and marked modules, written in Rust for WebAssembly.

Table of contents

Usage

This module is not supposed to be used directly as a dependence by an application, it is used as a backend for js connector

var showdown  = require('dessert-markdown-core'),
    converter = new showdown.Converter(),
    text      = '# hello, markdown!',
    html      = converter.makeHtml(text);

API

make_html(markdown_string, options)

Converts Markdown to HTML

get_option(key)

Returns the value of the given option key

set_option(key, value)

Sets the value of the given option key

get_options()

Returns all the options and their values

Valid Options

  • noHeaderId: (boolean) [default false] Disable the automatic generation of header ids. Setting to true overrides prefixHeaderId

  • customizedHeaderId: (boolean) [default false] Use text in curly braces as header id.

  • ghCompatibleHeaderId: (boolean) [default false] Generate header ids compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)

  • prefixHeaderId: (string/boolean) [default false] Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section' prefix.

  • rawPrefixHeaderId: (boolean) [default false] Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix). Has no effect if prefixHeaderId is set to false.

  • rawHeaderId: (boolean) [default false] Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids.

  • headerLevelStart: (integer) [default 1] Set the header starting level.

  • strikethrough: (boolean) [default false] Enable support for strikethrough syntax.

  • tables: (boolean) [default false] Enable support for tables syntax.

  • tasklists: (boolean) [default false] Enable support for GFM tasklists.

  • simpleLineBreaks: (boolean) [default false] Parses line breaks as <br>, without needing 2 spaces at the end of the line.

  • requireSpaceBeforeHeadingText: (boolean) [default false] Makes adding a space between # and the header text mandatory.

  • ghMentions: (boolean) [default false] Enables github @mentions, which link to the username mentioned.

  • ghMentionsLink: (string) [default https://github.com/{u}] Changes the link generated by @mentions.

  • openLinksInNewWindow: (boolean) [default false] Open all links in new windows

  • emoji: (boolean) [default false] Enable emoji support. Ex: this is a :smile: emoji

Installation

dessert-markdown-core is depended on by dessert-showdown

npm install dessert-markdown-core

Building

The project is built using wasm-pack
To build the project, run

wasm-pack build

Testing

wasm-pack test --headless --firefox # or --chrome

License

MIT

Contributing

See CONTRIBUTING.md