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.3.0 - old-fashioned RDoc generator
@ 2016-12-02 21:43  6% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-12-02 21:43 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: http://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

    This release supports the newly-released rdoc 5.x, but maintains
    support for rdoc 4.2+.  A new "source_code" accessor was
    introduced to make us less git-centric to support other systems.

    7 changes since 1.2.0:

          _head: fix Content-Type charset attribute
          add source_code accessor for tail footer
          build: dynamically generate version number
          _tail: do not mutate existing arrays
          gemspec: support rdoc 5.x
          build: avoid network usage in "install-gem" target
          doc: olddoc.5: document "source_code" field

* http://80x24.org/olddoc/ - homepage + sample
* http://80x24.org/olddoc-public/ - ML archives
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.olddoc
* olddoc-public@80x24.org - public mailing list
* git clone git://80x24.org/olddoc
* license: GPL-3.0+

-- 
EW

^ permalink raw reply	[relevance 6%]

* [PATCH] build: dynamically generate version number
@ 2016-07-28  0:16  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-28  0:16 UTC (permalink / raw)
  To: olddoc-public

This should make development a bit easier
---
 .gitignore      |  1 +
 GIT-VERSION-GEN | 42 ++++++++++++++++++++++++++++++++++++++++++
 GNUmakefile     |  4 +++-
 lib/olddoc.rb   |  2 --
 olddoc.gemspec  |  1 +
 5 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100755 GIT-VERSION-GEN

diff --git a/.gitignore b/.gitignore
index 2a6e67a..d873717 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ LATEST
 .gem-manifest
 .tgz-manifest
 /doc
+/lib/olddoc/version.rb
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
new file mode 100755
index 0000000..7199e19
--- /dev/null
+++ b/GIT-VERSION-GEN
@@ -0,0 +1,42 @@
+#!/usr/bin/env ruby
+# Copyright (C) 2016 all contributors <olddoc-public@80x24.org>
+# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
+# frozen_string_literal: true
+CONSTANT = "Olddoc::VERSION"
+RVF = "lib/olddoc/version.rb"
+GVF = "GIT-VERSION-FILE"
+DEF_VER = "v1.3.0.GIT"
+vn = DEF_VER.dup
+
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if File.exist?(".git")
+  describe = `git describe --abbrev=4 HEAD 2>/dev/null`.strip
+  case describe
+  when /\Av[0-9]*/
+    vn = describe
+    system(*%w(git update-index -q --refresh))
+    unless `git diff-index --name-only HEAD --`.chomp.empty?
+      vn << "-dirty"
+    end
+    vn.tr!('-', '.')
+  end
+end
+
+vn = vn.sub!(/\Av/, "")
+new_ruby_version = "#{CONSTANT} = '#{vn}'.freeze # :nodoc:\n"
+cur_ruby_version = File.read(RVF) rescue nil
+if new_ruby_version != cur_ruby_version
+  File.open(RVF, "w") { |fp| fp.write(new_ruby_version) }
+end
+File.chmod(0644, RVF)
+
+# generate the makefile snippet
+new_make_version = "VERSION = #{vn}\n"
+cur_make_version = File.read(GVF) rescue nil
+if new_make_version != cur_make_version
+  File.open(GVF, "w") { |fp| fp.write(new_make_version) }
+end
+File.chmod(0644, GVF)
+
+puts vn if $0 == __FILE__
diff --git a/GNUmakefile b/GNUmakefile
index f67cab6..1e07a44 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -3,7 +3,9 @@
 all::
 pkg = olddoc
 RUBY = ruby
-VERSION := $(shell $(RUBY) -Ilib -rolddoc -e 'puts Olddoc::VERSION')
+GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
+	@./GIT-VERSION-GEN
+-include GIT-VERSION-FILE
 
 check-warnings:
 	@(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
diff --git a/lib/olddoc.rb b/lib/olddoc.rb
index 5a70577..3061e73 100644
--- a/lib/olddoc.rb
+++ b/lib/olddoc.rb
@@ -1,8 +1,6 @@
 # Copyright (C) 2015-2016 all contributors <olddoc-public@80x24.org>
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 module Olddoc # :nodoc:
-  VERSION = '1.2.0' # :nodoc:
-
   autoload :Gemspec, 'olddoc/gemspec'
   autoload :History, 'olddoc/history'
   autoload :Merge, 'olddoc/merge'
diff --git a/olddoc.gemspec b/olddoc.gemspec
index def2265..d059955 100644
--- a/olddoc.gemspec
+++ b/olddoc.gemspec
@@ -2,6 +2,7 @@
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 $LOAD_PATH << 'lib'
 require 'olddoc'
+require 'olddoc/version'
 extend Olddoc::Gemspec
 name, summary, title = readme_metadata
 Gem::Specification.new do |s|
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-07-28  0:16  7% [PATCH] build: dynamically generate version number Eric Wong
2016-12-02 21:43  6% [ANN] olddoc 1.3.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).