olddoc user/dev discussion/patches/bugs/etc
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] olddoc 1.7.0 - old-fashioned RDoc generator
@ 2019-04-22  2:06  7% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2019-04-22  2:06 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 dark216, a HTML generator without any images, frames,
or JavaScript.  It is designed for users of text-based browsers
and/or low-bandwidth connections; yet respects user preference for
light color schemes in new CSS browsers while favoring darkness for
power savings on OLED and CRT displays.  dark216 focuses on text as
it is the lowest common denominator for accessibility and compatibility
with people and hardware.

Changes:

    Since most users are on horrible GUI browsers which default
    to light backgrounds, implement the "dark216" color scheme
    which saves power on OLED and CRT displays.  This still
    respects "prefers-color-scheme:light" on newer browsers,
    so users can burn their eyes out if they wish :P

    While we're at it, switch to perlpod for our own documentation
    since Perl5 and POD tooling is more common on most *nix systems
    than pandoc.  Finally, update our documentation to avoid the
    term "mailing list" because centralized subscriber lists limit
    forkability compared to an "archives first" approach to email.

    3 changes since v1.6.0 (2019-01-07):
      add dark216 color scheme for power savings
      doc: switch to perlpod for documentation
      doc: update wording to avoid "mailing list"

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

^ permalink raw reply	[relevance 7%]

* [PATCH 0/3] Earth Day changes!
@ 2019-04-22  1:49  6% Eric Wong
  2019-04-22  1:49  5% ` [PATCH 1/3] add dark216 color scheme for power savings Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2019-04-22  1:49 UTC (permalink / raw)
  To: olddoc-public

Since most users are on horrible GUI browsers which default
to light backgrounds, implement the "dark216" color scheme
which saves power on OLED and CRT displays.  This still
respects "prefers-color-scheme:light" on newer browsers,
so users can burn their eyes out if they wish :P

While we're at it, switch to perlpod for our own documentation
since Perl5 and POD tooling is more common on most *nix systems
than pandoc.  Finally, update our documentation to avoid the
term "mailing list" because centralized subscriber lists hurt
forkability compared to an "archives first" approach to email.

Eric Wong (3):
  add dark216 color scheme for power savings
  doc: switch to perlpod for documentation
  doc: update wording to avoid "mailing list"

 Documentation/.gitignore                     |  1 +
 Documentation/GNUmakefile                    | 77 ++++++++++++++------
 Documentation/olddoc.1.pod                   | 21 ++++++
 Documentation/olddoc.1.txt                   | 21 ------
 Documentation/{olddoc.5.txt => olddoc.5.pod} | 19 ++---
 Documentation/podtxt2html                    | 54 ++++++++++++++
 GNUmakefile                                  |  2 +-
 README                                       | 27 ++++---
 Rakefile                                     |  2 +-
 lib/dark216.rb                               | 40 ++++++++++
 lib/olddoc.rb                                |  3 +-
 lib/oldweb.rb                                |  1 +
 lib/oldweb/_head.rhtml                       |  6 +-
 13 files changed, 202 insertions(+), 72 deletions(-)
 create mode 100644 Documentation/olddoc.1.pod
 delete mode 100644 Documentation/olddoc.1.txt
 rename Documentation/{olddoc.5.txt => olddoc.5.pod} (77%)
 create mode 100755 Documentation/podtxt2html
 create mode 100644 lib/dark216.rb

-- 
EW


^ permalink raw reply	[relevance 6%]

* [PATCH 1/3] add dark216 color scheme for power savings
  2019-04-22  1:49  6% [PATCH 0/3] Earth Day changes! Eric Wong
@ 2019-04-22  1:49  5% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2019-04-22  1:49 UTC (permalink / raw)
  To: olddoc-public

"oldweb" remains for compatibility and we still have minimal styling.

Some browsers (e.g. Firefox 67.0a1 via "ui.systemUsesDarkTheme") are
adding support for the "prefers-color-scheme" @media query.  So this
allows pages to respect user choice when it comes to dark or light
schemes.

OLED and CRT displays measure significant power savings when using
dark schemes.  Dark themes work better with less ambient light, so
favoring darkness can lead to overall power savings even with CCFL
and LED-lit displays.
---
 Documentation/olddoc.1.txt |  4 +++-
 GNUmakefile                |  2 +-
 README                     | 14 +++++++------
 lib/dark216.rb             | 40 ++++++++++++++++++++++++++++++++++++++
 lib/olddoc.rb              |  3 ++-
 lib/oldweb.rb              |  1 +
 lib/oldweb/_head.rhtml     |  6 +++++-
 7 files changed, 60 insertions(+), 10 deletions(-)
 create mode 100644 lib/dark216.rb

diff --git a/Documentation/olddoc.1.txt b/Documentation/olddoc.1.txt
index c294cdb..25bf88b 100644
--- a/Documentation/olddoc.1.txt
+++ b/Documentation/olddoc.1.txt
@@ -10,9 +10,11 @@ olddoc - old-fashioned RDoc HTML generator
 
 `rdoc` -f oldweb
 
+`rdoc` -f dark216
+
 # DESCRIPTION
 
-olddoc features oldweb, and old-fashioned RDoc HTML generator.
+olddoc features dark216, and old-fashioned RDoc HTML generator.
 You can also use "olddoc prepare" to generate NEWS files from
 git tags.
 
diff --git a/GNUmakefile b/GNUmakefile
index 038bc25..1df29ae 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -41,7 +41,7 @@ doc: $(placeholders)
 	$(MAKE) -C Documentation html
 	rm -rf doc
 	olddoc prepare
-	rdoc --debug -f oldweb
+	rdoc --debug -f dark216
 	olddoc merge
 	ln NEWS.atom.xml doc/
 
diff --git a/README b/README
index 4b5aa1f..b9538e7 100644
--- a/README
+++ b/README
@@ -3,15 +3,17 @@
 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
+olddoc contains dark216, a HTML generator without any images, frames,
+or JavaScript.  It is designed for users of text-based browsers
+and/or low-bandwidth connections; yet respects user preference for
+light color schemes in new CSS browsers while favoring darkness for
+power savings on OLED and CRT displays.  dark216 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
+* No CSS required.  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
@@ -38,7 +40,7 @@ missing out!
 
 	gem install olddoc
 	cd $ANY_RDOC_USING_RUBY_PROJECT
-	rdoc -f oldweb
+	rdoc -f dark216
 
 You can also use olddoc to generate NEWS entries
 assuming you have git tags, a README file and .olddoc.yml
diff --git a/lib/dark216.rb b/lib/dark216.rb
new file mode 100644
index 0000000..a01584c
--- /dev/null
+++ b/lib/dark216.rb
@@ -0,0 +1,40 @@
+# Copyright (C) 2019 all contributors <olddoc-public@80x24.org>
+# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
+
+# Loosely derived from Darkfish in the main rdoc distribution
+require_relative 'oldweb'
+
+# dark216 is an \RDoc template and not intended as a programming API.
+# It respect prefers-color-scheme:light on newer browsers with CSS
+# support, but favors darkness for power-savings.
+# You may specify it as an \RDoc formatter:
+#
+#   rdoc -f dark216 ...
+class Dark216 < Oldweb
+  RDoc::RDoc.add_generator(self) # :nodoc:
+  include ERB::Util # :nodoc:
+
+  # description of the generator
+  DESCRIPTION = 'minimal dark HTML generator'
+
+  # default to a dark, web-safe (216 color) palette for power-savings.
+  # Color-capable browsers can respect the prefers-color-scheme:light
+  # @media query (browser support a work-in-progress)
+  STYLE = <<''.gsub(/^\s*/m, '').delete!("\n") # :nodoc:
+@media screen {
+  *{background:#000;color:#ccc}
+  a{color:#69f}
+  a:visited{color:#96f}
+}
+@media screen AND (prefers-color-scheme:light) {
+  *{background:#fff;color:#333}
+  a{color:#00f}
+  a:visited{color:#808}
+}
+
+  def initialize(*args) # :nodoc:
+    super
+    @oldweb_style = STYLE
+  end
+end
+# :startdoc:
diff --git a/lib/olddoc.rb b/lib/olddoc.rb
index 3061e73..d5d6b37 100644
--- a/lib/olddoc.rb
+++ b/lib/olddoc.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016 all contributors <olddoc-public@80x24.org>
+# Copyright (C) 2015-2019 all contributors <olddoc-public@80x24.org>
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 module Olddoc # :nodoc:
   autoload :Gemspec, 'olddoc/gemspec'
@@ -16,3 +16,4 @@ module Olddoc # :nodoc:
   end
 end
 require_relative 'oldweb'
+require_relative 'dark216'
diff --git a/lib/oldweb.rb b/lib/oldweb.rb
index ccc37f7..5b55019 100644
--- a/lib/oldweb.rb
+++ b/lib/oldweb.rb
@@ -91,6 +91,7 @@ class Oldweb
       cgit_url << '#n%d' # lineno
       @old_vcs_url = cgit_url
     end
+    @oldweb_style = nil # used by dark216
   end
 
   def generate # :nodoc:
diff --git a/lib/oldweb/_head.rhtml b/lib/oldweb/_head.rhtml
index 720fd95..15a428e 100644
--- a/lib/oldweb/_head.rhtml
+++ b/lib/oldweb/_head.rhtml
@@ -8,4 +8,8 @@ type="application/atom+xml" /><%
 end
 %><meta
 http-equiv="Content-Type"
-content="text/html; charset=<%= @options.charset %>">
+content="text/html; charset=<%= @options.charset %>"><%
+if @oldweb_style
+%><style><%= @oldweb_style %></style><%
+end
+%>
-- 
EW


^ permalink raw reply related	[relevance 5%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-04-22  1:49  6% [PATCH 0/3] Earth Day changes! Eric Wong
2019-04-22  1:49  5% ` [PATCH 1/3] add dark216 color scheme for power savings Eric Wong
2019-04-22  2:06  7% [ANN] olddoc 1.7.0 - old-fashioned RDoc generator 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).