Skip to content

Commit 021452d

Browse files
committed
Update layout and readme
1 parent c5f7e7b commit 021452d

8 files changed

+39
-16
lines changed

README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
[![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)
2020
[![Gitter Chat](https://badges.gitter.im/ProAngular/lobby.svg)](https://gitter.im/ProAngular/community)
2121
[![Discord Chat](https://img.shields.io/discord/1003103094588055552?label=Discord)](https://discord.com/channels/1003103094588055552)
22-
[![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)
23-
[![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)
2422
[![Sponsors](https://img.shields.io/github/sponsors/proangular?label=Sponsors)](https://github.com/sponsors/ProAngular)
2523
[![License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](/LICENSE)
24+
[![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)
25+
[![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)
2626

2727
<!--
2828
[![StackBlitz](https://badgen.net/badge/StackBlitz/Offline/red)]()
@@ -104,12 +104,30 @@ export class FeatureModule { }
104104

105105
## Dependencies
106106

107-
### Styling
107+
### Styling UX - Angular Material
108108

109109
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!
110110

111111
More information on theming Angular Material: https://material.angular.io/guide/theming
112112

113+
### Styling UX Code Snippets - Highlight.js
114+
115+
You can pass in any theme name (string, excluding the file extension ".css") to the input `codeTheme` on _any_ `ngx-gist` element on a single page which will apply the theme to that pages gists.
116+
117+
You can find the available styles here: https://unpkg.com/browse/highlight.js@11.6.0/styles/
118+
119+
Alternatively if you only want to use one style across the whole project or just apply to specific features, I recommend importing the styles directly. To do this install the `highlight.js` package and apply the style. Example below:
120+
121+
```bash
122+
npm install highlight.js --save
123+
```
124+
125+
```diff
126+
...
127+
+ @import "highlight.js/styles/github.css";
128+
...
129+
```
130+
113131
### Core Packages
114132

115133
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.

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@proangular/ngx-gist",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "An Angular Material and HighlighJs styled display box for GitHub gist and local code snippets.",
55
"author": "Pro Angular <webmaster@proangular.com>",
66
"homepage": "https://www.proangular.com",

src/app/layout/footer.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { Component } from '@angular/core';
55
template: `
66
<footer [style.height]="height + 'px'">
77
<a href="https://www.ProAngular.com" target="_blank">
8-
<img src="assets/images/pro-angular-logo.png" />
8+
<img
9+
src="https://www.proangular.com/assets/images/pro-angular-logo-large.png"
10+
/>
911
</a>
1012
<p>
1113
Copyright &copy; Pro Angular 2022

src/app/layout/header.component.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ import { Component } from '@angular/core';
66
<mat-toolbar class="mat-elevation-z6">
77
<mat-toolbar-row>
88
<a class="logo" href="https://www.ProAngular.com" target="_blank">
9-
<img src="assets/images/pro-angular-logo-full.png" />
9+
<img
10+
src="https://www.proangular.com/assets/images/pro-angular-logo-full.png"
11+
/>
1012
</a>
1113
<div class="github-link-container">
1214
<a
1315
href="https://github.com/ProAngular/ngx-gist"
1416
aria-label="GitHub Repo"
1517
target="_blank"
1618
>
17-
<img class="git-hub" src="assets/images/git-hub.svg" />
19+
<img
20+
class="git-hub"
21+
src="https://www.proangular.com/assets/images/git-hub.svg"
22+
/>
1823
</a>
1924
</div>
2025
</mat-toolbar-row>

src/app/public/ngx-gist.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
target="_blank"
4545
[href]="'https://gist.github.com/' + gid"
4646
>
47-
<mat-icon>link</mat-icon> Open Gist on GitHub
47+
&#128279; Open Gist on GitHub
4848
</a>
4949
</mat-card-footer>
5050

src/app/public/ngx-gist.module.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ import { NgxGistService } from './ngx-gist.service';
55
import { MatCardModule } from '@angular/material/card';
66
import { MatTabsModule } from '@angular/material/tabs';
77
import { GistFileFilterPipe } from './ngx-gist-file-filter.pipe';
8-
import { MatIconModule } from '@angular/material/icon';
98
import { NgxGistLineNumbersService } from './ngx-gist-line-numbers.service';
109
import { NgxGistThemeService } from './ngx-gist-theme.service';
1110

1211
@NgModule({
1312
declarations: [NgxGistComponent, GistFileFilterPipe],
1413
imports: [
15-
// Needs to be imported at root.
14+
// Needs to be imported at root. See `README.md` for more info.
1615
// BrowserAnimationsModule,
17-
CommonModule,
18-
// Needs to be imported at root.
1916
// HttpClientModule,
17+
CommonModule,
2018
MatCardModule,
21-
MatIconModule,
2219
MatTabsModule,
2320
],
2421
exports: [NgxGistComponent],

src/styles.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// It's wise to import a prebuilt Material theme or custom theme at the root of
44
// your project when using `@proangular/ngx-gist`.
55

6-
@import "~@angular/material/prebuilt-themes/deeppurple-amber.css";
6+
@import "@angular/material/prebuilt-themes/deeppurple-amber.css";
77

88
/* Alternative pre-built themes.
99
@import "~@angular/material/prebuilt-themes/deeppurple-amber.css";
@@ -18,4 +18,5 @@ body {
1818
background-color: #faf9f6;
1919
}
2020

21-
@import "~highlight.js/styles/github.css";
21+
// Use this to apply a `highlight.js` theme globally
22+
// @import "highlight.js/styles/github.css";

0 commit comments

Comments
 (0)