trak3r-iphone-rdoc-template 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Capfile ADDED
@@ -0,0 +1 @@
1
+ load 'config/deploy'
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2008 Thomas 'Ted' Davis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ Capfile
2
+ config/deploy.rb
3
+ lib/iphone_rdoc_template.rb
4
+ lib/templates/adsense.html
5
+ lib/templates/analytics.html
6
+ lib/templates/body.html
7
+ lib/templates/class.html
8
+ lib/templates/file.html
9
+ lib/templates/files.html
10
+ lib/templates/footer.html
11
+ lib/templates/header.html
12
+ lib/templates/index.html
13
+ lib/templates/methods.html
14
+ lib/templates/search.html
15
+ lib/templates/source.html
16
+ lib/templates/styles.css
17
+ LICENSE
18
+ Manifest
19
+ Rakefile
20
+ README.rdoc
@@ -0,0 +1,21 @@
1
+ = iPhone RDoc Template
2
+
3
+ == What is it?
4
+
5
+ It's an RDoc template tailored to look better in the iPhone web browser (no frames, a lot less styling, etc.).
6
+
7
+ == How do I use it?
8
+
9
+ Download it then write yourself a Rake task like the one in this project (changing the appropriate paths, of course).
10
+
11
+ == Caveats
12
+
13
+ For the sake of simplicity, I removed the source code links and embedding.
14
+
15
+ == Thanks
16
+
17
+ I referred to the following projects when I got lost and confused:
18
+
19
+ http://github.com/rails/rails/tree/master/doc/template/horo.rb
20
+
21
+ http://github.com/mislav/hanna/tree/master
@@ -0,0 +1,21 @@
1
+ require 'echoe'
2
+ require 'rake/rdoctask'
3
+
4
+ task :default => :rerdoc
5
+
6
+ Echoe.new('iphone_rdoc_template') do |gem|
7
+ gem.version = '0.0.1'
8
+ gem.summary = 'An RDoc template to look good in the iPhone web browser'
9
+ gem.description = gem.summary
10
+ gem.author = "Thomas 'Ted' Davis"
11
+ gem.email = 'ted@pocketrails.com'
12
+ gem.url = 'https://github.com/trak3r/iphone-rdoc-template'
13
+ end
14
+
15
+ RAILS_PATH = '~/Desktop/rails'
16
+ TEMPLATE_PATH = '~/Desktop/pocketrails/lib/iphone_rdoc_template'
17
+
18
+ desc "Generate the RDoc for Rails"
19
+ task :rerdoc do
20
+ system "cd #{RAILS_PATH} && rake rerdoc template=#{TEMPLATE_PATH}"
21
+ end
@@ -0,0 +1,41 @@
1
+ role :site, 'pocketrails.com'
2
+ role :local, 'localhost'
3
+
4
+ desktop_path = "/Users/ted/Desktop"
5
+ rails_path = "#{desktop_path}/rails"
6
+ rdoc_path = "#{rails_path}/doc/rdoc"
7
+ remote_path = "~/pocketrails.com"
8
+ zipped_file = "pocketrails.tgz"
9
+
10
+ desc "Compress the files locally."
11
+ task :gzip, :roles => :local do
12
+ run "cd #{rdoc_path} && tar cvzf #{zipped_file} *"
13
+ end
14
+
15
+ desc "Copy the zip file to the server."
16
+ task :scp, :roles => :site do
17
+ upload "#{rdoc_path}/#{zipped_file}", "#{remote_path}", :via => :scp
18
+ end
19
+
20
+ desc "Decompress the file remotely."
21
+ task :gunzip, :roles => :site do
22
+ run "cd #{remote_path} && tar xvzf #{zipped_file}"
23
+ end
24
+
25
+ task :deploy do
26
+ gzip
27
+ scp
28
+ gunzip
29
+ end
30
+
31
+ [ 'gzip' ].each do |task|
32
+ before "#{task}" do
33
+ set :user, 'ted'
34
+ end
35
+ end
36
+
37
+ [ 'scp', 'gunzip' ].each do |task|
38
+ before "#{task}" do
39
+ set :user, 'teflonted'
40
+ end
41
+ end
@@ -0,0 +1,55 @@
1
+ # Ted's iPhone RDoc template
2
+ require 'erb'
3
+
4
+ module RDoc
5
+ module Page
6
+
7
+ class << self
8
+
9
+ def read( template )
10
+ @dir ||= File.join(File.dirname(__FILE__), 'templates')
11
+ prefix = "#{@dir}/#{template}"
12
+ [ 'html', 'css', 'xml' ].each do |ext|
13
+ filename = "#{prefix}.#{ext}"
14
+ if File.exists?(filename)
15
+ return ERB.new(File.new(filename).read).result(binding)
16
+ end
17
+ end
18
+ return nil
19
+ end
20
+
21
+ end
22
+
23
+ FONTS = ""
24
+ XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
25
+ <!DOCTYPE html
26
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
27
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
28
+ }
29
+ GOOGLE_ANALYTICS = read('analytics')
30
+ STYLE = read('styles')
31
+ GOOGLE_ADSENSE = read('adsense')
32
+ HEADER = read('header')
33
+ FILE_PAGE = read('file')
34
+ CLASS_PAGE = read('class')
35
+ METHOD_LIST = read('methods')
36
+ FOOTER = read('footer')
37
+ BODY = read('body')
38
+ SRC_PAGE = read('source')
39
+ FR_INDEX_BODY = <<HTML
40
+ !INCLUDE!
41
+ HTML
42
+ COMMON_HEADER = <<HTML
43
+ <html>
44
+ <head>
45
+ <meta content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"/>
46
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
47
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" media="screen" />
48
+ HTML
49
+ GOOGLE_SEARCH_FORM = read('search')
50
+ FILE_INDEX = read('files')
51
+ CLASS_INDEX = FILE_INDEX
52
+ METHOD_INDEX = FILE_INDEX
53
+ INDEX = read('index')
54
+ end
55
+ end
@@ -0,0 +1,12 @@
1
+ <script type="text/javascript"><!--
2
+ google_ad_client = "pub-3648329338598531";
3
+ /* Pocket Rails */
4
+ google_ad_slot = "9128679516";
5
+ google_ad_width = 234;
6
+ google_ad_height = 60;
7
+ //-->
8
+ </script>
9
+ <script type="text/javascript"
10
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
11
+ </script>
12
+ <hr />
@@ -0,0 +1,9 @@
1
+ <script type="text/javascript">
2
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
3
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
4
+ </script>
5
+ <script type="text/javascript">
6
+ try {
7
+ var pageTracker = _gat._getTracker("UA-1377203-4");
8
+ pageTracker._trackPageview();
9
+ } catch(err) {}</script>
@@ -0,0 +1,6 @@
1
+ <%= HEADER %>
2
+ !INCLUDE! <!-- banner header -->
3
+ <div id="bodyContent">
4
+ <%= METHOD_LIST %>
5
+ </div>
6
+ <%= FOOTER %>
@@ -0,0 +1,32 @@
1
+ %classmod%
2
+ <h1>
3
+ %full_name%
4
+ </h1>
5
+ <dl>
6
+ <dt>
7
+ Files
8
+ </dt>
9
+ <dd>
10
+ <ul>
11
+ START:infiles
12
+ <li>
13
+ HREF:full_path_url:full_path:
14
+ </li>
15
+ END:infiles
16
+ </ul>
17
+ </dd>
18
+ IF:parent
19
+ <dt>
20
+ Parent
21
+ </dt>
22
+ <dd>
23
+ IF:par_url
24
+ <a href="%par_url%">
25
+ ENDIF:par_url
26
+ %parent%
27
+ IF:par_url
28
+ </a>
29
+ ENDIF:par_url
30
+ ENDIF:parent
31
+ </dd>
32
+ </dl>
@@ -0,0 +1,17 @@
1
+ <h1>
2
+ %short_name%
3
+ </h1>
4
+ <dl>
5
+ <dt>
6
+ Path
7
+ </dt>
8
+ <dd>
9
+ %full_path%
10
+ </dd>
11
+ <dt>
12
+ Modified
13
+ </dt>
14
+ <dd>
15
+ %dtm_modified%
16
+ </dd>
17
+ </dl>
@@ -0,0 +1,18 @@
1
+ <%= XHTML_PREAMBLE %>
2
+ <%= COMMON_HEADER %>
3
+ <title>
4
+ %list_title%
5
+ </title>
6
+ </head>
7
+ <body>
8
+ <h1>
9
+ %list_title%
10
+ </h1>
11
+ <ul>
12
+ START:entries
13
+ <li>
14
+ <a href="%href%">%name%</a>
15
+ </li>
16
+ END:entries
17
+ </ul>
18
+ <%= FOOTER %>
@@ -0,0 +1,3 @@
1
+ <%= GOOGLE_ANALYTICS %>
2
+ </body>
3
+ </html>
@@ -0,0 +1,51 @@
1
+ <%= XHTML_PREAMBLE %>
2
+ <html>
3
+ <head>
4
+ <meta content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"/>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
6
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
7
+ <title>
8
+ %title%
9
+ </title>
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <%= GOOGLE_ADSENSE %>
@@ -0,0 +1,25 @@
1
+ <%= XHTML_PREAMBLE %>
2
+ <%= COMMON_HEADER %>
3
+ <title>
4
+ %title% (formatted for the iPhone)
5
+ </title>
6
+ </head>
7
+ <body>
8
+ <h1>
9
+ %title%
10
+ </h1>
11
+ (formatted for the iPhone)
12
+ <ul>
13
+ <li>
14
+ <a href="fr_file_index.html">Files</a>
15
+ </li>
16
+ <li>
17
+ <a href="fr_class_index.html">Classes</a>
18
+ </li>
19
+ <li>
20
+ <a href="fr_method_index.html">Methods</a>
21
+ </li>
22
+ </ul>
23
+ <%= GOOGLE_SEARCH_FORM %>
24
+ <br/>(doesn't work yet, sorry.)
25
+ <%= FOOTER %>
@@ -0,0 +1,182 @@
1
+ <dl>
2
+ IF:diagram
3
+ <dt>
4
+ Diagram
5
+ </dt>
6
+ <dd>
7
+ %diagram%
8
+ </dd>
9
+ ENDIF:diagram
10
+
11
+ IF:description
12
+ <dt>
13
+ Description
14
+ </dt>
15
+ <dd>
16
+ %description%
17
+ </dd>
18
+ ENDIF:description
19
+
20
+ IF:requires
21
+ <dt>
22
+ Required Files
23
+ </dt>
24
+ <dd>
25
+ <ul>
26
+ START:requires
27
+ <li>HREF:aref:name:</li>
28
+ END:requires
29
+ </ul>
30
+ </dd>
31
+ ENDIF:requires
32
+
33
+ IF:toc
34
+ <dt>
35
+ Contents
36
+ </dt>
37
+ <dd>
38
+ <ul>
39
+ START:toc
40
+ <li>
41
+ <a href="#%href%">%secname%</a>
42
+ </li>
43
+ END:toc
44
+ </ul>
45
+ </dd>
46
+ ENDIF:toc
47
+
48
+ IF:methods
49
+ <dt>
50
+ Methods
51
+ </dt>
52
+ <dd>
53
+ <ul>
54
+ START:methods
55
+ <li>HREF:aref:name:</li>
56
+ END:methods
57
+ </ul>
58
+ </dd>
59
+ ENDIF:methods
60
+
61
+ IF:includes
62
+ <dt>
63
+ Included Modules
64
+ </dt>
65
+ <dd>
66
+ <ul>
67
+ START:includes
68
+ <li>HREF:aref:name:</li>
69
+ END:includes
70
+ </ul>
71
+ </dd>
72
+ ENDIF:includes
73
+
74
+ START:sections
75
+ IF:sectitle
76
+ <dt>
77
+ <a name="%secsequence%">%sectitle%</a>
78
+ </dt>
79
+ IF:seccomment
80
+ <dd>
81
+ %seccomment%
82
+ </dd>
83
+ ENDIF:seccomment
84
+ ENDIF:sectitle
85
+
86
+ IF:classlist
87
+ <dt>
88
+ Classes and Modules
89
+ </dt>
90
+ <dd>
91
+ %classlist%
92
+ </dd>
93
+ ENDIF:classlist
94
+
95
+ IF:constants
96
+ <dt>
97
+ Constants
98
+ </dt>
99
+ <dd>
100
+ <dl>
101
+ START:constants
102
+ <dt>
103
+ %name%
104
+ </dt>
105
+ <dd>
106
+ %value%
107
+ IF:desc
108
+ <p>
109
+ %desc%
110
+ </p>
111
+ ENDIF:desc
112
+ </dd>
113
+ END:constants
114
+ </dl>
115
+ </dd>
116
+ ENDIF:constants
117
+
118
+ IF:attributes
119
+ <dt>
120
+ Attributes
121
+ </dt>
122
+ <dd>
123
+ START:attributes
124
+ <dl>
125
+ IF:rw
126
+ [%rw%]
127
+ ENDIF:rw
128
+ <dt>
129
+ %name%
130
+ </dt>
131
+ <dd>
132
+ %a_desc%
133
+ </dd>
134
+ END:attributes
135
+ </dl>
136
+ </dd>
137
+ ENDIF:attributes
138
+
139
+ IF:method_list
140
+ START:method_list
141
+ IF:methods
142
+ <h2>
143
+ %type%
144
+ %category%
145
+ methods
146
+ </h2>
147
+ START:methods
148
+
149
+ <h3>
150
+ IF:callseq
151
+ <a name="%aref%">%callseq%</a>
152
+ ENDIF:callseq
153
+ IFNOT:callseq
154
+ <a name="%aref%">%name%</a>
155
+ %params%
156
+ ENDIF:callseq
157
+ </h3>
158
+
159
+ IF:m_desc
160
+ <p>
161
+ %m_desc%
162
+ </p>
163
+ ENDIF:m_desc
164
+
165
+ IF:aka
166
+ <dt>
167
+ Alias
168
+ </dt>
169
+ <dd>
170
+ START:aka
171
+ <a href="%aref%">%name%</a>
172
+ END:aka
173
+ </dd>
174
+ ENDIF:aka
175
+
176
+ END:methods
177
+ ENDIF:methods
178
+ END:method_list
179
+ ENDIF:method_list
180
+
181
+ END:sections
182
+ </dl>
@@ -0,0 +1,5 @@
1
+ <form method="get" action="http://www.google.com/search">
2
+ <input type="text" name="q" size="31" maxlength="255" value="" />
3
+ <input type="submit" value="Google Search" />
4
+ <input type="hidden" name="sitesearch" value="pocketrails.com" />
5
+ </form>
@@ -0,0 +1,29 @@
1
+ <%= XHTML_PREAMBLE %>
2
+ <html>
3
+ <head>
4
+ <title>
5
+ %title%
6
+ </title>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
8
+ <style type="text/css">
9
+ .ruby-comment { color: green; font-style: italic }
10
+ .ruby-constant { color: #4433aa; font-weight: bold; }
11
+ .ruby-identifier { color: #222222; }
12
+ .ruby-ivar { color: #2233dd; }
13
+ .ruby-keyword { color: #3333FF; font-weight: bold }
14
+ .ruby-node { color: #777777; }
15
+ .ruby-operator { color: #111111; }
16
+ .ruby-regexp { color: #662222; }
17
+ .ruby-value { color: #662222; font-style: italic }
18
+ .kw { color: #3333FF; font-weight: bold }
19
+ .cmt { color: green; font-style: italic }
20
+ .str { color: #662222; font-style: italic }
21
+ .re { color: #662222; }
22
+ </style>
23
+ </head>
24
+ <body>
25
+ <pre>
26
+ %code%
27
+ </pre>
28
+ </body>
29
+ </html>
@@ -0,0 +1,15 @@
1
+ body {
2
+ font-family: Helvetica;
3
+ width: 480px;
4
+ font-size: x-small;
5
+ }
6
+ ul {
7
+ list-style: none;
8
+ }
9
+ dt {
10
+ font-weight: bold;
11
+ }
12
+ pre {
13
+ overflow-x: auto;
14
+ white-space: pre-wrap;
15
+ }
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trak3r-iphone-rdoc-template
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Thomas (Ted) Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-01 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: An RDoc template formatted for the iPhone web browser
17
+ email: ted@pocketrails.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - Capfile
26
+ - config/deploy.rb
27
+ - lib/iphone_rdoc_template.rb
28
+ - lib/templates/adsense.html
29
+ - lib/templates/analytics.html
30
+ - lib/templates/body.html
31
+ - lib/templates/class.html
32
+ - lib/templates/file.html
33
+ - lib/templates/files.html
34
+ - lib/templates/footer.html
35
+ - lib/templates/header.html
36
+ - lib/templates/index.html
37
+ - lib/templates/methods.html
38
+ - lib/templates/search.html
39
+ - lib/templates/source.html
40
+ - lib/templates/styles.css
41
+ - LICENSE
42
+ - Manifest
43
+ - Rakefile
44
+ - README.rdoc
45
+ has_rdoc: false
46
+ homepage: http://github.com/trak3r/iphone-rdoc-template
47
+ post_install_message:
48
+ rdoc_options: []
49
+
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.2.0
68
+ signing_key:
69
+ specification_version: 2
70
+ summary: An RDoc template formatted for the iPhone web browser
71
+ test_files: []
72
+