Skip to content

Commit 4b68e5d

Browse files
authored
15.0.0 (#425)
1 parent 044a036 commit 4b68e5d

38 files changed

+3617
-3483
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<img alt="License" src="https://img.shields.io/npm/l/ngx-markdown.svg">
1616
</a>
1717
<br>
18-
<img alt="Dependency Status" src="https://img.shields.io/librariesio/release/npm/ngx-markdown/14.0.1">
18+
<img alt="Dependency Status" src="https://img.shields.io/librariesio/release/npm/ngx-markdown/15.0.0">
1919
<a href="https://www.npmjs.com/package/ngx-markdown">
2020
<img alt="Monthly Downloads" src="https://img.shields.io/npm/dm/ngx-markdown.svg">
2121
</a>
@@ -51,10 +51,11 @@ StackBlitz available @ [https://stackblitz.com/edit/ngx-markdown](https://stackb
5151

5252
### ngx-markdown
5353

54-
To add ngx-markdown library to your `package.json` use the following command.
54+
To add ngx-markdown library to your `package.json` use the following commands.
5555

5656
```bash
57-
npm install ngx-markdown --save
57+
npm install ngx-markdown marked --save
58+
npm install @types/marked --save-dev
5859
```
5960

6061
As the library is using [Marked](https://github.com/chjj/marked) parser you will need to add `node_modules/marked/marked.min.js` to your application.
@@ -71,6 +72,12 @@ If you are using [Angular CLI](https://cli.angular.io/) you can follow the `angu
7172

7273
> :bell: Syntax highlight is **optional**, skip this step if you are not planning to use it
7374
75+
To add [Prism.js](http://prismjs.com/) library to your `package.json` use the following command.
76+
77+
```bash
78+
npm install prismjs --save
79+
```
80+
7481
To activate [Prism.js](http://prismjs.com/) syntax highlight you will need to include...
7582
- prism.js core library - `node_modules/prismjs/prism.js` file
7683
- a highlight css theme - from `node_modules/prismjs/themes` directory
@@ -231,6 +238,12 @@ Optionally, to automatically present some lines as output without providing the
231238

232239
> :bell: Emoji support is **optional**, skip this step if you are not planning to use it
233240
241+
To add [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) library to your `package.json` use the following command.
242+
243+
```bash
244+
npm install emoji-toolkit --save
245+
```
246+
234247
To activate [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) for emoji suppport you will need to include...
235248
- Emoji-Toolkit library - `node_modules/emoji-toolkit/lib/js/joypixels.min.js`
236249

@@ -259,6 +272,12 @@ Using `markdown` component and/or directive, you will be able to use the `emoji`
259272

260273
> :bell: Math rendering is **optional**, skip this step if you are not planning to use it
261274
275+
To add [KaTeX](https://katex.org/) library to your `package.json` use the following command.
276+
277+
```bash
278+
npm install katex --save
279+
```
280+
262281
To activate [KaTeX](https://katex.org/) math rendering you will need to include...
263282
- KaTex JavaScript library - `node_modules/katex/dist/katex.min.js` file
264283
- KaTex Auto-Render extension - `node_modules/katex/dist/contrib/auto-render.min.js,` file
@@ -317,6 +336,12 @@ public options: KatexOptions = {
317336

318337
> :bell: Diagram support is **optional**, skip this step if you are not planning to use it
319338
339+
To add [Mermaid](https://mermaid-js.github.io/) library to your `package.json` use the following command.
340+
341+
```bash
342+
npm install mermaid --save
343+
```
344+
320345
To activate [Mermaid](https://mermaid-js.github.io/) diagramming and charting tool you will need to include...
321346
- Mermaid JavaScript library - `node_modules/mermaid/dist/mermaid.min.js` file
322347

@@ -367,6 +392,12 @@ public options: MermaidAPI.Config = {
367392

368393
> :bell: Copy-to-clipboard support is **optional**, skip this step if you are not planning to use it
369394
395+
To add [Clipboard](https://clipboardjs.com/) library to your `package.json` use the following command.
396+
397+
```bash
398+
npm install clipboard --save
399+
```
400+
370401
To activate [Clipboard](https://clipboardjs.com/) allowing copy-to-clipboard you will need to include...
371402
- Clipboard JavaScript library - `node_modules/clipboard/dist/clipboard.min.js` file
372403

angular.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"outputPath": "dist/demo",
2121
"index": "demo/src/index.html",
2222
"main": "demo/src/main.ts",
23-
"polyfills": "demo/src/polyfills.ts",
23+
"polyfills": [
24+
"zone.js"
25+
],
2426
"tsConfig": "demo/tsconfig.app.json",
2527
"assets": [
2628
"demo/src/favicon.ico",
@@ -83,12 +85,6 @@
8385
"maximumError": "10kb"
8486
}
8587
],
86-
"fileReplacements": [
87-
{
88-
"replace": "demo/src/environments/environment.ts",
89-
"with": "demo/src/environments/environment.prod.ts"
90-
}
91-
],
9288
"outputHashing": "all"
9389
},
9490
"development": {
@@ -150,9 +146,12 @@
150146
"test": {
151147
"builder": "@angular-devkit/build-angular:karma",
152148
"options": {
153-
"main": "lib/test.ts",
154149
"tsConfig": "lib/tsconfig.spec.json",
155-
"karmaConfig": "lib/karma.conf.js"
150+
"karmaConfig": "lib/karma.conf.js",
151+
"polyfills": [
152+
"zone.js",
153+
"zone.js/testing"
154+
]
156155
}
157156
},
158157
"lint": {

demo/browserslist

Lines changed: 0 additions & 16 deletions
This file was deleted.

demo/src/app/app.component.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "~@angular/material/theming";
1+
@use '@angular/material' as mat;
22

33
// variables
44

@@ -24,7 +24,7 @@ $viewport-offset-x: 16px;
2424
}
2525

2626
.mat-tab-nav-bar--sticky {
27-
@include mat-elevation(6);
27+
@include mat.elevation(6);
2828
transition: box-shadow .3s ease-out;
2929
}
3030

@@ -39,6 +39,8 @@ $viewport-offset-x: 16px;
3939
}
4040

4141
.mat-tab-link {
42+
font-size: 14px;
43+
font-weight: 500;
4244
margin: 0 $viewport-offset-x;
4345
min-width: 0;
4446
padding: 0;

demo/src/app/app.component.theme.scss

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
@import '~@angular/material/theming';
1+
@use 'sass:map';
2+
@use '@angular/material' as mat;
23

3-
@mixin app-component-theme($theme) {
4-
$primary: map-get($theme, primary);
4+
@mixin theme($theme) {
5+
$color-config: mat.get-color-config($theme);
6+
7+
$primary-palette: map.get($color-config, 'primary');
8+
$primary-color: mat.get-color-from-palette($primary-palette, 'default');
9+
$primary-contrast: mat.get-color-from-palette($primary-palette, 'default-contrast');
10+
11+
a.mat-tab-link,
12+
a.mat-tab-link:active,
13+
a.mat-tab-link:focus,
14+
a.mat-tab-link:visited {
15+
color: $primary-contrast;
16+
}
17+
18+
.mat-ink-bar {
19+
background-color: $primary-contrast;
20+
}
521

622
.mat-toolbar.mat-primary {
7-
background: linear-gradient(90deg, mat-color($primary) 15%, darken(mat-color($primary), 4%) 100%);
23+
background: linear-gradient(90deg, $primary-color 15%, darken($primary-color, 4%) 100%);
824
}
925

1026
.mat-tab-nav-bar.mat-background-primary {
11-
background: mat-color($primary);
27+
background: $primary-color;
1228
}
1329
}

demo/src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { HttpClient, HttpClientModule } from '@angular/common/http';
22
import { NgModule, SecurityContext } from '@angular/core';
3-
import { MatButtonModule } from '@angular/material/button';
43
import { MatIconModule } from '@angular/material/icon';
5-
import { MatTabsModule } from '@angular/material/tabs';
4+
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
5+
import { MatLegacyTabsModule as MatTabsModule } from '@angular/material/legacy-tabs';
66
import { MatToolbarModule } from '@angular/material/toolbar';
77
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
88
import { ClipboardOptions, MarkdownModule, MarkedOptions, MarkedRenderer } from 'ngx-markdown';

demo/src/app/bindings/bindings.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
3-
import { MatInputModule } from '@angular/material/input';
3+
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
44
import { MarkdownModule } from 'ngx-markdown';
55

66
import { ScrollspyNavLayoutModule } from '@shared/scrollspy-nav-layout/scrollspy-nav-layout.module';

demo/src/app/plugins/plugins.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<app-scrollspy-nav-layout [headings]="headings">
22
<h1>Plugins</h1>
33

4+
<markdown>
5+
<!-- Before to use any plugin, make sure you've installed the required libraries by following the [installation](https://jfcere.github.io/ngx-markdown/get-started#installation) section of the __Get Started__ page. -->
6+
Before to use any plugin, make sure you've installed the required libraries by following the [installation](/get-started#installation) section of the __Get Started__ page.
7+
</markdown>
8+
49
<!-- PLUGINS - Emoji -->
510
<section>
611
<h2 id="emoji">Emoji plugin</h2>

demo/src/app/plugins/plugins.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChangeDetectionStrategy, Component, ElementRef, OnInit } from '@angular/core';
2-
import { MatSnackBar } from '@angular/material/snack-bar';
2+
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
33
import { ClipboardOptions, MermaidAPI } from 'ngx-markdown';
44

55
import { ClipboardButtonComponent } from '@shared/clipboard-button';

demo/src/app/plugins/plugins.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
3-
import { MatInputModule } from '@angular/material/input';
4-
import { MatSnackBarModule } from '@angular/material/snack-bar';
3+
import { MatLegacyInputModule as MatInputModule} from '@angular/material/legacy-input';
4+
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
55
import { MarkdownModule } from 'ngx-markdown';
66

77
import { ClipboardButtonModule } from '@shared/clipboard-button';

demo/src/app/rerender/rerender.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
3-
import { MatInputModule } from '@angular/material/input';
3+
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
44
import { MarkdownModule } from 'ngx-markdown';
55

66
import { ScrollspyNavLayoutModule } from '@shared/scrollspy-nav-layout/scrollspy-nav-layout.module';

demo/src/app/shared/clipboard-button/clipboard-button.component.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import '~@angular/material/theming';
2-
31
.btn-clipboard {
42
height: 30px;
53
width: 30px;

demo/src/app/shared/clipboard-button/clipboard-button.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChangeDetectionStrategy, Component } from '@angular/core';
2-
import { MatSnackBar } from '@angular/material/snack-bar';
2+
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
33

44
@Component({
55
selector: 'app-clipboard-button',

demo/src/app/shared/clipboard-button/clipboard-button.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
2-
import { MatButtonModule } from '@angular/material/button';
3-
import { MatSnackBarModule } from '@angular/material/snack-bar';
2+
import { MatLegacyButtonModule as MatButtonModule} from '@angular/material/legacy-button';
3+
import { MatLegacySnackBarModule as MatSnackBarModule} from '@angular/material/legacy-snack-bar';
44

55
import { ClipboardButtonComponent } from './clipboard-button.component';
66

demo/src/app/shared/scrollspy-nav-layout/scrollspy-nav-layout.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
33
import { FlexLayoutModule } from '@angular/flex-layout';
4-
import { MatButtonModule } from '@angular/material/button';
54
import { MatDividerModule } from '@angular/material/divider';
5+
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
66
import { MarkdownModule } from 'ngx-markdown';
77

88
import { ScrollspyNavModule } from '@shared/scrollspy-nav/scrollspy-nav.module';

demo/src/app/shared/scrollspy-nav/scrollspy-nav.component.theme.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
@import '~@angular/material/theming';
1+
@use 'sass:map';
2+
@use '@angular/material' as mat;
23

3-
@mixin scrollspy-nav-component-theme($theme) {
4-
$accent: map-get($theme, accent);
5-
$foreground: map-get($theme, foreground);
4+
@mixin theme($theme) {
5+
$color-config: mat.get-color-config($theme);
6+
7+
$accent-palette: map.get($color-config, 'accent');
8+
$accent-color: mat.get-color-from-palette($accent-palette, 'default');
9+
$accent-contrast: mat.get-color-from-palette($accent-palette, 'default-contrast');
610

711
ul.scrollspy-nav {
812

913
li {
10-
border-left: 2px solid mat-color($accent);
11-
box-shadow: inset 1px 0 0 mat-color($accent);
14+
border-left: 2px solid $accent-color;
15+
box-shadow: inset 1px 0 0 $accent-color;
1216

1317
&:not(.active) {
14-
box-shadow: inset 1px 0 0 mat-color($foreground, text, .21);
18+
box-shadow: inset 1px 0 0 rgba($accent-contrast, .21);
1519

1620
a:not(:hover) {
17-
color: mat-color($foreground, text);
21+
color: $accent-contrast;
1822
}
1923
}
2024
}

demo/src/environments/environment.prod.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

demo/src/environments/environment.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

demo/src/main.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import { enableProdMode } from '@angular/core';
21
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32
import 'hammerjs';
43

54
import { AppModule } from './app/app.module';
6-
import { environment } from './environments/environment';
75
import './prism';
86

9-
if (environment.production) {
10-
enableProdMode();
11-
}
12-
137
platformBrowserDynamic().bootstrapModule(AppModule)
148
.catch(err => console.error(err));

0 commit comments

Comments
 (0)