From fc96d209c77250fe1b16fa546d7c0a8c115d2b9d Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Wed, 23 Oct 2019 15:49:54 +0200 Subject: [PATCH] Added project-root var resolution in readme generation script --- docs/src/main/ruby/generate_readme.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/main/ruby/generate_readme.sh b/docs/src/main/ruby/generate_readme.sh index 64c6052c..7d624a7c 100755 --- a/docs/src/main/ruby/generate_readme.sh +++ b/docs/src/main/ruby/generate_readme.sh @@ -17,7 +17,10 @@ end file = ARGV[0] if ARGV.length>0 # Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb -doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes] +attributes = {} +attributes['project-root'] = File.expand_path("#{base_dir}/../") + +doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: attributes header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k } attrs = doc.attributes