Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Gemfile.lock
*.html
*.swp
_package
_preview
File renamed without changes.
20 changes: 20 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'asciidoctor'
require 'erb'
require 'haml'
require 'tilt'

guard 'shell' do
watch(/^.*\.adoc$/) { |m|
if not m[0].start_with?('_preview')
src_group_path = m[0].split('/')[0]
filename = m[0].split('/')[-1][0..-6]
tgt_file_path = "_preview/#{src_group_path}"
Asciidoctor.render_file m[0], :in_place => true, :safe => :unsafe, :template_dir => '_template', :attributes => ['source-highlighter=coderay','coderay-css=style',"stylesdir=_preview/stylesheets","imagesdir=#{src_group_path}/images",'stylesheet=origin.css','linkcss!','icons=font','idprefix=','idseparator=-','sectanchors']
system('mv', "#{src_group_path}/#{filename}.html", "#{tgt_file_path}/")
end
}
end

guard 'livereload' do
watch(%r{^_preview\.(css|js|html)$})
end
14 changes: 5 additions & 9 deletions _build_system/Rakefile → Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ PACKAGE_DIRNAME = '_package'
BLANK_STRING_RE = Regexp.new('^\s*$')

def source_dir
@source_dir ||= File.expand_path('..',Dir.pwd)
@source_dir ||= File.expand_path(Dir.pwd)
end

def builder_dir
@builder_dir = File.join(source_dir,BUILDER_DIRNAME)
end

def builder_template_dir
@builder_template_dir ||= File.join(builder_dir,'templates')
def template_dir
@template_dir ||= File.join(source_dir,'_templates')
end

def preview_dir
Expand Down Expand Up @@ -115,7 +111,7 @@ end

task :build do
# Copy stylesheets into preview area
system("cp -r #{builder_dir}/stylesheets #{preview_dir}")
system("cp -r _stylesheets #{preview_dir}/stylesheets")
# Build the topic files
build_config.each do |topic_group|
src_group_path = File.join(source_dir,topic_group['Dir'])
Expand All @@ -130,7 +126,7 @@ task :build do
src_file_path = File.join(src_group_path,"#{topic['File']}.adoc")
tgt_file_path = File.join(tgt_group_path,"#{topic['File']}.adoc")
system('cp', src_file_path, tgt_file_path)
Asciidoctor.render_file tgt_file_path, :in_place => true, :safe => :unsafe, :template_dir => builder_template_dir, :attributes => ['source-highlighter=coderay','coderay-css=style',"stylesdir=#{preview_dir}/stylesheets","imagesdir=#{src_group_path}/images",'stylesheet=origin.css','linkcss!','icons=font','idprefix=','idseparator=-','sectanchors']
Asciidoctor.render_file tgt_file_path, :in_place => true, :safe => :unsafe, :template_dir => template_dir, :attributes => ['source-highlighter=coderay','coderay-css=style',"stylesdir=#{preview_dir}/stylesheets","imagesdir=#{src_group_path}/images",'stylesheet=origin.css','linkcss!','icons=font','idprefix=','idseparator=-','sectanchors']
system('rm', tgt_file_path)
end
end
Expand Down
62 changes: 0 additions & 62 deletions _build_system/Gemfile.lock

This file was deleted.

14 changes: 0 additions & 14 deletions _build_system/Guardfile

This file was deleted.

File renamed without changes.
File renamed without changes.