lib/asciidoctor/standoc/macros.rb in metanorma-standoc-1.2.0 vs lib/asciidoctor/standoc/macros.rb in metanorma-standoc-1.2.1

- old
+ new

@@ -80,17 +80,18 @@ end nil end def self.generate_file parent, reader + localdir = Utils::localdir(parent.document) src = reader.source !reader.lines.first.sub(/\s+$/, "").match /^@startuml($| )/ or src = "@startuml\n#{src}\n@enduml\n" /^@startuml (?<filename>[^\n]+)\n/ =~ src filename ||= parent.document.reader.lineno - FileUtils.mkdir_p "plantuml" - File.open("plantuml/#{filename}.pml", "w") { |f| f.write src } - system "plantuml plantuml/#{filename}.pml" + FileUtils.mkdir_p "#{localdir}/plantuml" + File.open("#{localdir}plantuml/#{filename}.pml", "w") { |f| f.write src } + system "plantuml #{localdir}plantuml/#{filename}.pml" filename end def self.generate_attrs attrs through_attrs = %w(id align float title role width height alt).