9.0.13 • Published 4 years ago

ngx-highlight-js-fork v9.0.13

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

ngx-highlight-js

Angular for syntax highlighting with highlight.js

NPM version Build Status

Demo

Installation instructions

1、Install

npm install --save ngx-highlight-js

Import the HighlightJsModule in to your root AppModule.

import { HighlightJsModule } from 'ngx-highlight-js';
@NgModule({
  imports: [ HighlightJsModule ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

2、Add highlight.js

Load the highlight.js and theme css in page.

<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css">

Only <textarea> Tag

<textarea highlight-js [options]="{}" [lang]="'typescript'">
/* tslint:disable */
import { Component } from '@angular/core';

@Component({
    selector: 'demo',
    templateUrl: './demo.component.html',
    styleUrls: ['./demo.component.scss']
})
export class DemoComponent {
    switchStatus: boolean = true;
}
</textarea>

options equar configure(options). (optional)

lang uses language detection by default but you can specify the language. (optional)

Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.

Thanks for understanding!

License

The MIT License (see the LICENSE file for the full text)

9.0.13

4 years ago

9.0.12

4 years ago

9.0.11

4 years ago

9.0.10

4 years ago

9.0.8

4 years ago

9.0.7

4 years ago

9.0.6

4 years ago

9.0.5

4 years ago

9.0.4

4 years ago

9.0.3

4 years ago

9.0.2

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago