-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtempGenerator.js
33 lines (32 loc) · 921 Bytes
/
tempGenerator.js
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
//import argv from './yargsConfig';
/* eslint-disable no-undef */
module.exports = tempGenerate = (
argv_s,
argv_l,
title,
titleName = "",
text
) => {
let style = argv_s
? `<link rel="stylesheet" type="text/css" href="${argv_s}" />`
: `<link rel="stylesheet" type="text/css" href="please_add_your_css_path" />`;
let lang = argv_l ? `<html lang="${argv_l}">` : `<html lang="en-CA">`;
let titleLine = title ? `<title>${title}</title>` : "";
let body = text ? `${text}` : "";
var template = `
<!doctype html>
${lang}
<head>
<meta charset="utf-8">
${style}
${titleLine}
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
${titleName}
${text}
</body>
</html>
`;
return template;
};