Skip to content

Instantly share code, notes, and snippets.

@MurhafSousli
Last active March 28, 2024 02:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MurhafSousli/de9decbcd2539d5ba399aedc598bcaa6 to your computer and use it in GitHub Desktop.
Save MurhafSousli/de9decbcd2539d5ba399aedc598bcaa6 to your computer and use it in GitHub Desktop.
import { provideHighlightOptions } from 'ngx-highlightjs';
export const appConfig: ApplicationConfig = {
providers: [
provideHighlightOptions({
lineNumbersLoader: () => import('ngx-highlightjs/line-numbers'),
coreLibraryLoader: () => import('highlight.js/lib/core'),
languages: {
typescript: () => import('highlight.js/lib/languages/typescript'),
css: () => import('highlight.js/lib/languages/css'),
xml: () => import('highlight.js/lib/languages/xml')
},
themePath: 'assets/styles/androidstudio.css'
})
]
};
import { provideHighlightOptions } from 'ngx-highlightjs';
export const appConfig: ApplicationConfig = {
providers: [
provideHighlightOptions({
fullLibraryLoader: () => import('highlight.js'),
lineNumbersLoader: () => import('ngx-highlightjs/line-numbers'),
themePath: 'assets/styles/androidstudio.css'
})
]
};
import { HighlightAuto } from 'ngx-highlightjs';
import { HighlightLineNumbers } from 'ngx-highlightjs/line-numbers';
@Component({
selector: 'app-root',
template: `
<pre><code [highlightAuto]="code" lineNumbers></code></pre>
`,
standalone: true,
imports: [HighlightAuto, HighlightLineNumbers]
})
export class AppComponent {
}
import { Highlight } from 'ngx-highlightjs';
import { HighlightLineNumbers } from 'ngx-highlightjs/line-numbers';
@Component({
selector: 'app-root',
template: `
<pre><code [highlight]="code" language="html" lineNumbers></code></pre>
`,
standalone: true,
imports: [Highlight, HighlightLineNumbers]
})
export class AppComponent {
}
npm install ngx-highlightjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment