Permalink
Browse files

Add a markdown help template that works well with github markdown

  • Loading branch information...
1 parent 5a00f83 commit 6bbe902631f12dc737f91e3146e7e354bd58b4b1 @ripienaar ripienaar committed Nov 25, 2010
Showing with 50 additions and 0 deletions.
  1. +1 −0 ext/help-templates/README
  2. +49 −0 ext/help-templates/rpc-help-markdown.erb
View
1 ext/help-templates/README
@@ -0,0 +1 @@
+A number of templates for the SimpleRPC DDL based help system
View
49 ext/help-templates/rpc-help-markdown.erb
@@ -0,0 +1,49 @@
+<%= meta[:name].upcase %> AGENT
+<% (meta[:name].size + 7).times do %>=<% end %>
+
+<%= meta[:description] %>
+
+ Author: <%= meta[:author] %>
+ Version: <%= meta[:version] %>
+ License: <%= meta[:license] %>
+ Timeout: <%= meta[:timeout] %>
+ Home Page: <%= meta[:url] %>
+
+
+
+ACTIONS:
+========
+% actions.keys.sort.each do |action|
+ * <%= action %>
+% end
+
+% actions.keys.sort.each do |action|
+_<%= action %>_ action:
+<% (action.size + 8).times do %>-<% end %>
+<%= actions[action][:description] %>
+
+% if actions[action][:input].keys.size > 0
+ INPUT:
+% end
+% actions[action][:input].keys.sort.each do |input|
+ <%= input %>:
+ Description: <%= actions[action][:input][input][:description] %>
+ Prompt: <%= actions[action][:input][input][:prompt] %>
+ Type: <%= actions[action][:input][input][:type] %>
+% if actions[action][:input][input][:type] == :string
+ Validation: <%= actions[action][:input][input][:validation] %>
+ Length: <%= actions[action][:input][input][:maxlength] %>
+% elsif actions[action][:input][input][:type] == :list
+ Valid Values: <%= actions[action][:input][input][:list].join(", ") %>
+% end
+
+% end
+
+ OUTPUT:
+% actions[action][:output].keys.sort.each do |output|
+ <%= output %>:
+ Description: <%= actions[action][:output][output][:description] %>
+ Display As: <%= actions[action][:output][output][:display_as] %>
+
+% end
+% end

0 comments on commit 6bbe902

Please sign in to comment.