An Angular library providing an example viewer like the one from Angular Material.
First of all we want to send probs to all the contributors of Angular Material and ngx-formly who gave us the solid base on which this library was created.
npm install @balticcode/ngx-example-viewer highlight.js
You will manually have to add the module import of ExampleViewerModule
into the desired module.
ng add @balticcode/ngx-example-viewer
This will:
- Add
@balticcode/ngx-example-viewer
and its peer dependencies intopackage.json
- Run
npm install
- Import
ExampleViewerModule
into the root module of your default application (or define a project by using--project <PROJECT_NAME>
and/or--module <MODULE_PATH>
as additional CLI parameters)
Check out the demo on how to use this library here.
Besides the basic component theming you can inject your Angular Material theme to make the example viewer match the rest of your application. Here's how it works.
This library utilizes hightlight.js
to provide a themed source view including syntax highlighting. Check out the docs to see how to make it work.
All available themes can be found here.
All languages which support syntax highlighting can be found here