olddoc 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Documentation/.gitignore +1 -0
- data/Documentation/GNUmakefile +53 -24
- data/Documentation/olddoc.1.pod +21 -0
- data/Documentation/{olddoc.5.txt → olddoc.5.pod} +8 -11
- data/Documentation/podtxt2html +54 -0
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +1 -1
- data/README +15 -12
- data/Rakefile +1 -1
- data/lib/dark216.rb +40 -0
- data/lib/olddoc.rb +2 -1
- data/lib/oldweb.rb +1 -0
- data/lib/oldweb/_head.rhtml +5 -1
- metadata +7 -5
- data/Documentation/olddoc.1.txt +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14790478480a3a9995861df417903d8e6cadc88441668e4c1ab1b4091a365cf0
|
4
|
+
data.tar.gz: d68495eb66d05dab730829d01ecb299270f38856512f0a3bcb2b606c33b0179f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d0027f5d3ae1a5d15f846896ecdfa1aec567ac666937b7c5055a279d7482b126ebcc561c4868a55a67ca1afba89471a8a518bb5449fb81d7b10273a69955e5c
|
7
|
+
data.tar.gz: 3cf5ef6d6bf09617f0d9ab64bca5caf76c8f8c0a878d67f569a4164b315d86cf75270447dc3089a1d0bf5b19314858667ef67e916dbb0d83fce9ae15bb8932b0
|
data/Documentation/.gitignore
CHANGED
data/Documentation/GNUmakefile
CHANGED
@@ -1,26 +1,32 @@
|
|
1
|
-
# Copyright (C) 2015-
|
1
|
+
# Copyright (C) 2015-2019 all contributors <olddoc-public@80x24.org>
|
2
2
|
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
|
3
3
|
all::
|
4
4
|
|
5
5
|
INSTALL = install
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
POD2MAN = pod2man
|
7
|
+
-include ../GIT-VERSION-FILE
|
8
|
+
release := olddoc $(VERSION)
|
9
|
+
POD2MAN_OPTS = -v -r '$(release)' --stderr -d 1994-10-02 -c 'olddoc user manual'
|
10
|
+
pod2man = $(POD2MAN) $(POD2MAN_OPTS)
|
11
|
+
POD2TEXT = pod2text
|
12
|
+
POD2TEXT_OPTS = --stderr
|
13
|
+
pod2text = $(POD2TEXT) $(POD2TEXT_OPTS)
|
10
14
|
|
15
|
+
m1 =
|
16
|
+
m1 += olddoc.1
|
11
17
|
|
12
|
-
|
13
|
-
|
14
|
-
man7 :=
|
18
|
+
m5 =
|
19
|
+
m5 += olddoc.5
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
m7 =
|
22
|
+
|
23
|
+
man1 := $(m1)
|
24
|
+
man5 := $(m5)
|
25
|
+
man7 := $(m7)
|
19
26
|
|
20
27
|
all:: man
|
21
28
|
|
22
29
|
man: $(man1) $(man5) $(man7)
|
23
|
-
html: $(html1) $(html5) $(html7)
|
24
30
|
|
25
31
|
prefix ?= $(HOME)
|
26
32
|
mandir ?= $(prefix)/share/man
|
@@ -30,24 +36,47 @@ man7dir = $(mandir)/man7
|
|
30
36
|
|
31
37
|
gem-man: man
|
32
38
|
$(INSTALL) -d -m 755 ../man
|
33
|
-
|
34
|
-
|
39
|
+
$(INSTALL) -m 644 $(man1) ../man
|
40
|
+
$(INSTALL) -m 644 $(man5) ../man
|
35
41
|
test -z "$(man7)" || $(INSTALL) -m 644 $(man7) ../man
|
36
42
|
|
37
43
|
install-man: man
|
38
|
-
$(INSTALL) -d -m 755 $(DESTDIR)$(
|
39
|
-
|
40
|
-
test -z "$(man5)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
44
|
+
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
|
45
|
+
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
41
46
|
test -z "$(man7)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
|
42
|
-
|
43
|
-
|
47
|
+
$(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
|
48
|
+
$(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
|
44
49
|
test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
|
45
50
|
|
46
|
-
|
47
|
-
$(
|
51
|
+
%.1 : %.1.pod
|
52
|
+
$(pod2man) -s 1 $< $@+
|
53
|
+
mv $@+ $@
|
54
|
+
|
55
|
+
%.5 : %.5.pod
|
56
|
+
$(pod2man) -s 5 $< $@+
|
57
|
+
mv $@+ $@
|
58
|
+
|
59
|
+
%.7 : %.7.pod
|
60
|
+
$(pod2man) -s 7 $< $@+
|
61
|
+
mv $@+ $@
|
62
|
+
|
63
|
+
mantxt = $(addsuffix .txt, $(m1) $(m5) $(m7))
|
64
|
+
|
65
|
+
txt :: $(mantxt)
|
66
|
+
|
67
|
+
all :: txt
|
68
|
+
|
69
|
+
%.txt : %.pod
|
70
|
+
$(pod2text) $< $@+
|
71
|
+
touch -r $< $@+
|
72
|
+
mv $@+ $@
|
48
73
|
|
49
|
-
|
50
|
-
$(
|
74
|
+
html : podtxt2html $(mantxt)
|
75
|
+
./podtxt2html $(mantxt)
|
51
76
|
|
52
77
|
clean::
|
53
|
-
$(RM) $(man1) $(man5) $(man7)
|
78
|
+
$(RM) $(man1) $(man5) $(man7)
|
79
|
+
$(RM) $(addsuffix .txt.gz, $(m1) $(m5) $(m7))
|
80
|
+
$(RM) $(addsuffix .txt, $(m1) $(m5) $(m7))
|
81
|
+
$(RM) $(addsuffix .html, $(subst .,_,$(m1) $(m5) $(m7)))
|
82
|
+
$(RM) $(addsuffix .html.gz, $(subst .,_,$(m1) $(m5) $(m7)))
|
@@ -0,0 +1,21 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
olddoc - old-fashioned RDoc HTML generator
|
4
|
+
|
5
|
+
=head1 SYNOPSYS
|
6
|
+
|
7
|
+
olddoc prepare
|
8
|
+
|
9
|
+
rdoc -f oldweb
|
10
|
+
|
11
|
+
rdoc -f dark216
|
12
|
+
|
13
|
+
=head1 DESCRIPTION
|
14
|
+
|
15
|
+
olddoc features dark216, and old-fashioned RDoc HTML generator.
|
16
|
+
You can also use "olddoc prepare" to generate NEWS files from
|
17
|
+
git tags.
|
18
|
+
|
19
|
+
=head1 SEE ALSO
|
20
|
+
|
21
|
+
L<olddoc(5)>
|
@@ -1,19 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# NAME
|
1
|
+
=head1 NAME
|
4
2
|
|
5
3
|
.olddoc.yml - olddoc config file format
|
6
4
|
|
7
|
-
|
5
|
+
=head1 SYNOPSIS
|
8
6
|
|
9
7
|
A YAML file in the top-level project directory named ".olddoc.yml"
|
10
8
|
|
11
|
-
|
9
|
+
=head1 DESCRIPTION
|
12
10
|
|
13
11
|
As olddoc favors consistency over configuration, there is minimal
|
14
12
|
configuration to deal with.
|
15
13
|
|
16
|
-
|
14
|
+
=head1 KEYS
|
17
15
|
|
18
16
|
`rdoc_url`, `cgit_url`, and `nntp_url` should be obvious
|
19
17
|
|
@@ -21,9 +19,8 @@ configuration to deal with.
|
|
21
19
|
HTML file that will be merged into RDoc after-the-fact. It is useful
|
22
20
|
for merging non-RDoc generated HTML into the project.
|
23
21
|
|
24
|
-
`ml_url` is the
|
25
|
-
`public_email` is the email address of a
|
26
|
-
at `ml_url`
|
22
|
+
`ml_url` is the mail archive location.
|
23
|
+
`public_email` is the email address of a mail archived at `ml_url`
|
27
24
|
|
28
25
|
As of olddoc 1.2.0, `ml_url` and `nntp_url` may be YAML arrays
|
29
26
|
with multiple URLs.
|
@@ -33,6 +30,6 @@ commands or URLs. This allows users of arbitrary version
|
|
33
30
|
control systems to specify instructions for getting the code
|
34
31
|
and not assume users are familiar with any particular system.
|
35
32
|
|
36
|
-
|
33
|
+
=head1 SEE ALSO
|
37
34
|
|
38
|
-
olddoc(1)
|
35
|
+
L<olddoc(1)>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
# Copyright (C) 2019 all contributors <olddoc-public@80x24.org>
|
3
|
+
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
|
4
|
+
|
5
|
+
# pod2html isn't to my liking, and we need to generate anchors
|
6
|
+
# compatible with what pandoc was generating to avoid breaking
|
7
|
+
# links. Takes pod2text-generated text and transforms it to
|
8
|
+
# an HTML fragment
|
9
|
+
|
10
|
+
txts = ARGV
|
11
|
+
links = {}
|
12
|
+
txts.each do |f|
|
13
|
+
if f =~ /(\A[\w\-]+)\.(\d)\.txt\z/
|
14
|
+
base = $1
|
15
|
+
section = $2
|
16
|
+
links["#{base}(#{section})"] = "#{base}_#{section}.html"
|
17
|
+
else
|
18
|
+
abort "#{f} is not of <BASE>.<SECTION>.txt\n"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
linkre = links.keys.map { |x| Regexp.escape(x) }.join('|')
|
23
|
+
|
24
|
+
sections = '[A-Z][A-Z ]+'
|
25
|
+
txts.each do |f|
|
26
|
+
str = File.read(f)
|
27
|
+
str = str.split(/^(#{sections})$/mo)
|
28
|
+
str = str.map! do |s|
|
29
|
+
case s
|
30
|
+
when /\A(#{sections})$/o
|
31
|
+
# this is to be compatible with HTML fragments pandoc used
|
32
|
+
sec = $1
|
33
|
+
anchor = sec.downcase.tr(' ', '-')
|
34
|
+
%Q(<h1\nid=#{anchor}>#{sec}</h1>)
|
35
|
+
else
|
36
|
+
s.encode!(xml: :text)
|
37
|
+
s.gsub!(/\b(#{linkre})/mo) do |m|
|
38
|
+
manref = $1
|
39
|
+
if url = links[manref]
|
40
|
+
%Q(<a\nhref="#{url}">#{manref}</a>)
|
41
|
+
else
|
42
|
+
manref
|
43
|
+
end
|
44
|
+
end
|
45
|
+
s.rstrip!
|
46
|
+
s.empty? ? '' : "<pre>#{s}</pre>"
|
47
|
+
end # case s
|
48
|
+
end.join
|
49
|
+
|
50
|
+
html = f.sub(/.txt\z/, '.html')
|
51
|
+
tmp = html + '+'
|
52
|
+
File.open(tmp, 'w') { |f| f.write(str) }
|
53
|
+
File.rename(tmp, html)
|
54
|
+
end
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
data/README
CHANGED
@@ -3,15 +3,17 @@
|
|
3
3
|
olddoc contains old-fashioned document generators for those who do not
|
4
4
|
wish to impose bloated, new-fangled web cruft on their readers.
|
5
5
|
|
6
|
-
olddoc contains
|
7
|
-
|
8
|
-
and/or low-bandwidth connections
|
9
|
-
|
6
|
+
olddoc contains dark216, a HTML generator without any images, frames,
|
7
|
+
or JavaScript. It is designed for users of text-based browsers
|
8
|
+
and/or low-bandwidth connections; yet respects user preference for
|
9
|
+
light color schemes in new CSS browsers while favoring darkness for
|
10
|
+
power savings on OLED and CRT displays. dark216 focuses on text as
|
11
|
+
it is the lowest common denominator for accessibility and compatibility
|
10
12
|
with people and hardware.
|
11
13
|
|
12
14
|
== Reasons
|
13
15
|
|
14
|
-
* No CSS. Encouraging users to use CSS leads to problems like
|
16
|
+
* No CSS required. Encouraging users to use CSS leads to problems like
|
15
17
|
copy-paste hijacking: https://thejh.net/misc/website-terminal-copy-paste
|
16
18
|
External CSS also increases page load time as it often blocks page
|
17
19
|
rendering. Asynchronous loading of CSS also causes accessibility
|
@@ -38,7 +40,7 @@ missing out!
|
|
38
40
|
|
39
41
|
gem install olddoc
|
40
42
|
cd $ANY_RDOC_USING_RUBY_PROJECT
|
41
|
-
rdoc -f
|
43
|
+
rdoc -f dark216
|
42
44
|
|
43
45
|
You can also use olddoc to generate NEWS entries
|
44
46
|
assuming you have git tags, a README file and .olddoc.yml
|
@@ -62,14 +64,15 @@ with git(7)) and send them via email to <olddoc-public@80x24.org>
|
|
62
64
|
== Contact
|
63
65
|
|
64
66
|
All feedback (comments, results, feature requests, bug reports, patches,
|
65
|
-
pull-requests) via plain-text
|
66
|
-
appreciated.
|
67
|
+
pull-requests) via plain-text email is very much appreciated.
|
67
68
|
|
68
|
-
Please send plain-text
|
69
|
+
Please send plain-text email to us at <olddoc-public@80x24.org>
|
70
|
+
Use reply-to-all as we do not require any sort of subscription.
|
69
71
|
HTML will not be read. olddoc is for GUI-phobes, by GUI-phobes.
|
70
|
-
|
71
|
-
|
72
|
-
|
72
|
+
We archive all of our mail publically at:
|
73
|
+
|
74
|
+
https://80x24.org/olddoc-public/
|
75
|
+
nntp://news.public-inbox.org/inbox.comp.lang.ruby.olddoc
|
73
76
|
|
74
77
|
== License
|
75
78
|
|
data/Rakefile
CHANGED
data/lib/dark216.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (C) 2019 all contributors <olddoc-public@80x24.org>
|
2
|
+
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
|
3
|
+
|
4
|
+
# Loosely derived from Darkfish in the main rdoc distribution
|
5
|
+
require_relative 'oldweb'
|
6
|
+
|
7
|
+
# dark216 is an \RDoc template and not intended as a programming API.
|
8
|
+
# It respect prefers-color-scheme:light on newer browsers with CSS
|
9
|
+
# support, but favors darkness for power-savings.
|
10
|
+
# You may specify it as an \RDoc formatter:
|
11
|
+
#
|
12
|
+
# rdoc -f dark216 ...
|
13
|
+
class Dark216 < Oldweb
|
14
|
+
RDoc::RDoc.add_generator(self) # :nodoc:
|
15
|
+
include ERB::Util # :nodoc:
|
16
|
+
|
17
|
+
# description of the generator
|
18
|
+
DESCRIPTION = 'minimal dark HTML generator'
|
19
|
+
|
20
|
+
# default to a dark, web-safe (216 color) palette for power-savings.
|
21
|
+
# Color-capable browsers can respect the prefers-color-scheme:light
|
22
|
+
# @media query (browser support a work-in-progress)
|
23
|
+
STYLE = <<''.gsub(/^\s*/m, '').delete!("\n") # :nodoc:
|
24
|
+
@media screen {
|
25
|
+
*{background:#000;color:#ccc}
|
26
|
+
a{color:#69f}
|
27
|
+
a:visited{color:#96f}
|
28
|
+
}
|
29
|
+
@media screen AND (prefers-color-scheme:light) {
|
30
|
+
*{background:#fff;color:#333}
|
31
|
+
a{color:#00f}
|
32
|
+
a:visited{color:#808}
|
33
|
+
}
|
34
|
+
|
35
|
+
def initialize(*args) # :nodoc:
|
36
|
+
super
|
37
|
+
@oldweb_style = STYLE
|
38
|
+
end
|
39
|
+
end
|
40
|
+
# :startdoc:
|
data/lib/olddoc.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2015-
|
1
|
+
# Copyright (C) 2015-2019 all contributors <olddoc-public@80x24.org>
|
2
2
|
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
|
3
3
|
module Olddoc # :nodoc:
|
4
4
|
autoload :Gemspec, 'olddoc/gemspec'
|
@@ -16,3 +16,4 @@ module Olddoc # :nodoc:
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
require_relative 'oldweb'
|
19
|
+
require_relative 'dark216'
|
data/lib/oldweb.rb
CHANGED
data/lib/oldweb/_head.rhtml
CHANGED
@@ -8,4 +8,8 @@ type="application/atom+xml" /><%
|
|
8
8
|
end
|
9
9
|
%><meta
|
10
10
|
http-equiv="Content-Type"
|
11
|
-
content="text/html; charset=<%= @options.charset %>"
|
11
|
+
content="text/html; charset=<%= @options.charset %>"><%
|
12
|
+
if @oldweb_style
|
13
|
+
%><style><%= @oldweb_style %></style><%
|
14
|
+
end
|
15
|
+
%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: olddoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- olddoc hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -45,8 +45,9 @@ files:
|
|
45
45
|
- COPYING
|
46
46
|
- Documentation/.gitignore
|
47
47
|
- Documentation/GNUmakefile
|
48
|
-
- Documentation/olddoc.1.
|
49
|
-
- Documentation/olddoc.5.
|
48
|
+
- Documentation/olddoc.1.pod
|
49
|
+
- Documentation/olddoc.5.pod
|
50
|
+
- Documentation/podtxt2html
|
50
51
|
- GIT-VERSION-GEN
|
51
52
|
- GNUmakefile
|
52
53
|
- INSTALL
|
@@ -55,6 +56,7 @@ files:
|
|
55
56
|
- Rakefile
|
56
57
|
- TODO
|
57
58
|
- bin/olddoc
|
59
|
+
- lib/dark216.rb
|
58
60
|
- lib/olddoc.rb
|
59
61
|
- lib/olddoc/gemspec.rb
|
60
62
|
- lib/olddoc/history.rb
|
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
106
|
- !ruby/object:Gem::Version
|
105
107
|
version: '0'
|
106
108
|
requirements: []
|
107
|
-
rubygems_version: 3.0.
|
109
|
+
rubygems_version: 3.0.2
|
108
110
|
signing_key:
|
109
111
|
specification_version: 4
|
110
112
|
summary: old-fashioned Ruby documentation generator
|
data/Documentation/olddoc.1.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
% olddoc(1) olddoc user manual
|
2
|
-
|
3
|
-
# NAME
|
4
|
-
|
5
|
-
olddoc - old-fashioned RDoc HTML generator
|
6
|
-
|
7
|
-
# SYNOPSIS
|
8
|
-
|
9
|
-
`olddoc` prepare
|
10
|
-
|
11
|
-
`rdoc` -f oldweb
|
12
|
-
|
13
|
-
# DESCRIPTION
|
14
|
-
|
15
|
-
olddoc features oldweb, and old-fashioned RDoc HTML generator.
|
16
|
-
You can also use "olddoc prepare" to generate NEWS files from
|
17
|
-
git tags.
|
18
|
-
|
19
|
-
# SEE ALSO
|
20
|
-
|
21
|
-
olddoc(5)
|