• [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

  • 相关阅读:
    如何使用SQL BETWEEN运算符选择指定范围内的值
    如何使用SQL IS NULL和IS NOT NULL运算符
    在Java 中重写equals 和hashCode 时应该考虑哪些问题?
    如何使用SQL NOT运算
    SQL INNER JOIN查询来自两个或多个表的数据
    如何使用SQL IN运算符将列中的值与一组值进行比较
    如何在Java中拆分字符串
    如何使用SQL LIKE运算符来测试表达式是否与模式匹配
    MIT6.830 lab1
    Unity Shader:(九)基础纹理
  • 原文地址:https://www.cnblogs.com/Answer1215/p/9498941.html
Copyright © 2020-2023  润新知