Skip to content

Instantly share code, notes, and snippets.

@ggrossetie
Last active October 20, 2019 14:12
Show Gist options
  • Save ggrossetie/ba83ea2287a737d85afac8feb7f3b009 to your computer and use it in GitHub Desktop.
Save ggrossetie/ba83ea2287a737d85afac8feb7f3b009 to your computer and use it in GitHub Desktop.

Asciidoctor icons permutations

Currently FontAwesome 4 is used in:

  • admonition

  • callout

  • icon macro

  • colist

  • unordered list (checked, unchecked)

  • menu macro (angle-right)

In each of those cases, we check if the attribute icons equals font to enable FontAwesome. Otherwise we either use unicode characters or images.

Rendering

  • client-side using CSS with a custom font

  • client-side using JavaScript (replace an HTML element by an inline SVG image)

  • server-side using <img> or <svg> element

When using server-side rendering we can either use a src attribute to reference the path to the image or inline the image (with base64 or inline svg).

Mode

  • image (svg, png, jpeg)

  • font

  • unicode?

Attributes

  • imagesdir (default ./images)

  • iconsdir (default $imagesdir/icons)

  • icontype (default png)

  • icons

Image library

Name

Supported mode

FontAwesome4

font

FontAwesome5

image and font

Feather

image

Icon resolver

Currently, icons can be resolved using CSS and a custom font (FontAwesome 4) or using the local file system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment