From 659af29adbd041fbbbaf041ead53266210a61f4e Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 27 Oct 2010 15:31:10 -0700 Subject: jsdoc parser + generator + viewer + scenario runner - parse jsdocs from source code - generate prerendered (markdown + mustache) partials - generate json - generate scenario runner for examples in docs - basic angular doc viewer --- Rakefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index a83b53ad..9a9835ba 100644 --- a/Rakefile +++ b/Rakefile @@ -156,8 +156,14 @@ task :compile => [:init, :compile_scenario, :generate_ie_compat] do end +desc 'Generate docs' +task :docs do + `node docs/collect.js` +end + + desc 'Create angular distribution' -task :package => [:clean, :compile] do +task :package => [:clean, :compile, :docs] do v = YAML::load( File.open( 'version.yaml' ) )['version'] match = v.match(/^([^-]*)(-snapshot)?$/) version = match[1] + (match[2] ? ('-' + %x(git rev-parse HEAD)[0..7]) : '') @@ -178,6 +184,20 @@ task :package => [:clean, :compile] do FileUtils.cp(src, pkg_dir + '/' + dest) end + FileUtils.cp_r path_to('docs'), "#{pkg_dir}/docs-#{version}" + + File.open("#{pkg_dir}/docs-#{version}/index.html", File::RDWR) do |f| + text = f.read + f.rewind + f.write text.sub('angular.min.js', "angular-#{version}.min.js") + end + + File.open("#{pkg_dir}/docs-#{version}/docs-scenario.html", File::RDWR) do |f| + text = f.read + f.rewind + f.write text.sub('angular-scenario.js', "angular-scenario-#{version}.js") + end + %x(tar -czf #{path_to(tarball)} -C #{path_to('pkg')} .) puts "Package created: #{path_to(tarball)}" @@ -256,5 +276,5 @@ end # returns path to the file in the build directory # def path_to(filename) - return File.join(BUILD_DIR, filename) + return File.join(BUILD_DIR, *filename) end -- cgit v1.2.3