Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/ascii_binder/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,19 @@ def configure_and_generate_page(topic,branch_config,navigation)
])

File.open topic.source_path, 'r' do |topic_file|

doc = without_warnings { Asciidoctor.load topic_file, :header_footer => false, :safe => :unsafe, :attributes => page_attrs, :base_dir => "." }
relative_prefix = Pathname.pwd().relative_path_from(File.dirname(topic_file))
#puts Pathname.pwd()
#puts topic_file.path
puts relative_prefix
#puts topic.preview_path(distro.id,branch_config.dir)

#relative_prefix = Pathname.new(topic.preview_path(distro.id,branch_config.dir)).relative_path_from(topic_file)
#relative_prefix = Pathname.new(branch_config.dir).relative_path_from(topic_file)
#puts relative_prefix
#puts branch_config.dir
#puts topic.preview_path(distro.id,branch_config.dir)

doc = without_warnings { Asciidoctor.load topic_file, :header_footer => false, :safe => :unsafe, :attributes => ["relative_prefix=#{relative_prefix}"].concat(page_attrs), :base_dir => "." }
article_title = doc.doctitle || topic.name

topic_html = doc.render
Expand Down
2 changes: 1 addition & 1 deletion lib/ascii_binder/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AsciiBinder
VERSION = "0.2.2"
VERSION = "0.2.3"
end