Skip to content

Commit abf80db

Browse files
committed
Readme updates
1 parent da12a83 commit abf80db

File tree

1 file changed

+57
-9
lines changed

1 file changed

+57
-9
lines changed

README.md

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,46 @@
99
</h1>
1010
</p>
1111

12+
<!-- BADGE: TYPESCRIPT -->
13+
[![TypeScript](https://badgen.net/badge/icon/TypeScript?icon=typescript&label)](https://github.com/ProAngular/ngx-gist/search?l=typescript)
14+
<!-- BADGE: NPM -->
15+
[![npm](https://badgen.net/badge/icon/npm?icon=npm&label)](https://github.com/ProAngular/ngx-gist/search?l=typescript)
16+
<!-- BADGE: PACKAGE VERSION -->
1217
[![npm version](https://badge.fury.io/js/@proangular%2Fngx-gist.svg)](https://badge.fury.io/js/@proangular%2Fngx-gist)
18+
<!-- BADGE: DOWNLOADS -->
1319
[![NPM Downloads](https://img.shields.io/amo/dw/@proangular%252Fngx-gist.svg)](https://www.npmjs.com/@proangular/ngx-gist)
20+
<!-- BADGE: GITTER CHAT -->
1421
[![Join the chat at https://gitter.im/ProAngular/community](https://badges.gitter.im/ProAngular/lobby.svg)](https://gitter.im/ProAngular/community)
22+
<!-- BADGE: GITHUB PACKAGES DEPLOY STATUS -->
1523
[![Verify and Deploy to GitHub Packages](https://github.com/ProAngular/ngx-gist/actions/workflows/on-merge-main-deploy-gpr.yml/badge.svg)](https://github.com/ProAngular/ngx-gist/actions/workflows/on-merge-main-deploy-gpr.yml)
24+
<!-- BADGE: NPMJS PACKAGES DEPLOY STATUS -->
1625
[![Verify and Deploy to npmjs](https://github.com/ProAngular/ngx-gist/actions/workflows/on-merge-main-deploy-npmjs.yml/badge.svg)](https://github.com/ProAngular/ngx-gist/actions/workflows/on-merge-main-deploy-npmjs.yml)
17-
[![Monthly Downloads](https://img.shields.io/npm/dm/@ProAngular/ngx-gist.svg)](https://www.npmjs.com/package/@proangular/ngx-gist)
26+
<!-- BADGE: PACKAGE SIZE -->
1827
[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/ProAngular/ngx-gist.svg)](https://bundlephobia.com/result?p=ProAngular/ngx-gist)
28+
<!-- BADGE: LICENSE -->
1929
[![License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](/LICENSE)
2030

31+
# Information
32+
33+
What is Gist? Gist is an easy method to share snippets or excerpts of data with others. A gist can be a string of code, a bash script or some other small piece of data. These bits of information are hosted by GitHub as a repository.
34+
35+
More info in the following links:
36+
* Little Known Ways To Utilize GitHub Gists: https://www.liquidweb.com/kb/little-known-ways-to-utilize-github-gists/
37+
* GitHub Docs: https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists
38+
* Create a gist: https://gist.github.com/
39+
2140
# Description
2241

23-
An Angular Material and HighlighJs styled display box for GitHub gist and local code snippets. All files from the remote/local gist are displayed in separate tabs for users to easily navigate. Many optional features and themes are available.
42+
Behold, this package contains an Angular Material and HighlighJs styled element which displays your GitHub gists in a conveniant, easy to view interface. Don't have a gist? No problem, display your own code snippets by just passing in the same model! All files from the remote/local gist are displayed in separate tabs for users to easily navigate. Many optional features and themes are available.
43+
44+
GitHub gists can be created here: https://gist.github.com/
2445

2546
Enjoy!
2647

2748
# Demo
2849

2950
TODO: Add demo here.
3051

31-
# Requirements
32-
33-
This project uses Angular Material tabs so Angular Material must be installed and available along with its theme. You can define a theme if you use this application outside of Angular using the public API `materialTheme` (see below for more information). See other peer dependancies in the package description.
34-
3552
# Installation
3653

3754
```bash
@@ -55,6 +72,37 @@ Import `NgxGistModule` where needed
5572
],
5673
...
5774
})
75+
export class FeatureModule { }
76+
```
77+
78+
# Dependencies
79+
80+
### Styling
81+
82+
You should have an Angular Material theme set up prior to using this, but it's not strictly neccessary. Disabled by default, you can alternatively use the `materialTheme` component input (see API documentation below) to auto load a pre-defined Angular Material theme from a CDN. I don't recommend depending on the CDN or this approach, but I wanted to make it possible for you. It's also possible to use this without an angular theme and style it yourself entirely!
83+
84+
More information on theming Angular Material: https://material.angular.io/guide/theming
85+
86+
### Packages
87+
88+
Depending on how your project is set up, you may also need the following imports either in your `FeatureModule` for example or your root module (generally these are already imported in `AppModule` or similar, they are common features of Angular). These dependencies are needed for animating the Angular Material tabs click transition and making an HTTP request to GitHub to retrieve the remote gist information.
89+
90+
Try using `ngx-gist` before importing these, you'll know if you need them if you get a console error in the browser.
91+
92+
```diff
93+
...
94+
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
95+
+ import { HttpClientModule } from '@angular/common/http';
96+
...
97+
98+
@NgModule({
99+
imports: [
100+
...
101+
+ BrowserAnimationsModule,
102+
+ HttpClientModule,
103+
],
104+
...
105+
})
58106
export class AppModule { }
59107
```
60108

@@ -63,9 +111,9 @@ export class AppModule { }
63111
1. Provide your gist id into the input `gistId`, or
64112
2. Provide a direct `NgxGist` mobdel in the input `gist`.
65113

66-
Note: For example your gist id would be `TH1515th31DT0C0PY` in:
114+
Note: For example your gist id would be `TH1515TH31DT0C0PY` in:
67115

68-
https://gist.github.com/YourUserName/TH1515th31DT0C0PY
116+
https://gist.github.com/YourUserName/TH1515TH31DT0C0PY
69117

70118
### Default - fetched gist (auto cached for 24 hours)
71119

@@ -128,7 +176,7 @@ Line numbers are enabled by default, but you can turn them off like so.
128176
| **displayOnlyFileNames** | `string \| readonly 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. |
129177
| **hideGistLink** | `bool` | `false` | Optionally hide the gist link which opens the gist on GitHub. The gist links automatically dispaly for remote gists, but can be hidden with this feature. |
130178
| **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. |
131-
| **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`. |
179+
| **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`. |
132180
| **languageName** | `string \| undefined` | `undefined` | When defined, override automatic language detection [and styling] and treat all gists as this lanuage. See supported language strings here: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md |
133181
| **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` |
134182
| **showLineNumbers** | `bool` | `true` | Display or hide the line numbers in your gist code snippets. |

0 commit comments

Comments
 (0)