shlogg · Early preview
Dharmen Shah @shhdharmen

Angular Markdown Renderer With Custom Elements

Angular markdown rendering & component integration: setup markdown-renderer component, render angular components in markdown files using custom elements.

This example demonstrates renderring of markdown in angular and also how to render angular components in markdown.

First, we will setup <markdown-render> component to render .md files. And then we will look how to render angular components.

  
  
  Markdown Renderer

Install needed dependencies:

npm i highlight.js marked marked-highlight

    
    

    
    




  
  
  Step 1: Create markdown-renderer/highlight-code-block.ts

This function will be used to highlight code in our markdown file

import highlightJs from 'highlight.js';
export function highlightCodeBlock(code: string, language:...