You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ab...@apache.org on 2020/08/11 14:50:42 UTC

[ignite] 04/04: add a check to verify the existence of images at build time

This is an automated email from the ASF dual-hosted git repository.

abudnikov pushed a commit to branch IGNITE-7595
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 3780e741af45b7bbdd2f96755ffbeead68b97e05
Author: abudnikov <ab...@gridgain.com>
AuthorDate: Tue Aug 11 17:49:47 2020 +0300

    add a check to verify the existence of images at build time
---
 docs/_plugins/asciidoctor-extensions.rb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/_plugins/asciidoctor-extensions.rb b/docs/_plugins/asciidoctor-extensions.rb
index c52c3bc..a67f669 100644
--- a/docs/_plugins/asciidoctor-extensions.rb
+++ b/docs/_plugins/asciidoctor-extensions.rb
@@ -135,9 +135,18 @@ class ImageTreeProcessor < Extensions::Treeprocessor
 
     image_width = (document.attr 'image_width', "")
 
+    imagedir =    document.attributes['docdir'] 
+
     #scan for images
     (document.find_by context: :image).each do |img| 
-      if  !(img.attributes['width'] || image_width.empty?)
+
+        imagefile = imagedir + '/' + img.attributes['target']
+
+       if !File.file?(imagefile) 
+          warn 'Image does not exist: ' +imagefile 
+       end
+
+       if !(img.attributes['width'] || image_width.empty?)
            img.attributes['width'] = image_width
        end
     end