summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-12-08 14:07:17 +0000
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-12-08 14:07:17 +0000
commit14cee8266d8f1ff08b67cd1cf77ab313765a3396 (patch)
tree61c6e524597ebc1a3682c9e92a02bc63f7d785d7
parenta8356ef2681b89bf22270d71254afa587df41e02 (diff)
parentf4f9af06c9e6f468d9f696dbb5438dd8825fe773 (diff)
downloadgitlab-ce-14cee8266d8f1ff08b67cd1cf77ab313765a3396.tar.gz
Merge branch 'enable-asciidoctor-admonition-icons' into 'master'
Enable display of admonition icons in Asciidoc. ## What does this MR do? Enables admonition icons to display in rendered asciidoc documents. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Gitlab support of asciidoc needs a lot of improvements to make it useful in enterprise settings. ## Screenshots (if relevant) ![Screenshot_20161129_132250](/uploads/d280336000eb8b445d07d9bb2a2ed639/Screenshot_20161129_132250.png) ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !7812
-rw-r--r--app/assets/stylesheets/framework.scss1
-rw-r--r--app/assets/stylesheets/framework/asciidoctor.scss27
-rw-r--r--changelogs/unreleased/enable-asciidoctor-admonition-icons.yml4
-rw-r--r--lib/gitlab/asciidoc.rb2
4 files changed, 33 insertions, 1 deletions
diff --git a/app/assets/stylesheets/framework.scss b/app/assets/stylesheets/framework.scss
index 4d4835568ed..c82a9a2b9e3 100644
--- a/app/assets/stylesheets/framework.scss
+++ b/app/assets/stylesheets/framework.scss
@@ -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";
diff --git a/app/assets/stylesheets/framework/asciidoctor.scss b/app/assets/stylesheets/framework/asciidoctor.scss
new file mode 100644
index 00000000000..62493c32833
--- /dev/null
+++ b/app/assets/stylesheets/framework/asciidoctor.scss
@@ -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;
+ }
+}
diff --git a/changelogs/unreleased/enable-asciidoctor-admonition-icons.yml b/changelogs/unreleased/enable-asciidoctor-admonition-icons.yml
new file mode 100644
index 00000000000..9c52e53c3b4
--- /dev/null
+++ b/changelogs/unreleased/enable-asciidoctor-admonition-icons.yml
@@ -0,0 +1,4 @@
+---
+title: Enable AsciiDoctor admonition icons
+merge_request: 7812
+author: Horacio Sanson
diff --git a/lib/gitlab/asciidoc.rb b/lib/gitlab/asciidoc.rb
index 1a22ad9acf5..9667df4ffb8 100644
--- a/lib/gitlab/asciidoc.rb
+++ b/lib/gitlab/asciidoc.rb
@@ -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.