或是看看其 readme 的中文翻译
gitignore,readme
… 快速初始化的 js 工具。(运用之前获得的信息+参数)echo "\n4. mrm ***"
mrm readme --config:repos $2 --config:name $1 --config:commit $COMMIT --config:date $DATE
mrm gitignore
请查看入门,了解些知识,再继续
~/dotfiles/mrm/readme/index.js
大体思路,
'name','repos','date','commit'
repos
是ex吗(这样此项目的模版就会是两个主分支:翻译/解释)doc-templite
工具的标记与参数。(doc-templite工具下回分解)const {lines} = require('mrm-core');
function task(config) {
const values = config.require('name', 'repos', 'date', 'commit').values();
console.log(values);
let {name, repos, date, commit} = values;
if (name.endsWith('.git')) {
let origin = 'github.com/';
name = name.slice(name.indexOf(origin) + origin.length, -4);
}
let reposInfo = '';
let enAzh = '';
let other = '';
if (repos === 'ex') {
let sp = name.split('/');
reposInfo = `## explain 🀄️
<!-- doc-templite START generated -->
<!-- time = '${date}' -->
<!-- name = '${sp[0]}' -->
<!-- repo = '${sp[1]}' -->
<!-- commit = '${commit}' -->
<!-- doc-templite END generated -->
`;
other = `### 中文 Readme
[中文](zh.md)
`;
} else {
reposInfo = `## 校对 🀄️
<!-- doc-templite START generated -->
<!-- repo = '${name}' -->
<!-- commit = '${commit}' -->
<!-- time = '${date}' -->
<!-- doc-templite END generated -->
`;
enAzh = `[中文](./readme.md) | [english](https://github.com/${name}) `;
other = `### 贡献
欢迎 👏 勘误/校对/更新贡献 😊 [具体贡献请看](https://github.com/chinanf-boy/chinese-translate-list#贡献)
`;
}
// Read .gitignore if it exists
lines('readme.md')
// Add lines that do not exist in a file yet,
// but keep all existing lines
.add(
`# ${name} [![explain]][source] [![translate-svg]][translate-list]
<!-- [![size-img]][size] -->
[explain]: http://llever.com/explain.svg
[source]: https://github.com/chinanf-boy/Source-Explain
[translate-svg]: http://llever.com/translate.svg
[translate-list]: https://github.com/chinanf-boy/chinese-translate-list
[size-img]: https://packagephobia.now.sh/badge?p=Name
[size]: https://packagephobia.now.sh/result?p=Name
`
)
.add(
`\n
「 desc 」
${enAzh}
---
${reposInfo}
${other}
## 生活
[help me live , live need money 💰](https://github.com/chinanf-boy/live-need-money)
---
### 目录
<!-- START doctoc -->
<!-- END doctoc -->
`
)
// Update or create a file
.save();
}
task.description = 'Adds readme Cool';
module.exports = task;
~/dotfiles/mrm/gitignore/index.js
const {lines} = require('mrm-core');
function task() {
lines('.gitignore')
.add(['node_modules/', '.DS_Store', 'fork', 'source', 'hub-create.sh']) // ✨ 就这样
.save();
}
task.description = 'Adds .gitignore Cool';
module.exports = task;
doc-templite 作为轻量级的模版工具,引入多个项目的特点,专注重复与独特的良好性质。