@shuent/markdown-generator

0.1.0 • Public • Published

markdown-generator

node.js based CLI md generator that Easily setup to write you markdown content. Especially user for JavaScript based Static site Generator such as Gatsby, Next.js.

usage

node_module./bin mdg today_whether
# => create blog/2021-4-14-today_whether.md

node_module./bin mdg
# => create blog/2021-4-14-blog.md

Case: added command to package.json

{
  "scripts":{
    "mdg": "mdg"
  }
}
npm run mdg today_whether
# => create blog/2021-4-14-today_whether.md

config

I recommend you to create mdg.config.js at root so that you can create default template. Otherwise, default config inside module is used.

const dateFormat = require("dateformat");

module.exports = {
  fileName: "blog", // required
  directory: "blog", // required
  prefix: dateFormat(new Date(), "yyyy-mm-dd-"),
  template: "./template.md",
  builtinAttribute: {
    date: "yyyy-mm-dd",
  },
};

built in attribute

In addition to the template frontmatter, you can configure built in attribute that will be computed and automatically added.

For now, You can use date and format using this package. https://github.com/felixge/node-dateformat

For more built in attribute, please PR or create issue.

Contribution

Any contribution is welcome.

License

MIT

Package Sidebar

Install

npm i @shuent/markdown-generator

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

9.76 kB

Total Files

9

Last publish

Collaborators

  • shuent