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

wxi-flavored-markdown

v0.88.0

Published

A markdown parser with a little bit of WeaponXI flavor

Downloads

21

Readme

 __      __   __   __   ______   ____                
/\ \  __/\ \ /\ \ /\ \ /\__  _\ /\  _`\   /'\_/`\    
\ \ \/\ \ \ \\ `\`\/'/'\/_/\ \/ \ \ \L\_\/\      \   
 \ \ \ \ \ \ \`\/ > <     \ \ \  \ \  _\/\ \ \__\ \  
  \ \ \_/ \_\ \  \/'/\`\   \_\ \__\ \ \/  \ \ \_/\ \ 
   \ `\___x___/  /\_\\ \_\ /\_____\\ \_\   \ \_\\ \_\
    '\/__//__/   \/_/ \/_/ \/_____/ \/_/    \/_/ \/_/
                                                     
                                                     

WXI Flavored Markdown

This is a package that adds a couple new features to markdown without tinkering with other markdown flavors such as GitHub Flavored Markdown (GFM) or the default markdown parser.

This is a npm package that extends marked package, a markdown parser library, by chjj@github

The WXI Flavor:

As of v0.6 it adds:

Meta Tags:

Use if you want to add information about the file. Meta name (such as author or version) will be converted to lowercase so don't worry about matching the standarts' case. You can add one line metas with @@name: value or multiline metas by surrounding with @@@ ... @@@.

Examples
One Line
@@Author: Logan Howlett
@@VErSiOn: 0.6    <- This is the same 
@@version: 0.7    <- As this
@@VeRSION: 0.8    <- Or this, or "version" and "VERSION"
Duis autem vel eum iriure dolor in hendrerit 
in vulputate velit esse molestie consequat, 
vel illum dolore eu feugiat nulla facilisis.
Multi Line
@@@
description:Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Phasellus vel sapien quis leo volutpat viverra. 
Pellentesque tempor tortor sagittis diam volutpat facilisis. 
Aenean eleifend tristique.
@@@
@@@
description2:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Phasellus vel sapien quis leo volutpat viverra. 
Pellentesque tempor tortor sagittis diam volutpat facilisis. 
Aenean eleifend tristique.
@@@
@@@description3
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Phasellus vel sapien quis leo volutpat viverra. 
Pellentesque tempor tortor sagittis diam volutpat facilisis. 
Aenean eleifend tristique.
@@@

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Installation

To install automatically:

Soon it will be a node package, until then use manual installation. However when the package is published WXIFM can be installed by this command:

$``npm install wxifm

Or if you want to install the package and automatically save dependency to your package.json

$``npm install wxifm --save

Manual installation from reposotory:

Clone reposotory:

$``git clone [email protected]:aponxi/npm-wxi-flavored-markdown.git

Usage

Example

# require module
wxi_flavor = require ('wxifm')

# let the text be some file
fs = require 'fs'
text = fs.readFileSync('test.md','utf8')

# Parse the text by
# new wxi_flavor (String text[, Object options]);
t = new wxi_flavor text, {validate: on}
# meta information is stored in wxi_flavor.meta
# lets view the meta information (prettyfied) that has been parsed in console.
console.log JSON.stringify t.meta, null, "    "
# render the text as html
rendered = t.render()
# view rendered output in console
console.log rendered

Output would be:

{
    "author": [
        "nox"
    ],
    "homepage": [
        "www.weaponxi.com"
    ],
    "tags": {
        "markdown": null,
        "github": null,
        "repetitivetag": null,
        "tagwithsubtags": [
            "subtag"
        ],
        "another": [
            "subtag",
            "subtag2",
            "repeating",
            "this",
            "repeating"
        ]
    },
    "version": "1.0.2",
    "status": [
        "stable"
    ],
    "url": [
        "http://www.something.com"
    ],
    "description3": [
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit. \nPhasellus vel sapien quis leo volutpat viverra. \nPellentesque tempor tortor sagittis diam volutpat facilisis. \nAenean eleifend tristique."
    ],
    "description1": [
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit. \nPhasellus vel sapien quis leo volutpat viverra. \nPellentesque tempor tortor sagittis diam volutpat facilisis. \nAenean eleifend tristique."
    ],
    "description2": [
        "\nLorem ipsum dolor sit amet, consectetur adipiscing elit. \nPhasellus vel sapien quis leo volutpat viverra. \nPellentesque tempor tortor sagittis diam volutpat facilisis. \nAenean eleifend tristique."
    ]
}

And it outputs the rendered text.

Options

  • validate (boolean):
    • on: Turns on validation
    • off: Turns off validation
  • ignore_invalid (boolean):
    • on : Don't return invalid metas but return others
    • off : All must be valid to return results
  • cover_tracks (boolean):
    • on : Remove metas found before rendering markdown
    • off: Setting off

Standards - Currently this means nothing skip this section

Following are the guidlines to what is being processed as standard meta names:

  • version
  • tags
  • description
  • author

Validation

Right now there are several manipulations to the gathered data, and I tend to keep them customizable. As we are in Beta development Validations are hardcoded and will be available for customization in near future.

Meta Name Validations

  • If the name is uppercase it will be converted into all lowercase. This is hardcoded.

Meta Value Validations

Version
  • When there is a "v" in front of the version number such as v1.0 we will parse it into 1.0
  • When there are multiple versions defined, we only get the first one.