olddoc user/dev discussion/patches/bugs/etc
 help / color / mirror / code / Atom feed
blob a01584c080d4a7f670b6292780e80be9e2b1e632 1210 bytes (raw)
name: lib/dark216.rb 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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:

debug log:

solving a01584c ...
found a01584c in https://80x24.org/olddoc.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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