[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平台上一种轻量 ...
随机推荐
- 大写URL转小写
添加LowercaseRoutesMVC.dll引用.通过“管理—NuGet程序包”搜索LowercaseRoutesMVC,然后点击安装.安装成功后会自动引用LowercaseRoutesMVC.d ...
- CAD参数绘制直线(com接口)
用户可以在CAD控件视区任意位置绘制直线. 主要用到函数说明: _DMxDrawX::DrawLine 绘制一个直线.详细说明如下: 参数 说明 DOUBLE dX1 直线的开始点x坐标 DOUBLE ...
- incremental linking(增量链接)的作用
转:incremental linking(增量链接)的作用 今天编译一个C++程序时,报了一个奇怪的错误(之前是好好的): 1>LINK : fatal error LNK1123: fail ...
- 散列的键值对没初始化时不要用print打印此值,不要用 . 操作符去连接打印 这个值。
31 delete $vertical_alignment{$anonymous}; 32 print $vertical_alignment{$anonymous}."\n&quo ...
- javascript——js string 转 int 注意的问题——parseInt(转)
<script> var str='1250' ; alert( Number(str) ); //得到1250 alert(parseInt(str)); //得到12 ...
- css一个div设置多个背景图片
html:定义一个div <div class="item__content"></div> css:样式 .item__content { positio ...
- Python3.5安装wxpython
摘要:安装python3.X的wxpython:学习<Python基础教程>第12章“图形用户界面”时,关于升级pip和安装wxpython时遇到的一些问题和解决办法. 关于升级pip 使 ...
- BZOJ1001 狼抓兔子 平面图转对偶图 最小割
现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的,而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为 ...
- mysql解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)的报错
一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...
- 慕课笔记利用css进行布局【一列布局】
<html> <head> <title>一列布局</title> <style type="text/css"> bo ...