diff --git a/README.md b/README.md index d40d55d..ad7fea7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- +

@@ -9,30 +9,72 @@

-[![npm version](https://badge.fury.io/js/@proangular%2Fngx-gist.svg)](https://badge.fury.io/js/@proangular%2Fngx-gist) -[![NPM Downloads](https://img.shields.io/amo/dw/@proangular%252Fngx-gist.svg)](https://www.npmjs.com/@proangular/ngx-gist) -[![Join the chat at https://gitter.im/ProAngular/community](https://badges.gitter.im/ProAngular/lobby.svg)](https://gitter.im/ProAngular/community) -[![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) -[![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) -[![Monthly Downloads](https://img.shields.io/npm/dm/@ProAngular/ngx-gist.svg)](https://www.npmjs.com/package/@proangular/ngx-gist) -[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/ProAngular/ngx-gist.svg)](https://bundlephobia.com/result?p=ProAngular/ngx-gist) +[![npm](https://badgen.net/badge/icon/npm?icon=npm&label)](https://www.npmjs.com/@proangular/ngx-gist) +[![GitHub](https://badgen.net/badge/icon/GitHub?icon=github&label)](https://github.com/ProAngular/ngx-gist) +[![TypeScript](https://badgen.net/badge/icon/TypeScript?icon=typescript&label)](https://github.com/ProAngular/ngx-gist/search?l=typescript) +[![npm Version](https://badge.fury.io/js/@proangular%2Fngx-gist.svg)](https://www.npmjs.com/@proangular/ngx-gist) +[![Node Version](https://badgen.net/npm/node/@proangular/ngx-gist)](https://www.npmjs.com/@proangular/ngx-gist) +[![Package Downloads](https://badgen.net/npm/dw/@proangular/ngx-gist)](https://www.npmjs.com/@proangular/ngx-gist) +[![Size](https://img.shields.io/bundlephobia/minzip/@proangular/ngx-gist.svg)](https://bundlephobia.com/result?p=ProAngular/ngx-gist) +[![Website Status](https://img.shields.io/website?down_color=lightgrey&down_message=Offline&label=Website&up_color=green&up_message=Online&url=https%3A%2F%2Fwww.proangular.com)](https://www.proangular.com) +[![Gitter Chat](https://badges.gitter.im/ProAngular/lobby.svg)](https://gitter.im/ProAngular/community) +[![Discord Chat](https://img.shields.io/discord/1003103094588055552?label=Discord)](https://discord.com/channels/1003103094588055552) +[![GitHub Package Status](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) +[![npmjs Package Status](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) +[![Sponsors](https://img.shields.io/github/sponsors/proangular?label=Sponsors)](https://github.com/sponsors/ProAngular) [![License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](/LICENSE) -# Description + -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. +## Table of Contents + +- [Information](#information) +- [Description](#description) +- [Demo](#demo) +- [Installation](#installation) +- [Dependencies](#dependencies) +- [Usage](#usage) +- [Component API](#api) +- [Compatibility](#compatibility) +- [Issues & Contribution](#development) +- [Donations](#donations) +- [License](#license) + +
+ +## Information + +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. + +More info in the following links: +* Little Known Ways To Utilize GitHub Gists: https://www.liquidweb.com/kb/little-known-ways-to-utilize-github-gists/ +* GitHub Docs: https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists +* Create a gist: https://gist.github.com/ + + + +## Description + +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. + +GitHub gists can be created here: https://gist.github.com/ Enjoy! -# Demo + -TODO: Add demo here. +## Demo -# Requirements +

+ +

-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. +
-# Installation +## Installation ```bash ng add @proangular/ngx-gist@latest @@ -55,23 +97,60 @@ Import `NgxGistModule` where needed ], ... }) +export class FeatureModule { } +``` + + + +## Dependencies + +### Styling + + 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! + +More information on theming Angular Material: https://material.angular.io/guide/theming + +### Core Packages + +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. + +Try using `ngx-gist` before importing these, you'll know if you need them if you get a console error in the browser. + +```diff +... ++ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; ++ import { HttpClientModule } from '@angular/common/http'; +... + +@NgModule({ + imports: [ + ... ++ BrowserAnimationsModule, ++ HttpClientModule, + ], + ... +}) export class AppModule { } ``` -# Usage +See other `peerDependencies` you may need in the package.json in the root of this project. + + + +## Usage 1. Provide your gist id into the input `gistId`, or 2. Provide a direct `NgxGist` mobdel in the input `gist`. -Note: For example your gist id would be `TH1515th31DT0C0PY` in: +Note: For example your gist id would be `TH1515TH3G15T1D` in: -https://gist.github.com/YourUserName/TH1515th31DT0C0PY +https://gist.github.com/YourUserName/TH1515TH3G15T1D ### Default - fetched gist (auto cached for 24 hours) 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. ```html - + ``` ### Fetched gist (forced no cache) @@ -79,18 +158,28 @@ ngx-gist will fetch the gist once and store it locally for 24 hours. In that tim 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. ```html ``` +### Setting the code style theme + +Select a "highlight.js" code theme to apply. 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. +```html + +``` + ### Displaying one specific file Display only one specific file when your gist has many. ```html ``` @@ -100,13 +189,13 @@ You can also display any number of specific files by name. ```html ``` ### Displaying a basic code snippet (without a remote gist) -These are not fetched from GitHub and are brought in elsewhere from your application (seperate HTTP request, or statically for example). With this method you can display code snippets without having to create a remote gist. Also, please notice here that no "Open Gist on GitHub" link is displayed here. +These are not fetched from GitHub and are brought in elsewhere from your application (seperate HTTP request, or statically for example). With this method you can display code snippets without having to create a remote gist. Also, please notice here that no "Open Gist on GitHub" link will display as well. ```html ``` @@ -116,25 +205,29 @@ These are not fetched from GitHub and are brought in elsewhere from your applica Line numbers are enabled by default, but you can turn them off like so. ```html ``` -# Component API + + +## Component API + +| Input Name | Input Typing | Default Value | Description | +| ------------------------ | ------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **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. | +| **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. | +| **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. | +| **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`. | +| **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. | +| **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` | +| **showLineNumbers** | `bool` | `true` | Display or hide the line numbers in your gist code snippets. | +| **useCache** | `bool` | `true` | Cache the GitHub gist request in local memory for 24 hours. GitHub has a request limit, so this helps in reducing bandwidth. Loads previously fetched gist content from the users machine on refresh and page re-visits. | -| Input Name | Input Typing | Default Value | Description | -| ------------------------ | ------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **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. | -| **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. | -| **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. | -| **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`. | -| **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 | -| **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` | -| **showLineNumbers** | `bool` | `true` | Display or hide the line numbers in your gist code snippets. | -| **useCache** | `bool` | `true` | Cache the GitHub gist request in local memory for 24 hours. GitHub has a request limit, so this helps in reducing bandwidth. Loads previously fetched gist content from the users machine on refresh and page re-visits. | + -# Compatibility +## Compatibility | Angular version | @proangular/ngx-gist | Install | | --------------- | -------------------------- | ------------------------------------ | @@ -142,7 +235,9 @@ Line numbers are enabled by default, but you can turn them off like so. | v13 | v1.x.x | `ng add @proangular/ngx-gist@latest` | | v12 | v1.x.x | `ng add @proangular/ngx-gist@latest` | -# Development + + +## Issues & Contribution Please submit all issues, and feature requests here: [https://github.com/ProAngular/ngx-gist/issues](https://github.com/ProAngular/ngx-gist/issues) @@ -162,13 +257,17 @@ Contribution: Thank you for any and all contributions! -# Donation + + +## Donation As a husband and father of four children, your donations mean the world to me! Any donations are greatly appreciated and keep me going! -* [https://www.paypal.me/CodyTolene](https://www.paypal.me/CodyTolene) * [https://github.com/sponsors/ProAngular](https://github.com/sponsors/ProAngular) +* [https://www.paypal.me/CodyTolene](https://www.paypal.me/CodyTolene) + + -# License +## License Copyright © 2022 [Cody Tolene](https://www.CodyTolene.com) diff --git a/package-lock.json b/package-lock.json index 7cf7b5a..85bddca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@proangular/ngx-gist", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 46bed62..f531cd0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@proangular/ngx-gist", - "version": "1.0.4", + "version": "1.0.5", "description": "An Angular Material and HighlighJs styled display box for GitHub gist and local code snippets.", "author": "Pro Angular ", "homepage": "https://www.proangular.com", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index cd575d4..603bbbc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,17 +33,32 @@ import { Component } from '@angular/core'; [useCache]="false" > +

SETTING THE CODE STYLE THEME

+

+ Select a "highlight.js" code theme to apply. 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. +

+ +

DISPLAYING ONE SPECIFIC FILE

Display only one specific file when your gist has many.

DISPLAYING MULTIPLE, SPECIFIC FILES

You can also display any number of specific files by name.

diff --git a/src/app/public/ngx-gist-theme.service.ts b/src/app/public/ngx-gist-theme.service.ts index 3f3b1a3..783bbb2 100644 --- a/src/app/public/ngx-gist-theme.service.ts +++ b/src/app/public/ngx-gist-theme.service.ts @@ -6,27 +6,63 @@ export class NgxGistThemeService { public constructor(@Inject(DOCUMENT) private readonly document: Document) {} private importElMaterialTheme: HTMLLinkElement | null = null; + private importElHljsTheme: HTMLLinkElement | null = null; - public setTheme(materialPrebuiltTheme: MaterialPrebuiltTheme): void { - const themeId = 'material-theme-import'; - const currentEl = this.document.getElementById(themeId); - - if (currentEl) { - this.document.removeChild(currentEl); + public setTheme({ + materialTheme, + hilightJsTheme, + }: { + materialTheme?: MaterialPrebuiltTheme; + hilightJsTheme?: HighlightJsTheme; + } = {}): void { + if (!materialTheme && !hilightJsTheme) { + throw new Error('You must provide a theme.'); } - if (this.importElMaterialTheme) { - this.document.removeChild(this.importElMaterialTheme); - } + const materialThemeId = 'material-theme-import'; + const hljsThemeId = 'hljs-theme-import'; - this.importElMaterialTheme = this.document.createElement('link'); - this.importElMaterialTheme.href = `https://unpkg.com/@angular/material@14.1.0/prebuilt-themes/${materialPrebuiltTheme}.css`; - this.importElMaterialTheme.media = 'screen,print'; - this.importElMaterialTheme.rel = 'stylesheet'; - this.importElMaterialTheme.type = 'text/css'; - this.importElMaterialTheme.id = themeId; + const materialThemeLinkEl = this.document.getElementById(materialThemeId); + if (materialThemeLinkEl && !hilightJsTheme) { + // Material theme aleady exists, return. + return; + } - this.document.head.appendChild(this.importElMaterialTheme); + const hljsThemeLinkEl = this.document.getElementById(hljsThemeId); + if (hljsThemeLinkEl && hilightJsTheme === 'default' && !materialTheme) { + // Default theme already in use, return. + console.log('returned'); + return; + } else if ( + hljsThemeLinkEl && + hilightJsTheme !== 'default' && + !materialTheme + ) { + // Override previously used theme, but remove it first. + console.log('remove'); + this.document.head.removeChild(hljsThemeLinkEl); + } + console.log('info: ', materialTheme, hilightJsTheme); + if (materialTheme) { + // !!! Update version when needed. + const version = '14.1.0'; + const url = `@angular/material@${version}/prebuilt-themes/${materialTheme}.css`; + this.importElMaterialTheme = this.document.createElement('link'); + this.importElMaterialTheme.href = `https://unpkg.com/${url}`; + this.importElMaterialTheme.rel = 'stylesheet'; + this.importElMaterialTheme.id = materialThemeId; + this.document.head.appendChild(this.importElMaterialTheme); + } else if (hilightJsTheme) { + console.log('apply', hilightJsTheme); + // !!! Update version when needed. + const version = '11.6.0'; + const url = `highlight.js@${version}/styles/${hilightJsTheme}.css`; + this.importElHljsTheme = this.document.createElement('link'); + this.importElHljsTheme.href = `https://unpkg.com/${url}`; + this.importElHljsTheme.rel = 'stylesheet'; + this.importElHljsTheme.id = hljsThemeId; + this.document.head.appendChild(this.importElHljsTheme); + } } } @@ -35,3 +71,77 @@ export type MaterialPrebuiltTheme = | 'indigo-pink' | 'pink-bluegrey' | 'purple-green'; + +export type HighlightJsTheme = + | 'a11y-dark' + | 'a11y-light' + | 'agate' + | 'androidstudio' + | 'an-old-hope' + | 'arduino-light' + | 'arta' + | 'ascetic' + | 'atom-one-dark' + | 'atom-one-dark-reasonable' + | 'atom-one-light' + | 'brown-paper' + | 'codepen-embed' + | 'color-brewer' + | 'dark' + | 'default' + | 'devibeans' + | 'docco' + | 'far' + | 'felipec' + | 'foundation' + | 'github' + | 'github-dark' + | 'github-dark-dimmed' + | 'gml' + | 'googlecode' + | 'gradient-dark' + | 'gradient-light' + | 'grayscale' + | 'hybrid' + | 'idea' + | 'intellij-light' + | 'ir-black' + | 'isbl-editor-dark' + | 'isbl-editor-light' + | 'kimbie-dark' + | 'kimbie-light' + | 'lightfair' + | 'lioshi' + | 'magula' + | 'mono-blue' + | 'monokai' + | 'monokai-sublime' + | 'night-owl' + | 'nnfx-dark' + | 'nnfx-light' + | 'nord' + | 'obsidian' + | 'panda-syntax-dark' + | 'panda-syntax-light' + | 'paraiso-dark' + | 'paraiso-light' + | 'pojoaque' + | 'purebasic' + | 'qtcreator-dark' + | 'qtcreator-light' + | 'rainbow' + | 'routeros' + | 'school-book' + | 'shades-of-purple' + | 'srcery' + | 'stackoverflow-dark' + | 'stackoverflow-light' + | 'sunburst' + | 'tokyo-night-dark' + | 'tokyo-night-light' + | 'tomorrow-night-blue' + | 'tomorrow-night-bright' + | 'vs' + | 'vs2015' + | 'xcode' + | 'xt256'; diff --git a/src/app/public/ngx-gist.component.ts b/src/app/public/ngx-gist.component.ts index f7c3f2e..8cb0860 100644 --- a/src/app/public/ngx-gist.component.ts +++ b/src/app/public/ngx-gist.component.ts @@ -2,13 +2,13 @@ import { NgxGistService } from './ngx-gist.service'; import { isNonEmptyValue } from './ngx-gist.utilities'; import { NgxGist } from './ngx-gist.model'; import { Component, Inject, Input, OnInit } from '@angular/core'; -import { Language } from 'highlight.js'; import { BehaviorSubject, filter, firstValueFrom, ReplaySubject } from 'rxjs'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { DOCUMENT } from '@angular/common'; import { NgxGistLineNumbersService } from './ngx-gist-line-numbers.service'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { + HighlightJsTheme, MaterialPrebuiltTheme, NgxGistThemeService, } from './ngx-gist-theme.service'; @@ -27,7 +27,7 @@ import { [label]="file.filename" >
-            
@@ -57,14 +57,10 @@ export class NgxGistComponent implements OnInit {
   public constructor(
     @Inject(DOCUMENT) private readonly document: Document,
     private readonly domSanitizer: DomSanitizer,
-    private readonly ngxGistService: NgxGistService,
     private readonly ngxGistLineNumbersService: NgxGistLineNumbersService,
+    private readonly ngxGistService: NgxGistService,
     private readonly ngxGistThemeService: NgxGistThemeService,
   ) {}
-
-  // TODO: Apply HighlightJs code theme.
-  // @Input() public codeTheme?: unknown;
-
   /**
    * Display in the DOM only the selected filename(s) from the gists files array.
    *
@@ -115,15 +111,14 @@ export class NgxGistComponent implements OnInit {
   >(1);
   public readonly gistIdChanges = this.gistIdSubject.asObservable();
   /**
-   * When defined, override automatic language detection [and styling] and
-   * treat all gists as this lanuage.
+   * The `highlight.js` code theme to use and display.
    *
-   * Default: `undefined`
+   * Default: `'default'`
    *
-   * Tip: See supported language strings here:
-   * https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
+   * 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.
    */
-  @Input() public languageName?: Language['name'];
+  @Input() public codeTheme: HighlightJsTheme = 'default';
   /**
    * 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
@@ -153,12 +148,16 @@ export class NgxGistComponent implements OnInit {
   @Input() public useCache = true;
 
   public async ngOnInit(): Promise {
-    this.setTheme();
+    // Load themes
+    this.setMaterialTheme();
+    this.setHljsTheme();
 
+    // Load line numbers
     if (this.showLineNumbers) {
       await this.ngxGistLineNumbersService.load();
     }
 
+    // Load gist(s) async
     this.gistIdChanges
       .pipe(filter(isNonEmptyValue), untilDestroyed(this))
       .subscribe(async (gistId) => {
@@ -189,11 +188,18 @@ export class NgxGistComponent implements OnInit {
     }
   }
 
-  private setTheme(): void {
+  private setHljsTheme(): void {
+    if (!this.codeTheme) {
+      return;
+    }
+    this.ngxGistThemeService.setTheme({ hilightJsTheme: this.codeTheme });
+  }
+
+  private setMaterialTheme(): void {
     if (!this.materialTheme) {
       return;
     }
-    this.ngxGistThemeService.setTheme(this.materialTheme);
+    this.ngxGistThemeService.setTheme({ materialTheme: this.materialTheme });
   }
 
   public applyLineNumbers(highlightedConent: string): SafeHtml | null {
diff --git a/src/app/public/public.ts b/src/app/public/public.ts
index 3081920..da3764d 100644
--- a/src/app/public/public.ts
+++ b/src/app/public/public.ts
@@ -1,5 +1,9 @@
 /** Public API Exports for Node Package */
 
+export {
+  HighlightJsTheme,
+  MaterialPrebuiltTheme,
+} from './ngx-gist-theme.service';
 export * from './ngx-gist.component';
 export * from './ngx-gist.model';
 export * from './ngx-gist.module';
diff --git a/src/assets/images/demo-gist.gif b/src/assets/images/demo-gist.gif
new file mode 100644
index 0000000..9c5c755
Binary files /dev/null and b/src/assets/images/demo-gist.gif differ
diff --git a/src/styles.scss b/src/styles.scss
index 906298e..4316880 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -17,3 +17,5 @@ body {
   margin: 0;
   background-color: #faf9f6;
 }
+
+@import "~highlight.js/styles/github.css";