[ANN] olddoc 1.4.0 - old-fashioned RDoc generator

olddoc contains old-fashioned document generators for those who do not
wish to impose bloated, new-fangled web cruft on their readers.

olddoc contains oldweb, an HTML generator without any images, frames,
CSS, or JavaScript. It is designed for users of text-based browsers
and/or low-bandwidth connections. oldweb focuses on text as it is
the lowest common denominator for accessibility and compatibility
with people and hardware.

== Reasons

* No CSS. Encouraging users to use CSS leads to problems like
  copy-paste hijacking: https://thejh.net/misc/website-terminal-copy-paste
  External CSS also increases page load time as it often blocks page
  rendering. Asynchronous loading of CSS also causes accessibility
  problems as links/buttons may move as a user attempts to click.

* No JavaScript. There is a constant barrage of security and
  client-side performance problems associated with it. It's also
  unreasonable to expect users to rely on LibreJS and inspect every
  piece of JS they run.

* No frames. Frames are an accessibility hassle and unfriendly
  to users of tiny screens on mobile devices and text-based browsers.

* No images. Not everyone can view or afford bandwidth to load images.
  This also reduces the potential for security vulnerabilities as less
  code gets run. Furthermore, loading the wrong image in a public
  place can get you arrested (or worse).

Encourage readers to simplify and speed up their browsing experience.
They can disable CSS, JavaScript, and images in their browser without
missing out!

== Usage

  gem install olddoc
  cd $ANY_RDOC_USING_RUBY_PROJECT
  rdoc -f oldweb

== Changes

    olddoc 1.4.0

    This release fixes one formatting bug. It also removes the
    'builder' dependency to avoid warnings with (<= 3.2.2) and
    make this project easier-to-install.

    3 changes since v1.3.0 (Dec 2016):

          oldweb/class: add space before superclass method name
          news_rdoc: fix unused variable warning
          remove 'builder' dependency

* https://80x24.org/olddoc/ - homepage + sample
* https://80x24.org/olddoc-public/ - mailing list archives
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.olddoc
* olddoc-public@80x24.org - public mailing list (no subscription * necessary)
* git clone git://80x24.org/olddoc
* license: GPL-3.0+

Hi Eric,

I've installed the gem and generated the documentation. Two things happened:
1. `$ rdoc -f olddoc` documentation is being displayed with the darkfish
template layout with different style format.
2. `$ rdoc` generates exactly the same documentation.

If I remove `olddoc` `$ rdoc` gets back the previous style.

Is this suppose to happen?

Thanks,

Daniel

Hi Eric,

I've installed the gem and generated the documentation. Two things happened:
1. `$ rdoc -f olddoc` documentation is being displayed with the darkfish

That should be: rdoc -f oldweb

olddoc may include other similarly-themed styles in the future
and may not be limited to only rdoc/ruby...

···

Daniel Ferreira <subtileos@gmail.com> wrote:

template layout with different style format.
2. `$ rdoc` generates exactly the same documentation.

If I remove `olddoc` `$ rdoc` gets back the previous style.

Is this suppose to happen?

Thanks,

Daniel

You need to use

$ rdoc -f oldweb

Regards,
Marcus

···

Am 23.01.2017 um 12:22 schrieb Daniel Ferreira:

I've installed the gem and generated the documentation. Two things happened:
1. `$ rdoc -f olddoc` documentation is being displayed with the darkfish
template layout with different style format.

--
GitHub: stomar (Marcus Stollsteimer) · GitHub
PGP: 0x6B3A101A

Hi Eric,

I've tried now with `$ rdoc -f oldweb` and I can confirm is now very
different from darkfish but the removal of the style from darkfish still
exists as a side effect when trying to use the standard generator.
No code highlight and different letter type.

Thanks,

Daniel

P.S.

I would not use oldweb and rather use olddoc.
If you plan other templates why not add it as a suffix?

Hi Eric,

I've tried now with `$ rdoc -f oldweb` and I can confirm is now very
different from darkfish but the removal of the style from darkfish still
exists as a side effect when trying to use the standard generator.
No code highlight and different letter type.

I'm not sure what you mean, can you point out the HTML source
differences? Keep in mind I only use terminal browsers like
lynx and w3m for browsing; so I only see one font and never let
other people decide on what colors show up on my screen.

Perhaps some files did not get regenerated properly?

Thanks,

Daniel

P.S.

I would not use oldweb and rather use olddoc.
If you plan other templates why not add it as a suffix?

It's just a name; "web" means the documentation is tied to the
web; "doc" is more generic (could cover manpages, etc).
It's a more descriptive name than "darkfish", anyhow...

I'm not sure what you mean by suffix, though.
And there's no plan to add other templates, just a "maybe".

···

Daniel Ferreira <subtileos@gmail.com> wrote:

Hi Eric,

I'm removing the documentation at each generation.

Replication steps:

1. `$ rdoc`
2. `gem install olddoc`
3. `$ rm -rf doc`
4. `$ rdoc` # => Style has changed

I'm not sure what you mean by suffix, though.

Suffix would be:

`$ rdoc -f olddoc-light`
`$ rdoc -f olddoc-dark`
`$ rdoc -f olddoc-modern`

Using `oldweb` demands extra overhead which in this case is avoidable IMO.

Thanks,

Daniel

Suffix would be:

`$ rdoc -f olddoc-light`
`$ rdoc -f olddoc-dark`
`$ rdoc -f olddoc-modern`

I think you miss the point of olddoc entirely.

Using `oldweb` demands extra overhead which in this case is avoidable IMO.

If by overhead you mean actually reading the usage on the readme...

···

On Jan 23, 2017, at 07:57, Daniel Ferreira <subtileos@gmail.com> wrote:

Hi Eric,

I'm removing the documentation at each generation.

Replication steps:

1. `$ rdoc`
2. `gem install olddoc`
3. `$ rm -rf doc`
4. `$ rdoc` # => Style has changed

Thanks. I was able to reproduce the problem and come up with
a patch below which seems to fix the problem:

----------------8<---------------

RDoc will load oldweb.rb regardless of whether it is used or
not, so do not apply our monkey patching to reduce HTML
generated by RDoc::Markup::ToHtml until we initialize Oldweb.

Thanks to Daniel Ferreira for noticing this in [ruby-talk:437390]:
  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/437390
  <CAPL_2g25ir4ZBJo652ao1EYB59ZvFHhpGef1V14QOV2SeVXLeA@mail.gmail.com>

This still assumes any Ruby VM instance (currently synonymous
with an OS process in Ruby 2.4) will only use one RDoc template
in its lifetime and not switch between them. More work will be
required to support switching between `oldweb' and other
templates within the same VM instance, but that's not a priority
for me.

···

Daniel Ferreira <subtileos@gmail.com> wrote:
Subject: [PATCH] oldweb: apply LessHtml monkey patch late, at runtime
---
lib/oldweb.rb | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/oldweb.rb b/lib/oldweb.rb
index a5da1cc..95b7171 100644
--- a/lib/oldweb.rb
+++ b/lib/oldweb.rb
@@ -31,6 +31,8 @@ class Oldweb
     RDoc::Text::TO_HTML_CHARACTERS[Encoding::UTF_8] =
       RDoc::Text::TO_HTML_CHARACTERS[Encoding::ASCII]

+ less_html!
+
     @store = store
     @options = options
     @base_dir = Pathname.pwd.expand_path
@@ -298,12 +300,13 @@ class Oldweb
       @res << "</h#{level}>"
     end
   end
-end

-# :stopdoc:
-class RDoc::Markup::ToHtml # :nodoc:
- remove_method :accept_heading
- remove_method :accept_verbatim
- include Oldweb::LessHtml
+ def less_html! # :nodoc:
+ klass = RDoc::Markup::ToHtml
+ return if klass.include?(Oldweb::LessHtml)
+ klass.__send__(:remove_method, :accept_heading)
+ klass.__send__(:remove_method, :accept_verbatim)
+ klass.__send__(:include, Oldweb::LessHtml)
+ end
end
# :startdoc:
---

> I'm not sure what you mean by suffix, though.

Suffix would be:

`$ rdoc -f olddoc-light`
`$ rdoc -f olddoc-dark`

Yeah, you're missing the point as Ryan alluded to in [ruby-talk:437398] <8A8AAC2B-1615-4B26-939D-B118495F1BCF@zenspider.com>

I do not believe people should choose colors or fonts for other
people, only themselves. I consider user interface elements
such as colors and fonts a personal preference for each and
every individual. oldweb tries to get out-of-the-way as much as
possible.

So yeah, "light" and "dark" don't make sense for a webmaster or
designer to decide, and some mainstream browsers even have
plugins to support per-site color schemes via CSS.

`$ rdoc -f olddoc-modern`

LOL

Using `oldweb` demands extra overhead which in this case is avoidable IMO.

*shrug* Naming things is one of the most difficult subjects
in computer science :slight_smile:

Hi Eric,

Glad I could help with the bug report.

Yeah, you're missing the point as Ryan alluded to

It was just a bad choice of words/examples to show you what I meant by
suffix. :slight_smile:

Thanks,

Daniel

Hi Eric. Are you planning to make a release with this patch?

Thanks,
Daniel

Yes, probably in a few days. There might've been a few related
things I wanted to try, too.

And please disable HTML parts in your mail client: it wastes
everyone's bandwidth and space, and also encourages people to
use more complex (and buggier) software to render.

···

Daniel Ferreira <subtileos@gmail.com> wrote:

Hi Eric. Are you planning to make a release with this patch?