Socket
Book a DemoInstallSign in
Socket

@ctrl/ngx-numbered-codeblock

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ctrl/ngx-numbered-codeblock

numbered codeblock and prismjs wrapper for angular

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
1
Created
Source

ngx-numbered-codeblock


npm travis codecov

Prism.js wrapper with built-in line numbers

DEMO: https://ngx-numbered-codeblock.netlify.com/

Installation

npm install @ctrl/ngx-numbered-codeblock

Dependencies

Latest version available for each version of Angular

@ctrl/ngx-numbered-codeblockAngular
2.0.28.x
3.0.19.x
current>= 10

Use

Import the module

// Added to NgModule
import { NumberedCodeblockModule } from '@ctrl/ngx-numbered-codeblock';

// Import your required language in main.ts or at the root of your application
import 'prismjs';
// typescript
import 'prismjs/components/prism-typescript';
// javascript
import 'prismjs/components/prism-javascript';

Use The Component

<ngx-numbered-codeblock [code]="code"></ngx-numbered-codeblock>

Import a theme or create your own

Inputs

  • code - a formatted string of the code to display
  • languague - default: typescript the code parser to use with prismjs
  • lineNumbers - default: true if line numbers should be shown

License

MIT

GitHub @scttcper  ·  Twitter @scttcper

Keywords

prismjs

FAQs

Package last updated on 21 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts