summaryrefslogtreecommitdiff
path: root/lib/gitlab/badge
diff options
context:
space:
mode:
authorJan Christophersen <jan@ruken.pw>2017-02-11 20:15:01 +0100
committerJan Christophersen <jan@ruken.pw>2017-02-20 16:37:44 +0100
commit95ed01749e0ffe55a979acb246ca8e0ae663bffb (patch)
tree2c9f402d710de118e20b69e1d9b6286f50887a97 /lib/gitlab/badge
parentedb8ed36cd5ce315ca45a047bd06ab1dfcf44203 (diff)
downloadgitlab-ce-95ed01749e0ffe55a979acb246ca8e0ae663bffb.tar.gz
Add AsciiDoc snippet for CI/CD Badges
This commit adds CI/CD Badges Snippets for AsciiDoc as requested in #26087. I've however run into an issue in highlighting the snippet, it seems as if AsciiDoc is currently not being highlighted properly (displayed as plaintext) Add testcase for to_asciidoc Update test case for Badges list
Diffstat (limited to 'lib/gitlab/badge')
-rw-r--r--lib/gitlab/badge/metadata.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/badge/metadata.rb b/lib/gitlab/badge/metadata.rb
index 548f85b78bb..4a049ef758d 100644
--- a/lib/gitlab/badge/metadata.rb
+++ b/lib/gitlab/badge/metadata.rb
@@ -20,6 +20,10 @@ module Gitlab
"[![#{title}](#{image_url})](#{link_url})"
end
+ def to_asciidoc
+ "image:#{image_url}[link=\"#{link_url}\",title=\"#{title}\"]"
+ end
+
def title
raise NotImplementedError
end