sdoc 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/lib/{sdoc → rdoc}/generator/template/merge/index.rhtml +0 -0
  2. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/_context.rhtml +0 -0
  3. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/_head.rhtml +0 -0
  4. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/class.rhtml +0 -0
  5. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/file.rhtml +0 -0
  6. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/index.rhtml +0 -0
  7. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/apple-touch-icon.png +0 -0
  8. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/css/github.css +0 -0
  9. data/lib/rdoc/generator/template/rails/resources/css/main.css +287 -0
  10. data/lib/rdoc/generator/template/rails/resources/css/panel.css +383 -0
  11. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/css/reset.css +0 -0
  12. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/favicon.ico +0 -0
  13. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/i/arrows.png +0 -0
  14. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/i/results_bg.png +0 -0
  15. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/i/tree_bg.png +0 -0
  16. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/js/highlight.pack.js +0 -0
  17. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/js/jquery-1.3.2.min.js +0 -0
  18. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/js/jquery-effect.js +0 -0
  19. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/js/main.js +0 -0
  20. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/js/searchdoc.js +0 -0
  21. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/resources/panel/index.html +0 -0
  22. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/rails}/se_index.rhtml +0 -0
  23. data/lib/rdoc/generator/template/sdoc/_context.rhtml +171 -0
  24. data/lib/rdoc/generator/template/sdoc/_head.rhtml +7 -0
  25. data/lib/rdoc/generator/template/sdoc/class.rhtml +39 -0
  26. data/lib/rdoc/generator/template/sdoc/file.rhtml +29 -0
  27. data/lib/rdoc/generator/template/sdoc/index.rhtml +13 -0
  28. data/lib/rdoc/generator/template/sdoc/resources/apple-touch-icon.png +0 -0
  29. data/lib/rdoc/generator/template/sdoc/resources/css/github.css +129 -0
  30. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/sdoc}/resources/css/main.css +0 -0
  31. data/lib/{sdoc/generator/template/direct → rdoc/generator/template/sdoc}/resources/css/panel.css +0 -0
  32. data/lib/rdoc/generator/template/sdoc/resources/css/reset.css +53 -0
  33. data/lib/rdoc/generator/template/sdoc/resources/favicon.ico +0 -0
  34. data/lib/rdoc/generator/template/sdoc/resources/i/arrows.png +0 -0
  35. data/lib/rdoc/generator/template/sdoc/resources/i/results_bg.png +0 -0
  36. data/lib/rdoc/generator/template/sdoc/resources/i/tree_bg.png +0 -0
  37. data/lib/rdoc/generator/template/sdoc/resources/js/highlight.pack.js +1 -0
  38. data/lib/rdoc/generator/template/sdoc/resources/js/jquery-1.3.2.min.js +19 -0
  39. data/lib/rdoc/generator/template/sdoc/resources/js/jquery-effect.js +593 -0
  40. data/lib/rdoc/generator/template/sdoc/resources/js/main.js +24 -0
  41. data/lib/rdoc/generator/template/sdoc/resources/js/searchdoc.js +628 -0
  42. data/lib/rdoc/generator/template/sdoc/resources/panel/index.html +72 -0
  43. data/lib/rdoc/generator/template/sdoc/se_index.rhtml +8 -0
  44. data/lib/sdoc/generator.rb +3 -20
  45. data/lib/sdoc/templatable.rb +2 -1
  46. data/sdoc.gemspec +1 -1
  47. metadata +46 -25
@@ -0,0 +1,72 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
6
+ <head>
7
+ <title>search index</title>
8
+ <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" charset="utf-8" />
9
+ <link rel="stylesheet" href="../css/panel.css" type="text/css" media="screen" charset="utf-8" />
10
+ <script src="search_index.js" type="text/javascript" charset="utf-8"></script>
11
+ <script src="tree.js" type="text/javascript" charset="utf-8"></script>
12
+ <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
14
+ <script type="text/javascript" charset="utf-8">
15
+ function placeholder() {
16
+ if ($('<input type="text">')[0].placeholder !== undefined) return;
17
+
18
+ $('#search-label').click(function() {
19
+ $('#search').focus();
20
+ $('#search-label').hide();
21
+ });
22
+
23
+ $('#search').focus(function() {
24
+ $('#search-label').hide();
25
+ });
26
+ $('#search').blur(function() {
27
+ this.value == '' && $('#search-label').show()
28
+ });
29
+
30
+ $('#search')[0].value == '' && $('#search-label').show();
31
+ }
32
+ $(function() {
33
+ placeholder();
34
+ $('#links').hide();
35
+ var panel = new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
36
+ $('#search').focus();
37
+
38
+ var s = window.parent.location.search.match(/\?q=([^&]+)/);
39
+ if (s) {
40
+ s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
41
+ if (s.length > 0)
42
+ {
43
+ $('#search').val(s);
44
+ panel.search(s, true);
45
+ }
46
+ }
47
+ })
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <div class="panel panel_tree" id="panel">
52
+ <div class="header">
53
+ <div>
54
+ <label for="search" id="search-label" style="display: none">Search</label>
55
+ <table>
56
+ <tr><td>
57
+ <input type="Search" placeholder="Search" autosave="searchdoc" results="10" id="search" autocomplete="off"/>
58
+ </td></tr>
59
+ </table></div>
60
+ </div>
61
+ <div class="tree">
62
+ <ul>
63
+ </ul>
64
+ </div>
65
+ <div class="result">
66
+ <ul>
67
+ </ul>
68
+ </div>
69
+ </div>
70
+ <a href="links.html" id="links">index</a>
71
+ </body>
72
+ </html>
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <head>File index</head>
3
+ <body>
4
+ <% @files.each do |file| %>
5
+ <a href="../<%= file.path %>"><%= file.relative_name %></a>
6
+ <% end %>
7
+ </body>
8
+ </html>
@@ -85,6 +85,7 @@ class RDoc::Generator::SDoc
85
85
  options.se_index = false
86
86
  end
87
87
  opt.separator nil
88
+
88
89
  end
89
90
 
90
91
  def initialize(options)
@@ -93,15 +94,8 @@ class RDoc::Generator::SDoc
93
94
  @options.diagram = false
94
95
  end
95
96
  @github_url_cache = {}
96
- @options.template = 'direct' if @options.template == 'sdoc'
97
- template = @options.template
98
-
99
- templ_dir = self.class.template_dir_for template
100
-
101
- raise RDoc::Error, "could not find template #{template.inspect}" unless
102
- templ_dir
103
-
104
- @template_dir = Pathname.new File.expand_path(templ_dir)
97
+
98
+ @template_dir = Pathname.new(options.template_dir)
105
99
  @basedir = Pathname.pwd.expand_path
106
100
  end
107
101
 
@@ -128,17 +122,6 @@ class RDoc::Generator::SDoc
128
122
  FILE_DIR
129
123
  end
130
124
 
131
- def self.template_dir_for template
132
- $LOAD_PATH.map do |path|
133
- GENERATOR_DIRS.map do |dir|
134
- File.join path, dir, 'template', template
135
- end
136
- end.flatten.find do |dir|
137
- File.directory? dir
138
- end
139
- end
140
-
141
-
142
125
  protected
143
126
  ### Output progress information if debugging is enabled
144
127
  def debug_msg( *msg )
@@ -25,7 +25,8 @@ module SDoc::Templatable
25
25
  ### current context. Adds all +local_assigns+ to context
26
26
  def include_template(template_name, local_assigns = {})
27
27
  source = local_assigns.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
28
- eval("#{source};templatefile = @template_dir + template_name;eval_template(templatefile, binding)")
28
+ templatefile = @template_dir + template_name
29
+ eval("#{source};eval_template(templatefile, binding)")
29
30
  end
30
31
 
31
32
  ### Load and render the erb template in the given +templatefile+ within the
data/sdoc.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "sdoc"
5
- s.version = "0.3.2"
5
+ s.version = "0.3.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Vladimir Kolesnikov"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vladimir Kolesnikov
@@ -67,30 +67,51 @@ files:
67
67
  - bin/sdoc
68
68
  - bin/sdoc-merge
69
69
  - lib/rdoc/discover.rb
70
+ - lib/rdoc/generator/template/merge/index.rhtml
71
+ - lib/rdoc/generator/template/rails/_context.rhtml
72
+ - lib/rdoc/generator/template/rails/_head.rhtml
73
+ - lib/rdoc/generator/template/rails/class.rhtml
74
+ - lib/rdoc/generator/template/rails/file.rhtml
75
+ - lib/rdoc/generator/template/rails/index.rhtml
76
+ - lib/rdoc/generator/template/rails/resources/apple-touch-icon.png
77
+ - lib/rdoc/generator/template/rails/resources/css/github.css
78
+ - lib/rdoc/generator/template/rails/resources/css/main.css
79
+ - lib/rdoc/generator/template/rails/resources/css/panel.css
80
+ - lib/rdoc/generator/template/rails/resources/css/reset.css
81
+ - lib/rdoc/generator/template/rails/resources/favicon.ico
82
+ - lib/rdoc/generator/template/rails/resources/i/arrows.png
83
+ - lib/rdoc/generator/template/rails/resources/i/results_bg.png
84
+ - lib/rdoc/generator/template/rails/resources/i/tree_bg.png
85
+ - lib/rdoc/generator/template/rails/resources/js/highlight.pack.js
86
+ - lib/rdoc/generator/template/rails/resources/js/jquery-1.3.2.min.js
87
+ - lib/rdoc/generator/template/rails/resources/js/jquery-effect.js
88
+ - lib/rdoc/generator/template/rails/resources/js/main.js
89
+ - lib/rdoc/generator/template/rails/resources/js/searchdoc.js
90
+ - lib/rdoc/generator/template/rails/resources/panel/index.html
91
+ - lib/rdoc/generator/template/rails/se_index.rhtml
92
+ - lib/rdoc/generator/template/sdoc/_context.rhtml
93
+ - lib/rdoc/generator/template/sdoc/_head.rhtml
94
+ - lib/rdoc/generator/template/sdoc/class.rhtml
95
+ - lib/rdoc/generator/template/sdoc/file.rhtml
96
+ - lib/rdoc/generator/template/sdoc/index.rhtml
97
+ - lib/rdoc/generator/template/sdoc/resources/apple-touch-icon.png
98
+ - lib/rdoc/generator/template/sdoc/resources/css/github.css
99
+ - lib/rdoc/generator/template/sdoc/resources/css/main.css
100
+ - lib/rdoc/generator/template/sdoc/resources/css/panel.css
101
+ - lib/rdoc/generator/template/sdoc/resources/css/reset.css
102
+ - lib/rdoc/generator/template/sdoc/resources/favicon.ico
103
+ - lib/rdoc/generator/template/sdoc/resources/i/arrows.png
104
+ - lib/rdoc/generator/template/sdoc/resources/i/results_bg.png
105
+ - lib/rdoc/generator/template/sdoc/resources/i/tree_bg.png
106
+ - lib/rdoc/generator/template/sdoc/resources/js/highlight.pack.js
107
+ - lib/rdoc/generator/template/sdoc/resources/js/jquery-1.3.2.min.js
108
+ - lib/rdoc/generator/template/sdoc/resources/js/jquery-effect.js
109
+ - lib/rdoc/generator/template/sdoc/resources/js/main.js
110
+ - lib/rdoc/generator/template/sdoc/resources/js/searchdoc.js
111
+ - lib/rdoc/generator/template/sdoc/resources/panel/index.html
112
+ - lib/rdoc/generator/template/sdoc/se_index.rhtml
70
113
  - lib/sdoc.rb
71
114
  - lib/sdoc/generator.rb
72
- - lib/sdoc/generator/template/direct/_context.rhtml
73
- - lib/sdoc/generator/template/direct/_head.rhtml
74
- - lib/sdoc/generator/template/direct/class.rhtml
75
- - lib/sdoc/generator/template/direct/file.rhtml
76
- - lib/sdoc/generator/template/direct/index.rhtml
77
- - lib/sdoc/generator/template/direct/resources/apple-touch-icon.png
78
- - lib/sdoc/generator/template/direct/resources/css/github.css
79
- - lib/sdoc/generator/template/direct/resources/css/main.css
80
- - lib/sdoc/generator/template/direct/resources/css/panel.css
81
- - lib/sdoc/generator/template/direct/resources/css/reset.css
82
- - lib/sdoc/generator/template/direct/resources/favicon.ico
83
- - lib/sdoc/generator/template/direct/resources/i/arrows.png
84
- - lib/sdoc/generator/template/direct/resources/i/results_bg.png
85
- - lib/sdoc/generator/template/direct/resources/i/tree_bg.png
86
- - lib/sdoc/generator/template/direct/resources/js/highlight.pack.js
87
- - lib/sdoc/generator/template/direct/resources/js/jquery-1.3.2.min.js
88
- - lib/sdoc/generator/template/direct/resources/js/jquery-effect.js
89
- - lib/sdoc/generator/template/direct/resources/js/main.js
90
- - lib/sdoc/generator/template/direct/resources/js/searchdoc.js
91
- - lib/sdoc/generator/template/direct/resources/panel/index.html
92
- - lib/sdoc/generator/template/direct/se_index.rhtml
93
- - lib/sdoc/generator/template/merge/index.rhtml
94
115
  - lib/sdoc/github.rb
95
116
  - lib/sdoc/helpers.rb
96
117
  - lib/sdoc/merge.rb