Skip to content

Commit d8e011f

Browse files
committed
Add exclude input for repository filtering in demo widget and update documentation
1 parent f5280c3 commit d8e011f

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Peter Benoit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/assets/js/docs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ function initializeDemo() {
8080
const username = document.getElementById('username').value;
8181
const maxRepos = parseInt(document.getElementById('maxRepos').value);
8282
const sortBy = document.getElementById('sortBy').value;
83+
const excludeInput = document.getElementById('exclude').value;
84+
const exclude = excludeInput ? excludeInput.split(',').map(s => s.trim()).filter(s => s) : [];
8385

8486
const columns = {
8587
mobile: parseInt(document.getElementById('columnsMobile').value),
@@ -99,6 +101,7 @@ function initializeDemo() {
99101
columns,
100102
maxRepos,
101103
sortBy,
104+
exclude,
102105
scaleOnHover,
103106
cardStyles: { backgroundColor },
104107
textStyles: {
@@ -116,6 +119,8 @@ function updateConfigDisplay() {
116119
const username = document.getElementById('username').value;
117120
const maxRepos = parseInt(document.getElementById('maxRepos').value);
118121
const sortBy = document.getElementById('sortBy').value;
122+
const excludeInput = document.getElementById('exclude').value;
123+
const exclude = excludeInput ? excludeInput.split(',').map(s => s.trim()).filter(s => s) : [];
119124

120125
const columns = {
121126
mobile: parseInt(document.getElementById('columnsMobile').value),
@@ -135,6 +140,7 @@ function updateConfigDisplay() {
135140
columns,
136141
maxRepos,
137142
sortBy,
143+
exclude,
138144
scaleOnHover,
139145
cardStyles: { backgroundColor },
140146
textStyles: { titleColor, descriptionColor, iconColor }

docs/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ <h2 class="section-title">Live Demo</h2>
277277
<option value="updated">Last Updated</option>
278278
</select>
279279
</div>
280+
<div class="control-item">
281+
<label for="exclude">Exclude Repos (comma separated)</label>
282+
<input type="text" id="exclude" placeholder="repo-name-1, repo-name-2" />
283+
</div>
280284
</div>
281285

282286
<div class="control-group">
@@ -420,6 +424,12 @@ <h3>Configuration Options</h3>
420424
<td>"stars"</td>
421425
<td>Sort criteria: "stars", "forks", "size", "name", "updated"</td>
422426
</tr>
427+
<tr>
428+
<td><code>exclude</code></td>
429+
<td>Array</td>
430+
<td><code>[]</code></td>
431+
<td>Array of repository names to exclude from display</td>
432+
</tr>
423433
<tr>
424434
<td><code>scaleOnHover</code></td>
425435
<td>Number</td>
@@ -501,6 +511,10 @@ <h6><code>scaleOnHover</code> <small>(optional)</small></h6>
501511
<h6><code>maxRepos</code> <small>(optional)</small></h6>
502512
<p>The maximum number of repositories to display.</p>
503513

514+
<h6><code>exclude</code> <small>(optional)</small></h6>
515+
<p>An array of repository names (strings) to exclude from the list.</p>
516+
<pre class="code-block language-javascript"><code>['my-private-repo', 'forked-repo']</code></pre>
517+
504518
<h6><code>sortBy</code> <small>(optional)</small></h6>
505519
<p>The criteria to sort repositories by. Options include:</p>
506520
<ul>

0 commit comments

Comments
 (0)