24.8.6-beta.0 • Published 11 months ago

@qrsln/highlighter v24.8.6-beta.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Highlighter

Support npm npm

Supported Languages: typescript, html, css/scss/less, csharp, javascript, json, php, python, markdown

For Angular

Demo

Properties

Paramsdesc
Themehighlight.js theme default: 'stackoverflow-dark'
Codecode here or innerHTML if code not set it will look innerHTML
LineNumbersLine Numbers default: false
Langcode language here necessary Default value: html
Optionshighlight.js options

app.module.ts

import {HighlighterModule} from '@qrsln/highlighter';

@NgModule({
  imports: [HighlighterModule, /*...*/],
})

Usage

<div Highlighter [theme]="selectedTheme" [lang]="'typescript'"  [lineNumbers]="lineNumbers" [innerHtml]="CODES.Typescript"></div>

<textarea Highlighter [theme]="selectedTheme" [lang]="'csharp'" [lineNumbers]="lineNumbers" [code]="CODES.Typescript"></textarea>
<textarea Highlighter [theme]="selectedTheme" [lang]="'typescript'" [lineNumbers]="lineNumbers">
class MyClass {
  public static myValue: string;
  constructor(init: string) {
    this.myValue = init;
  }
}
import fs = require("fs");
module MyModule {
  export interface MyInterface extends Other {
    myProperty: any;
  }
}
declare magicNumber number;
myArray.forEach(() => { }); // fat arrow syntax
</textarea>
selectedTheme = 'stackoverflow-dark';
lineNumbers = false;

CODES = {
  Typescript: `
class MyClass {
  public static myValue: string;
  constructor(init: string) {
    this.myValue = init;
  }
}
import fs = require("fs");
module MyModule {
  export interface MyInterface extends Other {
    myProperty: any;
  }
}
declare magicNumber number;
myArray.forEach(() => { }); // fat arrow syntax
`,
};

Screenshots

npm.io
npm.io

24.8.6-beta.0

11 months ago

24.3.13-beta.0

1 year ago

24.3.9-beta.0

1 year ago

24.3.9-beta.1

1 year ago

24.2.12-beta.2

1 year ago

23.1.8-beta.0

3 years ago

22.5.5-beta.0

3 years ago

22.2.1

3 years ago

22.1.30

3 years ago

22.2.2

3 years ago

21.8.13

4 years ago

21.8.3

4 years ago

21.3.15

4 years ago

21.3.9

4 years ago

21.2.24

4 years ago

21.2.23

4 years ago

21.2.21

4 years ago

21.1.23

4 years ago

21.1.21

4 years ago