markdown-magic-prettier
Prettify JS blocks
Last updated 2 years ago by camachgk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install markdown-magic-prettier 
SYNC missed versions from official npm registry.

markdown-magic-prettier

Use prettier to format JS codeblocks in markdown files via markdown-magic

Install

yarn add -D markdown-magic markdown-magic-prettier prettier

Note: prettier is a peer dependency and must be installed separately from this module

Adding the plugin

See example.js for usage.

const fs = require('fs');
const path = require('path');
const markdownMagic = require('markdown-magic');

const config = {
  transforms: {
    PRETTIER: require('./index.js'),
  },
};

const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);

Usage in markdown

Wrap code blocks to format the content.

console.log('hello world');

Options

All prettier options are supported.

There are a few defaults set:

const defaults = {
  singleQuote: true,
  trailingComma: 'es5',
};

Current Tags

  • 1.0.4                                ...           latest (2 years ago)

5 Versions

  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 8
Dependencies (0)
None
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |