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

markdown-cli-compiler

v0.1.1

Published

Converts a markdown file to an HTML one using markdown-it and a lot of plugins.

Downloads

3

Readme

markdown-cli-compiler

Hello, this readme is a WIP.

Installation

npm i -g markdown-cli-compiler

Usage

mdc <args>

CLI arguments

  • --ignore: boolean. Doesn't run the command. Useful in a mdconfig.json.

File I/O args

  • --input or -i: string. the input file path. Can be a Markdown file or a directory.
  • --output or -o: string. The output path. By default it's the input file name with an additional .html extension.
  • --enc: string. Input Markdown file encoding (list of supported encodings). It's also used for the mdconfig.json. Default: utf8

Content args

  • --plugins or -p: array. The names of the plugins to use. Works without the markdown-it- prefix too. got from here. eg: --plugins mark ins
  • --styles or -s: array. The paths of the CSS files that will be linked in a <link> tag in the head of the output html file. Glob works.
  • --hls: string. The name of an highlight.js theme (list of themes). eg: --hls monokai
  • --copiedStyles: array. The paths of the CSS files whose content will be copied and pasted into the output html. Paths should be relative to the output path. Glob works.
  • --inlineStyle: string. Raw CSS to write as it is into a <style> tag.
  • --title: string. Goes in the <title> tag.
  • --comment: boolean. Adds to the html output a comment after <!DOCTYPE html> with in it the command called with all the args.

CLI behaviour args

  • --force: boolean. Doesn't emit a warning before overriding a file. (I wanted the "Are you sure you want to override the file?", but since I haven't made it yet, this doesn't really make sense).
  • --noOk: boolean. Doesn't emit success messages.
  • --noWarn: boolean. Doesn't emit warning messages.
  • --failOnWarn: boolean. Stops the program when encounters a warning.
  • --debug: boolean. Doesn't quit on fail.

markdown-it args

  • --html, --xhtmlOut, --breaks, --langPrefix, --linkify, --typographer and --quotes (all: boolean) are explained here.

mdconfig.json

If the input field is a directory, the program will look for a file named mdconfig.json there. It has to be an array of json objects with configurations that work the same way as the cli args. Aliases like -i, -o and -s will not work. Example.

Basic usage examples

mdc -i .
# compiles the mdconfig.json in the current folder

mdc -i test.md --enc latin1 --typographer
# compiles test.md with latin1 into test.md.html with utf8 with typographer enabled

mdc -i mathfile.md -o math.html -p texmath ins
# uses the markdown-it-texmath plugin and the markdown-it-ins one, list of avaliable plugins is in the dependency list

mdc -i stylish.md -s ../styles/*.css
# references all the css files in the styles folder in the <link> tag in the html