olddoc user/dev discussion/patches/bugs/etc
 help / color / mirror / code / Atom feed
* [ANN] olddoc 1.4.0 - old-fashioned RDoc generator
@ 2017-01-22 21:54 Eric Wong
       [not found] ` <CAPL_2g2MtXeagzUN65ZaLxM+v7+QqkhJp-oN5t+RJNOG659Qsg@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2017-01-22 21:54 UTC (permalink / raw)
  To: ruby-talk, olddoc-public

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+

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ANN] olddoc 1.4.0 - old-fashioned RDoc generator
       [not found] ` <CAPL_2g2MtXeagzUN65ZaLxM+v7+QqkhJp-oN5t+RJNOG659Qsg@mail.gmail.com>
@ 2017-01-23 12:50   ` Eric Wong
       [not found]     ` <CAPL_2g2gTQrosUyrLQPARMEqnZ4=q_+OZ2+hdVFkNXGtf9A2Nw@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2017-01-23 12:50 UTC (permalink / raw)
  To: Daniel Ferreira; +Cc: Ruby users, olddoc-public

Daniel Ferreira <subtileos@gmail.com> wrote:
> 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...

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ANN] olddoc 1.4.0 - old-fashioned RDoc generator
       [not found]     ` <CAPL_2g2gTQrosUyrLQPARMEqnZ4=q_+OZ2+hdVFkNXGtf9A2Nw@mail.gmail.com>
@ 2017-01-23 15:01       ` Eric Wong
       [not found]         ` <CAPL_2g25ir4ZBJo652ao1EYB59ZvFHhpGef1V14QOV2SeVXLeA@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2017-01-23 15:01 UTC (permalink / raw)
  To: Daniel Ferreira; +Cc: ruby-talk, olddoc-public

Daniel Ferreira <subtileos@gmail.com> wrote:
> 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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ANN] olddoc 1.4.0 - old-fashioned RDoc generator
       [not found]         ` <CAPL_2g25ir4ZBJo652ao1EYB59ZvFHhpGef1V14QOV2SeVXLeA@mail.gmail.com>
@ 2017-01-24 23:19           ` Eric Wong
       [not found]             ` <CAPL_2g0K8aWFB2g43NjSeaxLfbCRhf_ZrynTVa3YjjraaALMjg@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2017-01-24 23:19 UTC (permalink / raw)
  To: Daniel Ferreira; +Cc: olddoc-public, ruby-talk

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<---------------
Subject: [PATCH] oldweb: apply LessHtml monkey patch late, at runtime

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.
---
 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 :)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [ANN] olddoc 1.4.0 - old-fashioned RDoc generator
       [not found]             ` <CAPL_2g0K8aWFB2g43NjSeaxLfbCRhf_ZrynTVa3YjjraaALMjg@mail.gmail.com>
@ 2017-02-01 17:54               ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2017-02-01 17:54 UTC (permalink / raw)
  To: Daniel Ferreira; +Cc: olddoc-public, ruby-talk

Daniel Ferreira <subtileos@gmail.com> wrote:
> Hi Eric. Are you planning to make a release with this patch?

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-01 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 21:54 [ANN] olddoc 1.4.0 - old-fashioned RDoc generator Eric Wong
     [not found] ` <CAPL_2g2MtXeagzUN65ZaLxM+v7+QqkhJp-oN5t+RJNOG659Qsg@mail.gmail.com>
2017-01-23 12:50   ` Eric Wong
     [not found]     ` <CAPL_2g2gTQrosUyrLQPARMEqnZ4=q_+OZ2+hdVFkNXGtf9A2Nw@mail.gmail.com>
2017-01-23 15:01       ` Eric Wong
     [not found]         ` <CAPL_2g25ir4ZBJo652ao1EYB59ZvFHhpGef1V14QOV2SeVXLeA@mail.gmail.com>
2017-01-24 23:19           ` Eric Wong
     [not found]             ` <CAPL_2g0K8aWFB2g43NjSeaxLfbCRhf_ZrynTVa3YjjraaALMjg@mail.gmail.com>
2017-02-01 17:54               ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/olddoc.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).