mirror of
https://github.com/namibia/tips.git
synced 2024-12-22 10:08:58 +00:00
Support alternatives in tips.
This commit is contained in:
parent
a082bb79d2
commit
55778710ea
@ -7,13 +7,18 @@ function escapeStr(str) {
|
||||
var render = function(data) {
|
||||
var data = data.data;
|
||||
|
||||
return [
|
||||
var tips = [
|
||||
'## ' + data.title,
|
||||
'```sh',
|
||||
data.tip,
|
||||
'```',
|
||||
'\n'
|
||||
].join('\n');
|
||||
];
|
||||
Array.isArray(data.alternatives) && tips.push(['__Alternatives:__']) &&
|
||||
data.alternatives.map(function(alternative){
|
||||
tips = tips.concat(['```sh',alternative,'```','\n'])
|
||||
});
|
||||
return tips.join('\n');
|
||||
};
|
||||
|
||||
module.exports = render;
|
||||
|
@ -98,6 +98,12 @@ git remote set-url origin <URL>
|
||||
git remote
|
||||
```
|
||||
|
||||
|
||||
__Alternatives:__
|
||||
```sh
|
||||
git remote show
|
||||
```
|
||||
|
||||
## Get list of all local and remote branches
|
||||
```sh
|
||||
git branch -a
|
||||
|
@ -12,7 +12,8 @@
|
||||
```js
|
||||
{
|
||||
"title": <your_tip_title>,
|
||||
"tip": <your_tip>
|
||||
"tip": <your_tip>,
|
||||
"alternatives": [Optional list of alternatives]
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user