-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateMarkdown.js
More file actions
55 lines (48 loc) · 1.52 KB
/
generateMarkdown.js
File metadata and controls
55 lines (48 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// TODO: Create a function that returns a license badge based on which license is passed in
// If there is no license, return an empty string
function renderLicenseBadge(data) {
if (data.license === "None") {
return "";
}
if (data.license === "MIT") {
return `[](https://opensource.org/licenses/MIT)`;
}
if (data.license === "GPL") {
return `[](https://www.gnu.org/licenses/gpl-3.0)`;
}
if (data.license === "Apache Software") {
return `[](https://opensource.org/licenses/Apache-2.0)`;
}
if (data.license === "Boost Software") {
return `[](https://www.boost.org/LICENSE_1_0.txt)`;
}
}
// TODO: Create a function to generate markdown for README
const generateMarkdown = (data) => {
return `
# ${data.title}
${renderLicenseBadge(data)}
## Table of Contents
- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)
- [Contribution](#contribution)
- [Test](#test)
- [GitHub](#gitHub)
- [Questions](#questions)
## Description
${data.description}
## Installation
${data.installation}
## Usage
${data.usage}
## Contribution
${data.contribution}
## Test
${data.test}
## Question
${data.github}
${data.email}
`
};
module.exports = generateMarkdown;