This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
node_modules | ||
/dist | ||
/build | ||
/public/changelog.html | ||
/public/notification.png | ||
|
||
# local env files | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
|
||
const fs = require('fs'); | ||
const marked = require('marked'); | ||
const path = require('path'); | ||
const striptags = require('striptags'); | ||
|
||
const file = path.resolve(__dirname, '..', 'CHANGELOG.md'); | ||
const destination = path.resolve(__dirname, '..', 'public', 'changelog.html'); | ||
let contents = '# Changelog not found.'; | ||
|
||
if (fs.existsSync(file)) { | ||
contents = fs.readFileSync(file, 'utf-8'); | ||
} | ||
|
||
let html = marked(contents); | ||
html = striptags(html, ['h1', 'h3', 'ul', 'li', 'strong']); | ||
html = html.replace(/\([0-9a-z]*\)/g, ''); | ||
|
||
fs.writeFileSync(destination, html); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters