Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Commit 2c75f66

Browse files
koddssonkeithamus
andcommitted
Generate license info in README
Co-authored-by: Keith Cirkel <[email protected]>
1 parent 2294b04 commit 2c75f66

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,10 @@ Browsers without native [custom element support][support] require a [polyfill][]
8181
- Firefox
8282
- Safari
8383
- Microsoft Edge
84+
8485
[support]: https://caniuse.com/custom-elementsv1
85-
[polyfill]: https://github.com/webcomponents/custom-elements
86+
[polyfill]: https://github.com/webcomponents/custom-elements
87+
88+
## License
89+
90+
Distributed under the MIT license. See LICENSE for details.

cem-plugin-readme.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Browsers without native [custom element support][support] require a [polyfill][]
1616
- Firefox
1717
- Safari
1818
- Microsoft Edge
19+
1920
[support]: https://caniuse.com/custom-elementsv1
2021
[polyfill]: https://github.com/webcomponents/custom-elements`
2122
}
@@ -44,6 +45,12 @@ Include with a script tag:
4445
\`\`\``
4546
}
4647

48+
function generateLicense() {
49+
return `## License
50+
51+
Distributed under the MIT license. See LICENSE for details.`
52+
}
53+
4754
const escapeHTML = (html) => {
4855
return html.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;').replaceAll("'", '&#039;');
4956
}
@@ -72,6 +79,7 @@ export function readme(options) {
7279
}
7380

7481
content.push(generateBrowserSupportInstructions())
82+
content.push(generateLicense())
7583
content.push(footer)
7684

7785
writeFileSync(filename, content.filter(Boolean).join('\n\n'))

0 commit comments

Comments
 (0)