[Maid] Write Tasks in Markdown with Maid

Maid enables you to write your tasks in Markdown. Create a maidfile.md or a README.mdthen add Headers to list out your tasks with codeblocks including the tasks to run. This lesson walks you through creating a few tasks in either a maidfile.md or a README.md and how to execute the tasks from the command line.

 

Install:

npm install maid --save-dev

 

Create a maidfile.md

## hello

```bash
echo "hi"
```

Then run:

npx maid hello

 

-----

A more realworld example can be that we can use maid to run build process

 

Install:

npm i -D parcel

 

## build

```bash
npx parcel build index.html
```

## dev

```bash
npx parcel index.html
```

 

npx maid build

npx maid dev

 

 

----

 

We can also run another task before or after the build task:

## build

Run task `start`.

Run task `end` after.

```bash
npx parcel build index.html
```

## dev

```bash
npx parcel index.html
```

## start

```js
console.log("task start")
```

## end

```js
console.log("task end")
```

 

---

 

Add description for the tasks:

## build

This build the project

Run task `start`.

Run task `end` after.

```bash
npx parcel build index.html
```

## dev

This is for development

```bash
npx parcel index.html
```

## start

This run before the build

```js
console.log("task start")
```

## end

This run after the build

```js
console.log("task end")
```

 

Run: 

npx maid help

 

----

 

Using README.md:

in README file, we just need to add 

<!-- maid-tasks -->

Before the tasks we want to run, and all those tasks should have "###".

# DEMOs

    * mdx-deck
    *react-live
    *maid


## Tasks
<!-- maid-tasks -->

### build

This build the project

Run task `start`.

Run task `end` after.

```bash
npx parcel build index.html
```

### dev

This is for development

```bash
npx parcel index.html
```

### start

This run before the build

```js
console.log("task start")
```

### end

This run after the build

```js
console.log("task end")
```

 

 

Github

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值