Code Monkey home page Code Monkey logo

derivative-generator's Introduction

衍生品生成器

介绍

这是一个用于生成衍生品的工具,它可以根据模板母版生成衍生品。

template 目录下的文件是模板母版,output 目录下的文件是生成的衍生品。

使用方法

在模版母版根目录下配置 generator.config.json 文件,配置文件格式如下:

{
  "input": [
    {
      "key": "name",
      "default": "默认名称"
    }
  ],
  "replace": [
    {
      "source": "ABC",
      "target": "123"
    },
    {
      "source": "app_name",
      "target": "${name}"
    }
  ]
}

input 字段是用户输入的配置,replace 字段是替换模板中的内容。

字段

  • ${name}:从用户输入的配置中获取

占位符

{{_xxx_}}

支持替换

  • 文件/文件夹名称,如:abc-{{_name_}}.txt,替换后为 abc-默认名称.txt
  • 文件内容,如:123 {{_name_}} 456,替换后为 123 默认名称 456
  • 全局替换,如:123 ABC 456,替换后为 123 123 456
  • .docx 文件,和文件内容替换一样,但不支持全局替换

支持文件类型

自行修改 config/index.ts 中的 allowReplaceFileTypes 字段

derivative-generator's People

Contributors

team-xc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.