You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Default - fetched gist (auto cached for 24 hours)
150
150
151
151
ngx-gist will fetch the gist once and store it locally for 24 hours. In that timeframe, if the user returns or visits another page where this gist was previously loaded, it will reload the content without having to reach out to GitHub again.
152
152
```html
153
-
<ngx-gistgistId="gistId_123abc"></ngx-gist>
153
+
<ngx-gistgistId="TH1515TH3G15T1D"></ngx-gist>
154
154
```
155
155
156
156
### Fetched gist (forced no cache)
157
157
158
158
Force no cache. This will force ngx-gist to retrieve the content live from GitHub every time this content loads. This is disabled by default, but could be useful if your gists change frequently.
159
159
```html
160
160
<ngx-gist
161
-
gistId="gistId_123abc"
161
+
gistId="TH1515TH3G15T1D"
162
162
[useCache]="false"
163
163
></ngx-gist>
164
164
```
@@ -169,7 +169,7 @@ Select a "highlight.js" code theme to apply. Note: Only one theme can be loaded
169
169
```html
170
170
<ngx-gist
171
171
codeTheme="github"
172
-
gistId="gistId_123abc"
172
+
gistId="TH1515TH3G15T1D"
173
173
></ngx-gist>
174
174
```
175
175
@@ -179,7 +179,7 @@ Display only one specific file when your gist has many.
179
179
```html
180
180
<ngx-gist
181
181
displayOnlyFileNames="super.js"
182
-
gistId="gistId_123abc"
182
+
gistId="TH1515TH3G15T1D"
183
183
></ngx-gist>
184
184
```
185
185
@@ -189,7 +189,7 @@ You can also display any number of specific files by name.
@@ -205,7 +205,7 @@ These are not fetched from GitHub and are brought in elsewhere from your applica
205
205
Line numbers are enabled by default, but you can turn them off like so.
206
206
```html
207
207
<ngx-gist
208
-
gistId="d55ea012b585a16a9970878d90106d74"
208
+
gistId="TH1515TH3G15T1D"
209
209
[showLineNumbers]="false"
210
210
></ngx-gist>
211
211
```
@@ -219,7 +219,7 @@ Line numbers are enabled by default, but you can turn them off like so.
219
219
|**codeTheme**|`HighlightJsTheme` (string) |`'default'`| The `highlight.js` code theme to use and display. Note: Only _one_ theme can be loaded on a single page at a time! The first theme to load will apply to all gists on the page. |
220
220
|**displayOnlyFileNames**|`string \| string[] \| undefined`|`undefined`| Display in the DOM only the selected filename(s) from the gists files array. Can be either a string or string array. File names much match exactly, be sure to remove any leading or trailing whitespace in the provided strings. |
221
221
|**gist**|`NgxGist \| undefined`|`undefined`| Provide a static gist model here directly which will be displayed if no `gistId` is provided for remote fetching. Also this model will be displayed should a fetch fail when retrieving `gistId`, or overwritten once the pertaining `gistId` data is fetched. |
222
-
|**gistId**|`string`|`undefined`| Provide the GitHub gist id to be fetched and loaded. This can be found in URL of the gists you create. For example the id `TH1515TH31DT0C0PY` in: https://gist.github.com/YourUserName/TH1515TH31DT0C0PY. Alternatively, provide a value directly in the sibling input `gist`. |
222
+
|**gistId**|`string`|`undefined`| Provide the GitHub gist id to be fetched and loaded. This can be found in URL of the gists you create. For example the id `TH1515TH3G15T1D` in: https://gist.github.com/YourUserName/TH1515TH3G15T1D. Alternatively, provide a value directly in the sibling input `gist`. |
223
223
|**hideGistLink**|`bool`|`false`| Optionally hide the gist link which opens the gist on GitHub. The gist links automatically display for remote gists, but can be hidden with this feature. |
224
224
|**materialTheme**|`MaterialPrebuiltTheme \| undefined`|`undefined`| Define a material core theme to apply. Ideally, you should already have your global material theme set at the root of your project so try to avoid using this if possible. Note: These are loaded from the CDN: `https://unpkg.com`|
225
225
|**showLineNumbers**|`bool`|`true`| Display or hide the line numbers in your gist code snippets. |
0 commit comments