Mailinglist Archive: yast-commit (1535 mails)

< Previous Next >
[yast-commit] <rest-service> master : add overall documentation generation
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 15 Oct 2009 13:52:10 +0200
  • Message-id: <E1MyOsX-0006Yd-1X@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 798943f48a791a8f907542f207b3dbbf3e88d72d
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Oct 15 13:51:50 2009 +0200

add overall documentation generation
---
Rakefile | 33 +++++++++++++++++++++++++++++++++
index.html.template | 16 ++++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/Rakefile b/Rakefile
index 2bc40ec..e54b24d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -34,4 +34,37 @@ task :default => :test

end

+desc "Run app:doc to generate whole documentation"
+task :doc do
+ #clean old documentation
+ puts "cleaning old doc"
+ system "rm -rf doc"
+
+ Dir.mkdir 'doc'
+ copy 'index.html.template', "doc/index.html"
+ #handle rest service separate from plugins
+ puts "create framework documentation"
+ Dir.chdir('webservice') do
+ system "rake doc:app"
+ end
+ system "cp -r webservice/doc/app doc/webservice"
+ puts "create plugins documentation"
+ plugins_names = []
+ Dir.chdir('plugins') do
+ plugins_names = Dir.glob '*'
+ end
+ plugins_names.each do |plugin|
+ Dir.chdir("plugins/#{plugin}") do
+ system "rake doc:app"
+ end
+ system "cp -r plugins/#{plugin}/doc/app doc/#{plugin}"
+ end
+ puts "generate links for plugins"
+ code = ""
+ plugins_names.each do |plugin|
+ code = "#{code}<a href=\"./#{plugin}/index.html\"><b>#{plugin}</b></a><br>"
+ end
+ system "sed -i 's:%%PLUGINS%%:#{code}:' doc/index.html"
+ puts "documentation successfully generated"
+end

diff --git a/index.html.template b/index.html.template
new file mode 100644
index 0000000..7fa039a
--- /dev/null
+++ b/index.html.template
@@ -0,0 +1,16 @@
+<html>
+<head>
+ <title> Generated webyast rest-service documentation</title>
+</head>
+<body>
+ <h2>Framework documentation</h2>
+ <div>
+ <a href="./webservice/index.html"> Rest-Service framework </a>
+ </div>
+ <h2> Plugins documentation </h2>
+ <div>
+ %%PLUGINS%%
+ </div>
+
+</body>
+</html>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages