Skip to content

Commit

Permalink
Move lib dependencies to peerDependencies (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcere authored Oct 23, 2022
1 parent 7e7cfe7 commit c95d31b
Show file tree
Hide file tree
Showing 6 changed files with 1,862 additions and 1,472 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ StackBlitz available @ [https://stackblitz.com/edit/ngx-markdown](https://stackb

### ngx-markdown

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

```bash
npm install ngx-markdown --save
npm install ngx-markdown marked --save
npm install @types/marked --save-dev
```

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.
Expand All @@ -71,6 +72,12 @@ If you are using [Angular CLI](https://cli.angular.io/) you can follow the `angu

> :bell: Syntax highlight is **optional**, skip this step if you are not planning to use it
To add [Prism.js](http://prismjs.com/) library to your `package.json` use the following command.

```bash
npm install prismjs --save
```

To activate [Prism.js](http://prismjs.com/) syntax highlight you will need to include...
- prism.js core library - `node_modules/prismjs/prism.js` file
- a highlight css theme - from `node_modules/prismjs/themes` directory
Expand Down Expand Up @@ -231,6 +238,12 @@ Optionally, to automatically present some lines as output without providing the

> :bell: Emoji support is **optional**, skip this step if you are not planning to use it
To add [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) library to your `package.json` use the following command.

```bash
npm install emoji-toolkit --save
```

To activate [Emoji-Toolkit](https://github.com/joypixels/emoji-toolkit) for emoji suppport you will need to include...
- Emoji-Toolkit library - `node_modules/emoji-toolkit/lib/js/joypixels.min.js`

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

> :bell: Math rendering is **optional**, skip this step if you are not planning to use it
To add [KaTeX](https://katex.org/) library to your `package.json` use the following command.

```bash
npm install katex --save
```

To activate [KaTeX](https://katex.org/) math rendering you will need to include...
- KaTex JavaScript library - `node_modules/katex/dist/katex.min.js` file
- KaTex Auto-Render extension - `node_modules/katex/dist/contrib/auto-render.min.js,` file
Expand Down Expand Up @@ -317,6 +336,12 @@ public options: KatexOptions = {

> :bell: Diagram support is **optional**, skip this step if you are not planning to use it
To add [Mermaid](https://mermaid-js.github.io/) library to your `package.json` use the following command.

```bash
npm install mermaid --save
```

To activate [Mermaid](https://mermaid-js.github.io/) diagramming and charting tool you will need to include...
- Mermaid JavaScript library - `node_modules/mermaid/dist/mermaid.min.js` file

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

> :bell: Copy-to-clipboard support is **optional**, skip this step if you are not planning to use it
To add [Clipboard](https://clipboardjs.com/) library to your `package.json` use the following command.

```bash
npm install clipboard --save
```

To activate [Clipboard](https://clipboardjs.com/) allowing copy-to-clipboard you will need to include...
- Clipboard JavaScript library - `node_modules/clipboard/dist/clipboard.min.js` file

Expand Down
5 changes: 5 additions & 0 deletions demo/src/app/plugins/plugins.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<app-scrollspy-nav-layout [headings]="headings">
<h1>Plugins</h1>

<markdown>
<!-- 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. -->
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.
</markdown>

<!-- PLUGINS - Emoji -->
<section>
<h2 id="emoji">Emoji plugin</h2>
Expand Down
10 changes: 8 additions & 2 deletions demo/src/scss/prism-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pre[class*="language-"] {
color: #C586C0;
}

.token.variable,
.token.string,
.token.char,
.token.attr-value,
Expand Down Expand Up @@ -137,8 +138,13 @@ pre[class*="language-"] {
cursor: help;
}

.token.inserted {
color: #8fce00;
/* diff */

.language-diff {

.token.inserted {
color: #8fce00;
}
}

/* Html */
Expand Down
14 changes: 6 additions & 8 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-markdown",
"version": "14.0.1",
"version": "15.0.0-next.0",
"description": "Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights",
"homepage": "https://github.com/jfcere/ngx-markdown",
"license": "MIT",
Expand All @@ -26,21 +26,19 @@
"clipboard",
"clipboard.js"
],
"dependencies": {
"peerDependencies": {
"@angular/common": "^14.0.0",
"@angular/core": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"@types/marked": "^4.0.3",
"clipboard": "^2.0.11",
"emoji-toolkit": "^6.6.0",
"katex": "^0.16.0",
"marked": "^4.0.17",
"mermaid": "^9.1.2",
"prismjs": "^1.28.0",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^14.0.0",
"@angular/core": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"rxjs": "^6.5.3 || ^7.4.0",
"tslib": "^2.3.0",
"zone.js": "^0.11.4"
}
}
51 changes: 29 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-markdown",
"version": "14.0.1",
"version": "15.0.0-next.0",
"description": "Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights",
"homepage": "https://github.com/jfcere/ngx-markdown",
"license": "MIT",
Expand Down Expand Up @@ -46,34 +46,41 @@
"publish:lib": "npm publish ./dist/lib"
},
"dependencies": {
"@angular/animations": "^14.0.0",
"@angular/cdk": "^14.0.0",
"@angular/common": "^14.0.0",
"@angular/compiler": "^14.0.0",
"@angular/core": "^14.0.0",
"@angular/flex-layout": "13.0.0-beta.38",
"@angular/forms": "^14.0.0",
"@angular/material": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"@angular/platform-browser-dynamic": "^14.0.0",
"@angular/router": "^14.0.0",
"@angular/animations": "^14.2.0",
"@angular/cdk": "^14.2.0",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/flex-layout": "14.0.0-beta.41",
"@angular/forms": "^14.2.0",
"@angular/material": "^14.2.0",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"clipboard": "^2.0.11",
"emoji-toolkit": "^6.6.0",
"gumshoejs": "^5.1.2",
"hammerjs": "~2.0.8",
"ngx-markdown": "file:./lib",
"katex": "^0.16.2",
"marked": "^4.1.1",
"mermaid": "^9.1.7",
"ngx-markdown": "file:lib",
"prismjs": "^1.29.0",
"rxjs": "~6.5.3",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.0.0",
"@angular-devkit/build-angular": "^14.2.0",
"@angular-eslint/builder": "~12.6.1",
"@angular-eslint/eslint-plugin": "~12.6.1",
"@angular-eslint/eslint-plugin-template": "~12.6.1",
"@angular-eslint/template-parser": "~12.6.1",
"@angular/cli": "~14.0.0",
"@angular/compiler-cli": "^14.0.0",
"@angular/language-service": "^14.0.0",
"@angular/cli": "~14.2.0",
"@angular/compiler-cli": "^14.2.0",
"@angular/language-service": "^14.2.0",
"@types/jasmine": "~4.0.0",
"@types/marked": "^4.0.7",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"angular-cli-ghpages": "^0.5.3",
Expand All @@ -84,15 +91,15 @@
"eslint-plugin-import": "~2.25.2",
"eslint-plugin-jsdoc": "~37.0.3",
"eslint-plugin-prefer-arrow": "~1.2.3",
"jasmine-core": "~4.1.0",
"karma": "~6.3.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"karma-junit-reporter": "^2.0.1",
"linklocal": "^2.8.2",
"ng-packagr": "^14.0.0",
"ng-packagr": "^14.2.0",
"raw-loader": "4.0.2",
"rimraf": "^2.7.0",
"typescript": "~4.7.2"
Expand Down
Loading

0 comments on commit c95d31b

Please sign in to comment.