Awesome Asciidoctor.js: Server Side Rendering with Font Awesome 5

With Font Awesome 5 icons can be rendered as SVG elements using JavaScript.
This implementation includes an API that can be used to do Server Side Rendering.
By rendering server side you save the browser the effort required to download additional files or perform the rendering calculations.

For reference, the built-in HTML5 converter in Asciidoctor.js 1.5.9 is using Font Awesome 4.7.0 and the icons are rendered as CSS pseudo-elements and styled with the Font Awesome font-family.

In a previous article, we explained how to create a custom HTML5 converter.
In this article, we are going to see how we can use this knowledge to render icons as SVG using the Font Awesome JavaScript API.

Using the Font Awesome JavaScript API

Let’s take a quick look at the Font Awesome JavaScript API.
You can install the library using npm: