Skip to content

Commit 718fedb

Browse files
committed
chore(demo): add contributor, fix code block overflow
1 parent f2d33cd commit 718fedb

File tree

3 files changed

+38
-28
lines changed

3 files changed

+38
-28
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@
191191
"contributions": [
192192
"code"
193193
]
194+
},
195+
{
196+
"login": "volvachev",
197+
"name": "Egor Volvachev",
198+
"avatar_url": "https://avatars.githubusercontent.com/u/34657605?v=4",
199+
"profile": "https://github.com/volvachev",
200+
"contributions": [
201+
"code"
202+
]
194203
}
195204
],
196205
"commitConvention": "none"

projects/elements-demo/src/styles-reset.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pre {
2626
border-radius: 10px;
2727
padding: 20px !important;
2828
margin: 0 0 20px 0;
29+
overflow: hidden;
2930
}
3031

3132
p {

sync-contributors.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
const fs = require('fs');
2-
3-
const SOURCE = '.all-contributorsrc';
4-
const TARGET =
5-
'./projects/elements-demo/src/app/features/contribute/contribute/contribute.component.html';
6-
const TOKEN_START = '<!-- ALL-CONTRIBUTORS-LIST:START -->';
7-
const TOKEN_END = '<!-- ALL-CONTRIBUTORS-LIST:END -->';
8-
const PATTERN = new RegExp(`${TOKEN_START}[\\s\\S]*${TOKEN_END}`, 'gim');
9-
10-
const contributors = JSON.parse(fs.readFileSync(SOURCE, 'utf8')).contributors;
11-
const content = fs.readFileSync(TARGET, 'utf8');
12-
13-
const data = contributors
14-
.map(
15-
c => `
16-
<a class="contributor" href="${c.profile}" target="_blank">
17-
<img src="${c.avatar_url}">
18-
<span>${c.name}</span>
19-
</a>
20-
`
21-
)
22-
.join('\n');
23-
const replacement = `${TOKEN_START}${data}${TOKEN_END}`;
24-
const adjustedContent = content.replace(PATTERN, replacement);
25-
26-
fs.writeFileSync(TARGET, adjustedContent);
27-
28-
console.log(`${contributors.length} contributors added to HTML`);
1+
const fs = require('fs');
2+
3+
const SOURCE = '.all-contributorsrc';
4+
const TARGET =
5+
'./projects/elements-demo/src/app/features/contribute/contribute.component.html';
6+
const TOKEN_START = '<!-- ALL-CONTRIBUTORS-LIST:START -->';
7+
const TOKEN_END = '<!-- ALL-CONTRIBUTORS-LIST:END -->';
8+
const PATTERN = new RegExp(`${TOKEN_START}[\\s\\S]*${TOKEN_END}`, 'gim');
9+
10+
const contributors = JSON.parse(fs.readFileSync(SOURCE, 'utf8')).contributors;
11+
const content = fs.readFileSync(TARGET, 'utf8');
12+
13+
const data = contributors
14+
.map(
15+
(c) => `
16+
<a class="contributor" href="${c.profile}" target="_blank">
17+
<img src="${c.avatar_url}">
18+
<span>${c.name}</span>
19+
</a>
20+
`
21+
)
22+
.join('\n');
23+
const replacement = `${TOKEN_START}${data}${TOKEN_END}`;
24+
const adjustedContent = content.replace(PATTERN, replacement);
25+
26+
fs.writeFileSync(TARGET, adjustedContent);
27+
28+
console.log(`${contributors.length} contributors added to HTML`);

0 commit comments

Comments
 (0)