olddoc 1.0.0

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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.document +4 -0
  3. data/.gitignore +16 -0
  4. data/.olddoc.yml +9 -0
  5. data/COPYING +674 -0
  6. data/Documentation/.gitignore +4 -0
  7. data/Documentation/GNUmakefile +53 -0
  8. data/Documentation/olddoc.1.txt +21 -0
  9. data/Documentation/olddoc.5.txt +26 -0
  10. data/GNUmakefile +59 -0
  11. data/INSTALL +9 -0
  12. data/README +89 -0
  13. data/Rakefile +31 -0
  14. data/TODO +1 -0
  15. data/bin/olddoc +16 -0
  16. data/lib/olddoc.rb +20 -0
  17. data/lib/olddoc/gemspec.rb +17 -0
  18. data/lib/olddoc/history.rb +57 -0
  19. data/lib/olddoc/merge.rb +26 -0
  20. data/lib/olddoc/news_atom.rb +51 -0
  21. data/lib/olddoc/news_rdoc.rb +36 -0
  22. data/lib/olddoc/prepare.rb +24 -0
  23. data/lib/olddoc/readme.rb +27 -0
  24. data/lib/oldweb.rb +303 -0
  25. data/lib/oldweb/_head.rhtml +7 -0
  26. data/lib/oldweb/_sidebar_classes.rhtml +27 -0
  27. data/lib/oldweb/_sidebar_extends.rhtml +13 -0
  28. data/lib/oldweb/_sidebar_includes.rhtml +12 -0
  29. data/lib/oldweb/_sidebar_installed.rhtml +10 -0
  30. data/lib/oldweb/_sidebar_methods.rhtml +6 -0
  31. data/lib/oldweb/_sidebar_navigation.rhtml +6 -0
  32. data/lib/oldweb/_sidebar_pages.rhtml +17 -0
  33. data/lib/oldweb/_sidebar_parent.rhtml +13 -0
  34. data/lib/oldweb/_sidebar_sections.rhtml +8 -0
  35. data/lib/oldweb/_sidebar_table_of_contents.rhtml +15 -0
  36. data/lib/oldweb/_tail.rhtml +25 -0
  37. data/lib/oldweb/class.rhtml +79 -0
  38. data/lib/oldweb/page.rhtml +5 -0
  39. data/lib/oldweb/servlet_not_found.rhtml +5 -0
  40. data/lib/oldweb/servlet_root.rhtml +39 -0
  41. data/lib/oldweb/table_of_contents.rhtml +52 -0
  42. data/lib/rdoc/discover.rb +5 -0
  43. data/olddoc.gemspec +21 -0
  44. metadata +119 -0
@@ -0,0 +1,27 @@
1
+ <%
2
+ @modsort.delete_if do |c|
3
+ c.full_name == "unknown" || @old_cfg["noindex"].include?(c.full_name)
4
+ end
5
+ unless @modsort.empty?
6
+ # To save space and reduce visual noise, we want to display:
7
+ # Top Sub1 Sub2 Sub3
8
+ # Instead of
9
+ # Top Top::Sub1 Top::Sub2 Top::Sub3
10
+ top_mod = nil
11
+ @modsort.each do |mod| %><%
12
+ parts = mod.full_name.split('::')
13
+ if parts[0] != top_mod && parts.size == 1
14
+ top_mod = parts[0]
15
+ %><%= '<br />' if mod != @modsort[0] %><%
16
+ elsif parts[0] != top_mod
17
+ top_mod = nil
18
+ %><%= '<br />' if mod != @modsort[0] %><%= parts[0] %> <%
19
+ else
20
+ parts.shift
21
+ end
22
+ %><a
23
+ href="<%= rel_prefix %><%= mod.path %>"><%= parts.join('::') %></a>
24
+ <%
25
+ end
26
+ end
27
+ %><br />
@@ -0,0 +1,13 @@
1
+ <%
2
+ unless klass.extends.empty?
3
+ %><p><b>Extended with:</b> <%
4
+ klass.each_extend do |ext|
5
+ unless String === ext.module
6
+ %><a
7
+ href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a><%
8
+ else
9
+ %><%= ext.name %><%
10
+ end
11
+ end
12
+ end
13
+ %>
@@ -0,0 +1,12 @@
1
+ <%
2
+ unless klass.includes.empty?
3
+ %><p><b>Included modules:</b> <%
4
+ klass.each_include do |inc|
5
+ unless String === inc.module %><a
6
+ href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a><%
7
+ else %><%=
8
+ inc.name %><%
9
+ end
10
+ end
11
+ end
12
+ %>
@@ -0,0 +1,10 @@
1
+ <h3>Documentation</h3><ul><%
2
+ installed.each do |name, href, exists, type, _|
3
+ next if type == :extra %><li><%
4
+ if exists
5
+ %><a
6
+ href="<%= href %>"><%= h name %></a><%
7
+ else
8
+ %><%= h name %><%
9
+ end
10
+ end %></ul>
@@ -0,0 +1,6 @@
1
+ <% unless klass.method_list.empty? %>
2
+ <h3 id="method-list-section">Methods</h3><%
3
+ klass.each_method do |meth| %>
4
+ <a href="#<%= meth.aref %>"><%=
5
+ meth.singleton ? '::' : '#' %><%= h meth.name %></a><%
6
+ end %><% end %>
@@ -0,0 +1,6 @@
1
+ <br /><a
2
+ href="<%= rel_prefix %>table_of_contents.html#pages">Pages</a>
3
+ <a
4
+ href="<%= rel_prefix %>table_of_contents.html#classes">Classes</a>
5
+ <a
6
+ href="<%= rel_prefix %>table_of_contents.html#methods">Methods</a>
@@ -0,0 +1,17 @@
1
+ <%
2
+ simple_files = @files.select(&:text?)
3
+ unless simple_files.empty?
4
+ current_name = nil
5
+ if defined?(current) && current.respond_to?(:page_name)
6
+ current_name = current.page_name
7
+ end
8
+ simple_files.each do |f|
9
+ next if @old_cfg["noindex"].include?(f.page_name)
10
+ b = (current_name == f.page_name)
11
+ %><a
12
+ href="<%= rel_prefix %><%= f.path %>"><%=
13
+ b ? '<b>' : '' %><%= h f.page_name %><%= b ? '</b>' : ''%></a>
14
+ <%
15
+ end
16
+ end
17
+ %><br />
@@ -0,0 +1,13 @@
1
+ <%
2
+ # having Object as parent is boring
3
+ if klass.type == 'class' && klass.superclass != 'Object'
4
+ %><p><b>Parent:</b> <%
5
+ if klass.superclass and not String === klass.superclass
6
+ %><a
7
+ href="<%= klass.aref_to klass.superclass.path %>"><%=
8
+ klass.superclass.full_name %></a><%
9
+ else
10
+ %><%= klass.superclass %><%
11
+ end
12
+ end
13
+ %>
@@ -0,0 +1,8 @@
1
+ <%
2
+ unless klass.sections.length == 1
3
+ %><p><b>Sections:</b> <%
4
+ klass.sort_sections.each do |section| %><a
5
+ href="#<%= section.aref %>"><%= h section.title %></a><%
6
+ end
7
+ end
8
+ %>
@@ -0,0 +1,15 @@
1
+ <%
2
+ comment = current.respond_to?(:comment_location) ? current.comment_location :
3
+ current.comment
4
+ table = current.parse(comment).table_of_contents
5
+ if table.length > 1
6
+ %><%
7
+ table.each_with_index do |heading, i|
8
+ next if heading.level > @old_cfg['toc_max']
9
+ %><a
10
+ href="#<%= heading.label(current) %>"><%=
11
+ i == 0 ? "top" : heading.plain_html %></a>
12
+ <%
13
+ end %><br /><%
14
+ end
15
+ %>
@@ -0,0 +1,25 @@
1
+ <%
2
+ public_email = @old_cfg['public_email']
3
+ private_email = @old_cfg['private_email']
4
+ ml_url = @old_cfg['ml_url']
5
+ git_doc = 'https://kernel.org/pub/software/scm/git/docs/'
6
+ se_url = "#{git_doc}git-send-email.html"
7
+ rp_url = "#{git_doc}git-request-pull.html"
8
+
9
+ if public_email && private_email && ml_url %><hr /><p>
10
+ We love to hear from you!<br />
11
+ Email patches (using <a
12
+ href="<%= se_url %>">git send-email</a>),
13
+ pull requests (formatted using <a
14
+ href="<%= rp_url %>">git request-pull</a>), questions, bug reports,
15
+ suggestions, etc. to us publically at:<br /><a
16
+ href="mailto:<%= public_email %>"><%= public_email %></a><br />
17
+ Mail archives are available at: <a
18
+ href="<%= ml_url %>"><%= ml_url %></a><br />
19
+ Please send plain-text email only and do not waste bandwidth on HTML mail,
20
+ HTML mail will not be read.<br />
21
+ Quote as little as reasonable and do not <a
22
+ href="http://catb.org/jargon/html/T/top-post.html">top post</a>.<br />
23
+ For sensitive topics, email us privately at:
24
+ <a
25
+ href="mailto:<%= private_email %>"><%= private_email %></a><% end %>
@@ -0,0 +1,79 @@
1
+ <%=
2
+ render('_sidebar_pages.rhtml') <<
3
+ render('_sidebar_classes.rhtml') <<
4
+ render('_sidebar_methods.rhtml')
5
+ %><h1
6
+ id="<%= h klass.aref %>"><%= klass.type %> <%= klass.full_name %></h1><%=
7
+ klass.description.strip
8
+ %><%
9
+ nd = '(Not documented)'
10
+ klass.each_section do |section, constants, attributes|
11
+ constants = constants.select(&:display?)
12
+ attributes = attributes.select(&:display?)
13
+ if section.title
14
+ %><h2
15
+ id="<%= section.aref %>"><%= section.title %></h2><%
16
+ end
17
+ if section.comment %><p><%= section.description.strip %></p><%
18
+ end
19
+ unless constants.empty? %><h3>Constants</h3><%
20
+ constants.each { |const|
21
+ %><h4
22
+ id="<%= const.name %>"><%= const.name %></h4><%=
23
+ const.comment ? const.description.strip : nd %><%
24
+ } %><%
25
+ end
26
+ unless attributes.empty? %><h3>Attributes</h3><%
27
+ attributes.each do |attrib|
28
+ %><h4
29
+ id="<%= attrib.aref %>"><%=
30
+ h(attrib.name) %> [<%= attrib.rw %>]</h4><%=
31
+ attrib.comment ? attrib.description.strip : nd %><%
32
+ end
33
+ end
34
+ klass.methods_by_type(section).each do |type, visibilities|
35
+ next if visibilities.empty?
36
+ visibilities.each do |visibility, methods|
37
+ next if methods.empty? %><h3
38
+ id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details">
39
+ <%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3><%
40
+ methods.each do |method|
41
+ %><pre id="<%= method.aref %>"><b><%
42
+ if method.call_seq %><%= h method.call_seq %><%
43
+ else
44
+ %><%= h method.name %> <%= h method.param_seq %><%
45
+ end %></b><%= method_srclink(method) %></pre><%=
46
+ method.comment ? method.description.strip : nd %><%
47
+ if method.calls_super %>Calls superclass method<%=
48
+ method.superclass_method ?
49
+ method.formatter.link(method.superclass_method.full_name,
50
+ method.superclass_method.full_name) : nil
51
+ %><%
52
+ end
53
+ unless method.aliases.empty?
54
+ %> Also aliased as: <%=
55
+ method.aliases.map do |aka|
56
+ if aka.parent # HACK lib/rexml/encodings
57
+ %{<a href="#{klass.aref_to(aka.path)}">#{h aka.name}</a>}
58
+ else
59
+ h aka.name
60
+ end
61
+ end.join ", " %><%
62
+ end
63
+ if method.is_alias_for
64
+ %><br />Alias for:
65
+ <a
66
+ href="<%= klass.aref_to method.is_alias_for.path %>"><%=
67
+ h method.is_alias_for.name %></a><%
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ %><%=
74
+ render('_sidebar_sections.rhtml').strip <<
75
+ render('_sidebar_parent.rhtml').strip <<
76
+ render('_sidebar_includes.rhtml').strip <<
77
+ render('_sidebar_extends.rhtml').strip <<
78
+ render('_sidebar_navigation.rhtml').strip
79
+ %>
@@ -0,0 +1,5 @@
1
+ <%=
2
+ render('_sidebar_pages.rhtml') <<
3
+ render('_sidebar_classes.rhtml') <<
4
+ file.description.strip
5
+ %>
@@ -0,0 +1,5 @@
1
+ <%=
2
+ render('_sidebar_navigation.rhtml') <<
3
+ render('_sidebar_pages.rhtml') <<
4
+ render('_sidebar_classes.rhtml')
5
+ %><h1>Not Found</h1><%= message %>
@@ -0,0 +1,39 @@
1
+ <h2><a href="<%= rel_prefix %>">Home</a></h2><%=
2
+ render '_sidebar_installed.rhtml'
3
+ %><h1>Local RDoc Documentation</h1>
4
+ <p>Here you can browse local documentation from the ruby standard library and
5
+ your installed gems.
6
+ <% extra_dirs = installed.select { |_, _, _, type,| type == :extra } %>
7
+ <% unless extra_dirs.empty? %>
8
+ <h2>Extra Documentation Directories</h2>
9
+ <p>The following additional documentation directories are available:</p>
10
+ <ol>
11
+ <% extra_dirs.each do |name, href, exists, _, path| %>
12
+ <li>
13
+ <% if exists %>
14
+ <a href="<%= href %>"><%= h name %></a> (<%= h path %>)
15
+ <% else %>
16
+ <%= h name %> (<%= h path %>; not available)
17
+ <% end %>
18
+ <% end %>
19
+ </ol>
20
+ <% end %>
21
+ <%
22
+ gems = installed.select { |_, _, _, type,| type == :gem }
23
+ missing = gems.reject { |_, _, exists,| exists }
24
+ unless missing.empty? %>
25
+ <h2>Missing Gem Documentation</h2>
26
+ <p>You are missing documentation for some of your installed gems.
27
+ You can install missing documentation for gems by running
28
+ <kbd>gem rdoc --all</kbd>. After installing the missing documentation you
29
+ only need to reload this page. The newly created documentation will
30
+ automatically appear.
31
+ <p>You can also install documentation for a specific gem by running one of
32
+ the following commands.
33
+ <ul>
34
+ <% names = missing.map { |name,| name.sub(/-([^-]*)$/, '') }.uniq %>
35
+ <% names.each do |name| %>
36
+ <li><kbd>gem rdoc <%=h name %></kbd>
37
+ <% end %>
38
+ </ul>
39
+ <% end %>
@@ -0,0 +1,52 @@
1
+ <h1><%= h @title %></h1><%
2
+ simple_files = @files.select(&:text?)
3
+ unless simple_files.empty?
4
+ %><h2 id="pages">Pages</h2>
5
+ <ul><%
6
+ simple_files.sort.each do |file| %><li><a
7
+ href="<%= file.path %>"><%= h file.page_name %></a>
8
+ <%
9
+ # HACK table_of_contents should not exist on Document
10
+ table = file.parse(file.comment).table_of_contents
11
+ unless table.empty?
12
+ %><ul><%
13
+ table.each do |heading|
14
+ %><li><a
15
+ href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
16
+ <% end
17
+ %></ul><%
18
+ end
19
+ %><%
20
+ end
21
+ %></ul><%
22
+ end
23
+ %><h2
24
+ id="classes">Classes and Modules</h2><ul><%
25
+ @modsort.each do |klass| %><li
26
+ class="<%= klass.type %>"><a
27
+ href="<%= klass.path %>"><%= klass.full_name %></a>
28
+ <%
29
+ table = []
30
+ table.concat klass.parse(klass.comment_location).table_of_contents
31
+ table.concat klass.section_contents
32
+
33
+ unless table.empty?
34
+ %><ul><%
35
+ table.each do |item|
36
+ %><li><a
37
+ href="<%= klass.path %>#<%= item.aref %>"><%= item.plain_html %></a>
38
+ <%
39
+ end %></ul><%
40
+ end
41
+ %><%
42
+ end
43
+ %></ul><h2
44
+ id="methods">Methods</h2><ul><%
45
+ @store.all_classes_and_modules.map do |mod|
46
+ mod.method_list
47
+ end.flatten.sort.each do |method|
48
+ %><li><a
49
+ href="<%= method.path %>"><%= h method.pretty_name %></a>
50
+ - <%= method.parent.full_name %><%
51
+ end
52
+ %></ul>
@@ -0,0 +1,5 @@
1
+ begin
2
+ gem 'rdoc', '~> 4.1'
3
+ require_relative '../olddoc'
4
+ rescue Gem::LoadError
5
+ end unless defined?(Olddoc)
data/olddoc.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # Copyright (C) 2015, all contributors <olddoc-public@80x24.org>
2
+ # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
3
+ $LOAD_PATH << 'lib'
4
+ require 'olddoc'
5
+ extend Olddoc::Gemspec
6
+ name, summary, title = readme_metadata
7
+ Gem::Specification.new do |s|
8
+ manifest = File.read('.gem-manifest').split(/\n/)
9
+ s.name = 'olddoc'
10
+ s.version = Olddoc::VERSION
11
+ s.executables = %w(olddoc)
12
+ s.authors = ["#{s.name} hackers"]
13
+ s.summary = summary
14
+ s.description = readme_description
15
+ s.email = Olddoc.config['private_email']
16
+ s.files = manifest
17
+ s.add_dependency('rdoc', '~> 4.2')
18
+ s.add_dependency('builder', '~> 3.2')
19
+ s.homepage = Olddoc.config['rdoc_url']
20
+ s.licenses = 'GPLv3+'
21
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: olddoc
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - olddoc hackers
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rdoc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: builder
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.2'
41
+ description: |-
42
+ olddoc contains old-fashioned document generators for those who do not
43
+ wish to impose bloated, new-fangled web cruft on their readers.
44
+ email: olddoc@80x24.org
45
+ executables:
46
+ - olddoc
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".document"
51
+ - ".gitignore"
52
+ - ".olddoc.yml"
53
+ - COPYING
54
+ - Documentation/.gitignore
55
+ - Documentation/GNUmakefile
56
+ - Documentation/olddoc.1.txt
57
+ - Documentation/olddoc.5.txt
58
+ - GNUmakefile
59
+ - INSTALL
60
+ - NEWS
61
+ - README
62
+ - Rakefile
63
+ - TODO
64
+ - bin/olddoc
65
+ - lib/olddoc.rb
66
+ - lib/olddoc/gemspec.rb
67
+ - lib/olddoc/history.rb
68
+ - lib/olddoc/merge.rb
69
+ - lib/olddoc/news_atom.rb
70
+ - lib/olddoc/news_rdoc.rb
71
+ - lib/olddoc/prepare.rb
72
+ - lib/olddoc/readme.rb
73
+ - lib/oldweb.rb
74
+ - lib/oldweb/_head.rhtml
75
+ - lib/oldweb/_sidebar_classes.rhtml
76
+ - lib/oldweb/_sidebar_extends.rhtml
77
+ - lib/oldweb/_sidebar_includes.rhtml
78
+ - lib/oldweb/_sidebar_installed.rhtml
79
+ - lib/oldweb/_sidebar_methods.rhtml
80
+ - lib/oldweb/_sidebar_navigation.rhtml
81
+ - lib/oldweb/_sidebar_pages.rhtml
82
+ - lib/oldweb/_sidebar_parent.rhtml
83
+ - lib/oldweb/_sidebar_sections.rhtml
84
+ - lib/oldweb/_sidebar_table_of_contents.rhtml
85
+ - lib/oldweb/_tail.rhtml
86
+ - lib/oldweb/class.rhtml
87
+ - lib/oldweb/page.rhtml
88
+ - lib/oldweb/servlet_not_found.rhtml
89
+ - lib/oldweb/servlet_root.rhtml
90
+ - lib/oldweb/table_of_contents.rhtml
91
+ - lib/rdoc/discover.rb
92
+ - man/olddoc.1
93
+ - man/olddoc.5
94
+ - olddoc.gemspec
95
+ homepage: http://80x24.org/olddoc/
96
+ licenses:
97
+ - GPLv3+
98
+ metadata: {}
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubyforge_project:
115
+ rubygems_version: 2.4.5
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: old-fashioned Ruby documentation generator
119
+ test_files: []