Skip to content

Commit

Permalink
propagate filename into asciidoctor processing; metanorma/metanorma-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis authored and strogonoff committed Oct 31, 2018
1 parent d710918 commit da4a4c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/metanorma/iso/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def version
"Metanorma::ISO #{Metanorma::ISO::VERSION}"
end

def input_to_isodoc(file)
Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
def input_to_isodoc(file, filename)
Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
end

def output(isodoc_node, outname, format, options={})
Expand Down
21 changes: 10 additions & 11 deletions spec/asciidoctor-iso/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
expect(Metanorma::ISO::VERSION).not_to be nil
end

#it "generates output for the Rice document" do
#FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
##system "cd spec/examples; asciidoctor --trace -b iso -r 'metanorma-iso' rice.adoc; cd ../.."
#FileUtils.cd "spec/examples"
#Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
#FileUtils.cd "../.."
#expect(File.exist?("spec/examples/rice.xml")).to be true
#expect(File.exist?("spec/examples/rice.doc")).to be true
#expect(File.exist?("spec/examples/rice.html")).to be true
#expect(File.exist?("spec/examples/rice_alt.html")).to be true
#end
it "generates output for the Rice document" do
FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
FileUtils.cd "spec/examples"
Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
FileUtils.cd "../.."
expect(File.exist?("spec/examples/rice.xml")).to be true
expect(File.exist?("spec/examples/rice.doc")).to be true
expect(File.exist?("spec/examples/rice.html")).to be true
expect(File.exist?("spec/examples/rice_alt.html")).to be true
end

it "processes a blank document" do
expect(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)).to be_equivalent_to <<~"OUTPUT"
Expand Down

0 comments on commit da4a4c5

Please sign in to comment.