lib/ascii_binder/engine.rb in ascii_binder-0.1.13 vs lib/ascii_binder/engine.rb in ascii_binder-0.1.14
- old
+ new
@@ -8,11 +8,10 @@
require 'asciidoctor/cli'
require 'asciidoctor-diagram'
require 'fileutils'
require 'find'
require 'git'
-require 'pandoc-ruby'
require 'pathname'
require 'sitemap_generator'
require 'trollop'
require 'yaml'
@@ -132,11 +131,11 @@
next if path.nil? or not path =~ /.*\.adoc/ or path =~ /README/ or path =~ /\/old\// or path =~ /\/_/
src_path = Pathname.new(path).sub(docs_root_dir,'').to_s
next if src_path.split('/').length < 3
file_list << src_path
end
- file_list.map{ |path| File.join(File.dirname(path),File.basename(path,'.adoc')) }
+ file_list.map{ |path| File.join(File.dirname(path),File.basename(path,'.adoc'))[1..-1] }
end
def remove_found_topic_files(branch,branch_topic_map,branch_topic_files)
nonexistent_topics = []
branch_topic_map.filepaths.each do |topic_map_filepath|
@@ -487,32 +486,35 @@
subgroup_id = breadcrumb[1][:id]
dir_depth = '../' + dir_depth
end
preview_path = topic.preview_path(distro.id,branch_config.dir)
+ topic_publish_url = topic.topic_publish_url(distro.site.url,branch_config.dir)
page_args = {
- :distro_key => distro.id,
- :distro => branch_config.distro_name,
- :site_name => distro.site.name,
- :site_url => distro.site.url,
- :topic_url => preview_path,
- :version => branch_config.name,
- :group_title => group_title,
- :subgroup_title => subgroup_title,
- :topic_title => topic_title,
- :article_title => article_title,
- :content => topic_html,
- :navigation => navigation,
- :group_id => group_id,
- :subgroup_id => subgroup_id,
- :topic_id => topic_id,
- :css_path => "../../#{dir_depth}#{branch_config.dir}/#{STYLESHEET_DIRNAME}/",
- :javascripts_path => "../../#{dir_depth}#{branch_config.dir}/#{JAVASCRIPT_DIRNAME}/",
- :images_path => "../../#{dir_depth}#{branch_config.dir}/#{IMAGE_DIRNAME}/",
- :site_home_path => "../../#{dir_depth}index.html",
- :template_path => template_dir,
- :repo_path => topic.repo_path,
+ :distro_key => distro.id,
+ :distro => branch_config.distro_name,
+ :branch => branch_config.id,
+ :site_name => distro.site.name,
+ :site_url => distro.site.url,
+ :topic_url => preview_path,
+ :topic_publish_url => topic_publish_url,
+ :version => branch_config.name,
+ :group_title => group_title,
+ :subgroup_title => subgroup_title,
+ :topic_title => topic_title,
+ :article_title => article_title,
+ :content => topic_html,
+ :navigation => navigation,
+ :group_id => group_id,
+ :subgroup_id => subgroup_id,
+ :topic_id => topic_id,
+ :css_path => "../../#{dir_depth}#{branch_config.dir}/#{STYLESHEET_DIRNAME}/",
+ :javascripts_path => "../../#{dir_depth}#{branch_config.dir}/#{JAVASCRIPT_DIRNAME}/",
+ :images_path => "../../#{dir_depth}#{branch_config.dir}/#{IMAGE_DIRNAME}/",
+ :site_home_path => "../../#{dir_depth}index.html",
+ :template_path => template_dir,
+ :repo_path => topic.repo_path,
}
full_file_text = page(page_args)
File.write(preview_path,full_file_text)
end