Enable display of admonition icons in Asciidoc.

When rendering Asciidoc documents this merge request enables the diplay of
admonition blocks using font icons. This improves the looks of Asciidoc redered
files.

This uses the font-awesome fonts already present in Gitlab so no large
dependencies are required for this to work.
This commit is contained in:
Horacio Sanson 2016-11-29 13:18:13 +09:00
parent e7b045eada
commit f4f9af06c9
4 changed files with 33 additions and 1 deletions

View file

@ -6,6 +6,7 @@
@import "framework/animations.scss";
@import "framework/avatar.scss";
@import "framework/asciidoctor.scss";
@import "framework/blocks.scss";
@import "framework/buttons.scss";
@import "framework/calendar.scss";

View file

@ -0,0 +1,27 @@
.admonitionblock td.icon {
width: 1%;
[class^="fa icon-"] {
@extend .fa-2x;
}
.icon-note {
@extend .fa-thumb-tack;
}
.icon-tip {
@extend .fa-lightbulb-o;
}
.icon-warning {
@extend .fa-exclamation-triangle;
}
.icon-caution {
@extend .fa-fire;
}
.icon-important {
@extend .fa-exclamation-circle;
}
}

View file

@ -0,0 +1,4 @@
---
title: Enable AsciiDoctor admonition icons
merge_request: 7812
author: Horacio Sanson

View file

@ -6,7 +6,7 @@ module Gitlab
module Asciidoc
DEFAULT_ADOC_ATTRS = [
'showtitle', 'idprefix=user-content-', 'idseparator=-', 'env=gitlab',
'env-gitlab', 'source-highlighter=html-pipeline'
'env-gitlab', 'source-highlighter=html-pipeline', 'icons=font'
].freeze
# Public: Converts the provided Asciidoc markup into HTML.