Permalink
Browse files

Cleaned up, fixed up, hacked up for own purposes. Work in progress.

  • Loading branch information...
kanevski committed Jan 17, 2012
1 parent 34dbc42 commit 91fef068422fff98abb6b617833f9e0044fa209e
View
@@ -4,12 +4,14 @@
require "yard-rest-plugin/base_helper"
-YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/../templates'
+YARD::Templates::Engine.register_template_path(File.dirname(__FILE__) + '/../templates')
+YARD::Server.register_static_path(File.dirname(__FILE__) + '/../templates/rest/fulldoc/html')
+
# TODO: Check ruby version and support ruby 1.9 in future
YARD::Parser::SourceParser.parser_type = :ruby18
# Define custom tags
-YARD::Tags::Library.define_tag("URL for Service", :url)
+YARD::Tags::Library.define_tag("URL for Service", :url, :with_types)
YARD::Tags::Library.define_tag("Topic for Service", :topic)
YARD::Tags::Library.define_tag("Arguments", :argument, :with_types_and_name)
YARD::Tags::Library.define_tag("Example Request", :example_request)
@@ -19,5 +21,4 @@
YARD::Tags::Library.define_tag("Headers", :header, :with_name)
YARD::Tags::Library.define_tag("Response codes", :response_code, :with_name)
YARD::Tags::Library.define_tag("Image", :image)
-YARD::Tags::Library.define_tag("Overall", :overall)
-
+YARD::Tags::Library.define_tag("Overall", :overall)
@@ -1,18 +1,5 @@
-require 'pp'
-
module YARD::Templates::Helpers
module BaseHelper
-
- # Adds additional test that only includes Objects that contain a URL tag
- def run_verifier(list)
-
- if options[:verifier]
- list.reject! { |item| options[:verifier].call(item).is_a?(FalseClass) }
- end
-
- index_objects(list)
- end
-
def index_objects(list)
res = reject_module(list)
res = reject_without_url(res)
@@ -27,7 +14,9 @@ def reject_module(list)
end
def reject_without_url(list)
- list.reject { |object| [:class, :method].include?(object.type) and object.tags("url").empty? }
+ list.reject do |object|
+ [:class, :method].include?(object.type) and object.tags("url").empty?
+ end
end
def reject_without_topic(list)
@@ -1,3 +1,5 @@
+<h1 class="noborder title"><a href="<%= url_for('') %>"><%= options[:title] %></a></h1>
+
<div class="service">
<h1>
<% if object.tags("url").size == 1 %>
@@ -24,16 +26,4 @@
<img src="<%= image.text %>">
<% end %>
<%= yieldall %>
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
+</div>
@@ -3,7 +3,7 @@ def init
end
def method_details_list
- @meths = object.meths(:inherited => false, :included => false)
- @meths = run_verifier(@meths)
+ @meths = object.meths(:inherited => false, :included => false)
+ @meths = index_objects(@meths)
erb(:method_details_list)
end
@@ -1,24 +0,0 @@
-<h2>Discuss this Resource</h2>
-<div id="disqus_thread"></div>
-<script type="text/javascript">
- var disqus_shortname = 'vworkapi';
- var disqus_identifier = "<%= @disqus_identifier %>";
- // var disqus_developer = 1;
- /**
- * var disqus_identifier; [Optional but recommended: Define a unique identifier (e.g. post id or slug) for this thread]
- */
- (function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = 'http://vworkapi.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
-</script>
-<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=vworkapi">comments powered by Disqus.</a></noscript>
-<a href="http://disqus.com" class="dsq-brlink">API comments powered by <span class="logo-disqus">Disqus</span></a>
-<script type="text/javascript">
-(function () {
- var s = document.createElement('script'); s.async = true;
- s.src = 'http://disqus.com/forums/vworkapi/count.js';
- (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
-}());
-</script>
@@ -1,9 +0,0 @@
-def init
- sections :disqus
-end
-
-def disqus()
- @disqus_identifier = object.tag('url').text #.gsub(/\//, '_')
-
- erb('disqus')
-end
Oops, something went wrong.

0 comments on commit 91fef06

Please sign in to comment.