Skip to content

Commit

Permalink
Update web site
Browse files Browse the repository at this point in the history
New home page and docs for TTFunk and PDF-Core
  • Loading branch information
pointlessone committed Mar 5, 2024
1 parent b7ca70d commit 3ebe7d3
Show file tree
Hide file tree
Showing 870 changed files with 164,209 additions and 7,434 deletions.
Empty file removed .nojekyll
Empty file.
20 changes: 7 additions & 13 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<!doctype html>
<html lang="en">
<head>
<meta charset="URF-8">
<title>Prawn | The page you were looking for doesn't exist (404)</title>
<link href='/css/default.css' media='screen' rel='stylesheet' type='text/css' />
<script src='/js/prototype.js' type='text/javascript'></script>
<script src='/js/effects.js' type='text/javascript'></script>
</head>
<body>
<div class='page shadow'>
<div class='content'>
<h1>(404) The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
<div class='bottom'>
- Fast, Nimble PDF Writer for Ruby -
</div>
<h1>(404) The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
<div class='bottom'>
- Fast, Nimble PDF Writer for Ruby -
</div>
</body>
</html>
139 changes: 104 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
chunky_png (1.3.8)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
chunky_png (1.4.0)
colorator (1.1.0)
compass (1.0.3)
chunky_png (~> 1.2)
Expand All @@ -17,50 +17,119 @@ GEM
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
ffi (1.9.18)
foreman (0.83.0)
thor (~> 0.19.1)
concurrent-ruby (1.2.3)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.16.3)
foreman (0.87.2)
forwardable-extended (2.6.0)
jekyll (3.4.2)
google-protobuf (3.25.3)
google-protobuf (3.25.3-aarch64-linux)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x86-linux)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 1.7)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.13.2)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
multi_json (1.12.1)
pathutil (0.14.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
multi_json (1.15.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.23)
thor (0.19.4)
public_suffix (5.0.4)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (4.2.0)
safe_yaml (1.0.5)
sass (3.4.25)
sass-embedded (1.71.1-aarch64-linux-android)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-aarch64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-aarch64-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm-linux-androideabi)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm-linux-gnueabihf)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm-linux-musleabihf)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-arm64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86-linux-android)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-linux-android)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.71.1-x86_64-linux-musl)
google-protobuf (~> 3.25)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
ruby
aarch64-linux
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-androideabi
arm-linux-gnueabihf
arm-linux-musleabihf
arm64-darwin
x86-linux
x86-linux-android
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
compass
foreman
jekyll

BUNDLED WITH
1.14.3
2.5.6
6 changes: 0 additions & 6 deletions Prawn/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude:
- README.md
33 changes: 0 additions & 33 deletions _layouts/default.html

This file was deleted.

11 changes: 11 additions & 0 deletions _layouts/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
<link rel="canonical" href="{{ page.redirect.to }}">
<script>location="{{ page.redirect.to }}"</script>
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="{{ page.redirect.to }}">Click here if you are not redirected.</a>
</html>
146 changes: 146 additions & 0 deletions _plugins/gem_versions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@


module GemVersions
def self.versions(name)
@versions ||= {}
@versions[name] ||=
Dir
.glob(File.join(File.expand_path('../docs', __dir__), name, '*'))
.select { File.directory? _1 }
.map { Gem::Version.new File.basename(_1) }
end

def self.all_versions(name)
@all_versions ||= {}
@all_versions[name] ||=
versions(name)
.flat_map { |v|
(1..v.segments.length).map { |n|
Gem::Version.new(v.segments.slice(0, n).join('.'))
}
}
.sort
.reverse
end

# Stubbed LiquidContext to support relative_url and absolute_url helpers
class RedirectContext
attr_reader :site

def initialize(site)
@site = site
end

def registers
{ :site => site }
end
end

class RedirectPage < Jekyll::Page
include Jekyll::Filters::URLFilters

DEFAULT_DATA = {
"sitemap" => false,
"layout" => "redirect",
}.freeze

def initialize(site, base, dir, name, from, to)
super(site, base, dir, name)

@context ||= RedirectContext.new(site)

@redirec_from = ensure_leading_slash(from)
@redirect_to = %r!^https?://!.match?(to) ? to : absolute_url(to)

data.merge!(
"permalink" => redirect_from,
"redirect" => {
"from" => redirect_from,
"to" => redirect_to,
}
)
end

attr_reader :redirect_from, :redirect_to

def read_yaml(_base, _name, _opts = {})
self.content = self.output = ""
self.data ||= DEFAULT_DATA.dup
end
end

class Generator < Jekyll::Generator
def generate(site)
Dir.glob(File.join(File.expand_path('../docs', __dir__), '*'))
.select { File.directory? _1 }
.each do |path|
gemname = File.basename(path)
versions = GemVersions.versions(gemname)
all_versions = GemVersions.all_versions(gemname)
version_map = all_versions.to_h { |v|
req = Gem::Requirement.new("~> #{v}.0")
best_version = versions.select { req.satisfied_by?(_1) }.max

[v, best_version]
}
site.data['gems'] ||= {}
site.data['gems'][gemname] = {
versions: version_map,
latest: versions.max,
}

version_map.each do |v, best_v|
next if versions.any?{ v.eql? _1 }

site.pages << RedirectPage.new(
site, site.source, "/docs/#{gemname}/#{v}/", "index.html",
"/docs/#{gemname}/#{v}/",
"/docs/#{gemname}/#{best_v}/"
)
end

site.pages << RedirectPage.new(
site, site.source, "/docs/#{gemname}/", "index.html",
"/docs/#{gemname}/",
"/docs/#{gemname}/#{site.data['gems'][gemname][:latest]}/"
)
end

site.pages << RedirectPage.new(
site, site.source, "/docs/", "index.html",
"/docs/",
"/docs/prawn/#{site.data['gems']['prawn'][:latest]}/"
)
end
end

class Tag < Liquid::Tag
def initialize(tagName, markup, options)
super
parts = markup.split
case parts.length
when 1
@gem = parts.first
@version = nil
when 2
@gem = parts.first
@version = parts.last
else
raise SyntaxError, "#{tagName} requires at least 1 and at most 2 argumnts"
end
end

def render(context)
versions = GemVersions.versions(@gem)
if @version
req = Gem::Requirement.new("~> #{@version}.0")
best_version = versions.select { req.satisfied_by?(_1) }.max
best_version.to_s
else
versions.max.to_s
end
end

Liquid::Template.register_tag "gem_version", self
end
end
Loading

0 comments on commit 3ebe7d3

Please sign in to comment.