@@ -16,7 +16,7 @@ import { DOCUMENT } from '@angular/common';
1616 <mat-tab
1717 *ngFor="
1818 let file of gist.highlightedFiles
19- | gistFileFilter: displayOnlyFileName
19+ | gistFileFilter: displayOnlyFileNames
2020 "
2121 [label]="file.filename"
2222 >
@@ -25,16 +25,18 @@ import { DOCUMENT } from '@angular/common';
2525 </pre>
2626 </mat-tab>
2727 </mat-tab-group>
28- <mat-card-footer>
28+
29+ <mat-card-footer *ngIf="gistIdChanges | async as gid">
2930 <a
30- *ngIf="gistIdChanges | async as gid "
31+ *ngIf="!hideGistLink "
3132 target="_blank"
3233 [href]="'https://gist.github.com/' + gid"
3334 >
3435 <mat-icon>link</mat-icon> Open Gist on GitHub
3536 </a>
3637 </mat-card-footer>
37- <ng-template #loading> Loading Code Snippet... </ng-template>
38+
39+ <ng-template #loading>Loading Code Snippet...</ng-template>
3840 </mat-card>
3941 ` ,
4042 styleUrls : [ './ngx-gist.component.scss' ] ,
@@ -50,13 +52,23 @@ export class NgxGistComponent implements OnInit {
5052 private htmlLinkElement : HTMLLinkElement | null = null ;
5153
5254 /**
53- * Display in the DOM only the selected filename from the gists files array.
54- *
55- * TODO: Make this possible for string array input.
55+ * Display in the DOM only the selected filename(s) from the gists files array.
5656 *
5757 * Default: `undefined`
58+ *
59+ * Example: `'my-styles.scss'` or `'super-feature.ts'`
60+ *
61+ * Tip: Can be either a string or string array. File names much match exactly,
62+ * be sure to remove any leading or trailing whitespace in the provided strings.
63+ */
64+ @Input ( ) public displayOnlyFileNames ?: string | readonly string [ ] ;
65+ /**
66+ * Optionally hide the gist link which opens the gist on GitHub. The gist links
67+ * automatically dispaly for remote gists, but can be hidden with this feature.
68+ *
69+ * Default: `false`
5870 */
59- @Input ( ) public displayOnlyFileName ?: string ;
71+ @Input ( ) public hideGistLink = false ;
6072 /**
6173 * Provide a static gist model here directly which will be displayed if
6274 * no `gistId` is provided for remote fetching. Also this model will be
@@ -77,12 +89,13 @@ export class NgxGistComponent implements OnInit {
7789 * URL of the gists you create. For example the id `TH1515th31DT0C0PY` in:
7890 * https://gist.github.com/FakeUserName/TH1515th31DT0C0PY
7991 *
80- * Alternatively, provide a value directly in the sibling input `gist`.
92+ * Default: `undefined`
93+ *
94+ * Tip: Alternatively, provide a value directly in the sibling input `gist`.
8195 */
8296 @Input ( ) public set gistId ( value : string ) {
8397 this . gistIdSubject . next ( value ) ;
8498 }
85- // We want reactive behavior for `gistId` so we can update gists asynchronously
8699 private readonly gistIdSubject = new ReplaySubject <
87100 NgxGistComponent [ 'gistId' ]
88101 > ( 1 ) ;
@@ -91,22 +104,23 @@ export class NgxGistComponent implements OnInit {
91104 * When defined, override automatic language detection [and styling] and
92105 * treat all gists as this lanuage.
93106 *
94- * See supported languages here:
95- * https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
96- *
97107 * Default: `undefined`
108+ *
109+ * Tip: See supported language strings here:
110+ * https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
98111 */
99112 @Input ( ) public languageName ?: Language [ 'name' ] ;
100113 /**
101114 * Define a material core theme to apply. Ideally, you should already have
102115 * your global material theme set at the root of your project so try to
103- * avoid using this if possible. Note: These are also loaded from a CDN.
116+ * avoid using this if possible.
104117 *
105- * See theming Angular Material: https://material.angular.io/guide/theming
106- *
107- * CDN used: `https://unpkg.com`
118+ * Note: These are loaded from the CDN: `https://unpkg.com`
108119 *
109120 * Default: `undefined`
121+ *
122+ * Tip: See theming Angular Material: https://material.angular.io/guide/theming
123+ * if you need help applying a global material theme.
110124 */
111125 @Input ( ) public materialTheme :
112126 | 'deeppurple-amber'
@@ -117,7 +131,7 @@ export class NgxGistComponent implements OnInit {
117131 /**
118132 * Cache the GitHub gist request in local memory for 24 hours. GitHub has a
119133 * request limit, so this helps in reducing bandwidth. Loads previously
120- * fetched gist content from the users machine.
134+ * fetched gist content from the users machine on refresh and page re-visits .
121135 *
122136 * Default: `true`
123137 */
0 commit comments