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

metalsmith-robotskirt

v0.1.4

Published

A Metalsmith plugin to convert markdown files with Robotskirt, a node wrapper for Sundown.

Downloads

11

Readme

metalsmith-robotskirt

A Metalsmith plugin to convert markdown files with Robotskirt, a node wrapper for Sundown.

npm Package Version MIT License Dependencies Status devDependencies Status Travis Build Status Code Climate GPA

Installation

$ npm install metalsmith-robotskirt

CLI Usage

Install via npm and then add the metalsmith-robotskirt key to your metalsmith.json with any options you want, like so:

{
  "plugins": {
    "metalsmith-robotskirt": {
      "smartypants": true,
      "extensions": {
        "tables": true
      }
    }
  }
}

Javascript Usage

Pass options to the plugin and pass it to Metalsmith with the use method:

var robotskirt = require('metalsmith-robotskirt');

metalsmith.use(robotskirt({
    smartypants: true,
    extensions: {
        tables: true
    }
}));

Options

All options are optional...

Defaults

var defaults = {
    extensions: {
        autolink: true,
        fenced_code: true,
        lax_spacing: true,
        no_intra_emphasis: true,
        space_headers: true,
        strikethrough: true,
        superscript: true,
        tables: true
    },
    htmlFlags: {
        skip_html: false,
        skip_style: false,
        skip_images: false,
        skip_links: false,
        safelink: false,
        toc: false,
        hard_wrap: false,
        use_xhtml: false,
        expand_tabs: false,
        escape: false
    },
    renderers: {
        blockcode: highlightCodeBlocks
    },
    smartypants: true
};

Extensions

  • autolink
    Parse links even when they are not enclosed in <> characters. Autolinks for the http, https and ftp protocols will be automatically detected. Email addresses are also handled, and http links without protocol, but starting with www.

  • fenced_code
    Parse fenced code blocks, PHP-Markdown style. Blocks delimited with 3 or more ~ or backticks will be considered as code, without the need to be indented. An optional language name may be added at the end of the opening fence for the code block

  • lax_spacing
    HTML blocks do not require to be surrounded by an empty line as in the Markdown standard.

  • no_intra_emphasis
    Do not parse emphasis inside of words. Strings such as foo_bar_baz will not generate <em> tags.

  • space_headers
    A space is always required between the hash at the beginning of a header and its name, e.g. #this is my header would not be a valid header.

  • strikethrough
    Parse strikethrough, PHP-Markdown style. Two ~ characters mark the start of a strikethrough, e.g. this is ~~good~~ bad

  • superscript
    Parse superscripts after the ^ character; contiguous superscripts are nested together, and complex values can be enclosed in parenthesis, e.g. this is the 2^(nd) time

  • tables
    Parse tables, PHP-Markdown style

HTML Flags

  • skip_html
    Do not allow any user-inputted HTML in the output.

  • skip_images
    Do not generate any <img> tags.

  • skip_links
    Do not generate any <a> tags.

  • skip_style
    Do not generate any <style> tags.

  • safelink
    Only generate links for protocols which are considered safe.

  • toc
    Add HTML anchors to each header in the output HTML, to allow linking to each section.

  • hard_wrap Insert HTML <br> tags inside on paragraphs where the origin Markdown document had newlines (by default, Markdown ignores these newlines).

  • use_xhtml Output XHTML-conformant tags.

  • expand_tabs

  • escape

Renderers

You can define your own renderers like this:

var robotskirt = require('metalsmith-robotskirt'),
    highlightjs = require('highlight.js');

function highlight(code, lang) {
    var validLang = lang && highlightjs.getLanguage(lang.trim()),
        highlightedCode = validLang ? highlightjs.highlight(lang, code).value : highlightjs.highlightAuto(code).value,
        langClass = validLang ? ' class="lang-' + lang + '"' : '';
    return '<pre><code' + langClass + '>' + highlightedCode + '</code></pre>';
}

metalsmith.use(robotskirt({
    renderers: {
        blockcode: highlight
    }
}));