[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")
```
[Maid] Write Tasks in Markdown with Maid的更多相关文章
- 【推理】UVa 10771 - Barbarian tribes
Barbarian tribes In a lost land two primitive tribes coexist: Gareds and Kekas. Every summer sols ...
- 项目开发笔记-传单下发 名片替换 文件复制上传/html静态内容替换/json解析/html解析
//////////////////////////// 注意: 此博客是个人工作笔记 非独立demo////////////////////////////////// .............. ...
- Echarts基于动态数据初步使用 及问题 代码记录.
ECHARTS 插件 基本的动态数据展示(横向图) 下载 echarts.commn.min.js文件 在页面中进行引用, 并为Echarts图形准备一个div盒子 <!-- 引入插件 --&g ...
- 好文推荐系列--------(3)GruntJS 在线重载 提升生产率至新境界
好文原文地址:http://segmentfault.com/a/1190000000354555 本文将首先介绍grunt-markdown插件如何配合HTML模板使用,接着我将介绍如何使用grun ...
- MarkDown入门指南
标题 标题是每篇文章必备而且最常用的格式. 在Markdown中,如果想将一段文字定义为标题,只需要在这段文字前面加上 #,再在 # 后加一个空格即可.还可增加二.三.四.五.六级标题,总共六级,只需 ...
- 网易云免费OSS服务用做Markdown图床或博客图片外链
我使用据说是Windows下最好用的Markdown编辑器“MarkdownPad2”(个人感觉还是Visual Code+Markdown插件666)写Markdown,在贴图方面遇到一个问题,于是 ...
- markdown绘图插件----mermaid简介
作者:黄永刚 mermaid简介 当撰写文档的时候,对于流程图的生成大多使用Visio等繁重的工具,没有一种轻便的工具能够画图从而简化文档的编写,就像markdown那样. mermaid解决这个痛点 ...
- 配置 Sublime Text 3 作为Python R LaTeX Markdown IDE
配置 Sublime Text 3 作为Python R LaTeX Markdown IDE 配置 Sublime Text 3 作为Python IDE IDE的基本功能:代码提醒.补全:编译文件 ...
- 掌握Markdown
翻译自 https://guides.github.com/features/mastering-markdown/ 转载请注明链接 掌握Markdown Markdown是Github平台上一种轻量 ...
随机推荐
- 洛谷 P3371 【模板】单源最短路径(堆优化dijkstra)
题目描述 如题,给出一个有向图,请输出从某一点出发到所有点的最短路径长度. 输入输出格式 输入格式: 第一行包含三个整数N.M.S,分别表示点的个数.有向边的个数.出发点的编号. 接下来M行每行包含三 ...
- 如何选安卓android|linux系统开发板,简化学习难度,缩短开发进程
平台一:iTOP-4412精英版 系统支持:Android 4.0.3系统 / Android 4.4系统 / Linux + Qt系统 / Ubuntu12.04系统 开发板特点:Cortex-A ...
- swift class extension 与继承
1.扩展中无法继承重写已有函数,不能添加函数. Extensions can add new functionality to a type, but they cannot override exi ...
- python学习(day2)
1.常用数据类型及内置方法 1.列表(list) 定义:在中括号[]内存放任意多个值,用逗号隔开. 具体函数和内置方法如下: #定义学生列表,可存放多个学生 students=['a','b','c' ...
- 【转】Google Chrome浏览器调试
作为Web开发人员,我为什么喜欢Google Chrome浏览器 [原文地址:http://www.cnblogs.com/QLeelulu/archive/2011/08/28/2156402.ht ...
- C# 设置系统环境变量
using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; ...
- CREATE AGGREGATE - 定义一个新的聚集函数
SYNOPSIS CREATE AGGREGATE name ( BASETYPE = input_data_type, SFUNC = sfunc, STYPE = state_data_type ...
- BZOJ3545 Peaks 离线处理+线段树合并
题意: 在Bytemountains有N座山峰,每座山峰有他的高度h_i.有些山峰之间有双向道路相连,共M条路径,每条路径有一个困难值,这个值越大表示越难走,现在有Q组询问,每组询问询问从点v开始只经 ...
- mysql错误Error(1133): Can’t find any matching row in the use
执行插入用户语句没有问题,但是执行权限赋值的时候提示:1133 - Can't find any matching row in the user table; 解决办法:插入新的用户成功时,需要刷新 ...
- PHPExcel读取表格内容
PHPExcel读取表格 先引入类IOFactory.php require_once '../PHPExcel/IOFactory.php'; $filePath = "test.xlsx ...