From c654151582a77a0b459e3f55b687e43a32d4b67d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 26 Mar 2015 19:46:45 -0700 Subject: Add HAPAX LEGOMENA support & flatten structure The list of hapax legomena for this project is available at /hapax.html. In addition, the directory structure has been further flattened. All assets (javascript, lua, images, fonts) are in /trunk/. One other thing was to update the makefile. It compiles hapax.txt from rivers. --- trunk/Courier_Prime.ttf | Bin 0 -> 98156 bytes trunk/Courier_Prime_Bold.ttf | Bin 0 -> 91368 bytes trunk/Courier_Prime_Bold_Italic.ttf | Bin 0 -> 91908 bytes trunk/Courier_Prime_Italic.ttf | Bin 0 -> 96196 bytes trunk/LinLibertine_R.otf | Bin 0 -> 528064 bytes trunk/LinLibertine_R.woff | Bin 0 -> 515460 bytes trunk/LinLibertine_RB.otf | Bin 0 -> 426060 bytes trunk/LinLibertine_RB.woff | Bin 0 -> 442244 bytes trunk/LinLibertine_RBI.otf | Bin 0 -> 363740 bytes trunk/LinLibertine_RBI.woff | Bin 0 -> 301560 bytes trunk/LinLibertine_RI.otf | Bin 0 -> 445044 bytes trunk/LinLibertine_RI.woff | Bin 0 -> 458368 bytes trunk/amber.jpg | Bin 0 -> 20805 bytes trunk/black-streak.jpg | Bin 0 -> 128292 bytes trunk/courier-prime.css | 30 +++++ trunk/external.js | 5 + trunk/favico.png | Bin 0 -> 877 bytes trunk/favico.xcf | Bin 0 -> 2147 bytes trunk/gould.png | Bin 0 -> 1740535 bytes trunk/hapax.lua | 256 ++++++++++++++++++++++++++++++++++++ trunk/hylo.js | 21 +++ trunk/libertine.css | 31 +++++ trunk/lozenge.js | 27 ++++ trunk/moongone.jpg | Bin 0 -> 1922472 bytes trunk/panorama-apollo11.jpg | Bin 0 -> 720983 bytes trunk/river.lua | 230 ++++++++++++++++++++++++++++++++ trunk/tbedemugshot.jpg | Bin 0 -> 137980 bytes trunk/white-streak.jpg | Bin 0 -> 352757 bytes 28 files changed, 600 insertions(+) create mode 100644 trunk/Courier_Prime.ttf create mode 100644 trunk/Courier_Prime_Bold.ttf create mode 100644 trunk/Courier_Prime_Bold_Italic.ttf create mode 100644 trunk/Courier_Prime_Italic.ttf create mode 100644 trunk/LinLibertine_R.otf create mode 100644 trunk/LinLibertine_R.woff create mode 100644 trunk/LinLibertine_RB.otf create mode 100644 trunk/LinLibertine_RB.woff create mode 100644 trunk/LinLibertine_RBI.otf create mode 100644 trunk/LinLibertine_RBI.woff create mode 100644 trunk/LinLibertine_RI.otf create mode 100644 trunk/LinLibertine_RI.woff create mode 100644 trunk/amber.jpg create mode 100644 trunk/black-streak.jpg create mode 100644 trunk/courier-prime.css create mode 100644 trunk/external.js create mode 100644 trunk/favico.png create mode 100644 trunk/favico.xcf create mode 100644 trunk/gould.png create mode 100644 trunk/hapax.lua create mode 100644 trunk/hylo.js create mode 100644 trunk/libertine.css create mode 100644 trunk/lozenge.js create mode 100644 trunk/moongone.jpg create mode 100644 trunk/panorama-apollo11.jpg create mode 100644 trunk/river.lua create mode 100644 trunk/tbedemugshot.jpg create mode 100644 trunk/white-streak.jpg (limited to 'trunk') diff --git a/trunk/Courier_Prime.ttf b/trunk/Courier_Prime.ttf new file mode 100644 index 0000000..db4e6c1 Binary files /dev/null and b/trunk/Courier_Prime.ttf differ diff --git a/trunk/Courier_Prime_Bold.ttf b/trunk/Courier_Prime_Bold.ttf new file mode 100644 index 0000000..1b0888c Binary files /dev/null and b/trunk/Courier_Prime_Bold.ttf differ diff --git a/trunk/Courier_Prime_Bold_Italic.ttf b/trunk/Courier_Prime_Bold_Italic.ttf new file mode 100644 index 0000000..d4e7186 Binary files /dev/null and b/trunk/Courier_Prime_Bold_Italic.ttf differ diff --git a/trunk/Courier_Prime_Italic.ttf b/trunk/Courier_Prime_Italic.ttf new file mode 100644 index 0000000..75a1343 Binary files /dev/null and b/trunk/Courier_Prime_Italic.ttf differ diff --git a/trunk/LinLibertine_R.otf b/trunk/LinLibertine_R.otf new file mode 100644 index 0000000..6d345d5 Binary files /dev/null and b/trunk/LinLibertine_R.otf differ diff --git a/trunk/LinLibertine_R.woff b/trunk/LinLibertine_R.woff new file mode 100644 index 0000000..0357ad4 Binary files /dev/null and b/trunk/LinLibertine_R.woff differ diff --git a/trunk/LinLibertine_RB.otf b/trunk/LinLibertine_RB.otf new file mode 100644 index 0000000..811cea8 Binary files /dev/null and b/trunk/LinLibertine_RB.otf differ diff --git a/trunk/LinLibertine_RB.woff b/trunk/LinLibertine_RB.woff new file mode 100644 index 0000000..a0dbbbf Binary files /dev/null and b/trunk/LinLibertine_RB.woff differ diff --git a/trunk/LinLibertine_RBI.otf b/trunk/LinLibertine_RBI.otf new file mode 100644 index 0000000..c1a4ff7 Binary files /dev/null and b/trunk/LinLibertine_RBI.otf differ diff --git a/trunk/LinLibertine_RBI.woff b/trunk/LinLibertine_RBI.woff new file mode 100644 index 0000000..402494e Binary files /dev/null and b/trunk/LinLibertine_RBI.woff differ diff --git a/trunk/LinLibertine_RI.otf b/trunk/LinLibertine_RI.otf new file mode 100644 index 0000000..288f5d0 Binary files /dev/null and b/trunk/LinLibertine_RI.otf differ diff --git a/trunk/LinLibertine_RI.woff b/trunk/LinLibertine_RI.woff new file mode 100644 index 0000000..e2a0ae4 Binary files /dev/null and b/trunk/LinLibertine_RI.woff differ diff --git a/trunk/amber.jpg b/trunk/amber.jpg new file mode 100644 index 0000000..7b70b35 Binary files /dev/null and b/trunk/amber.jpg differ diff --git a/trunk/black-streak.jpg b/trunk/black-streak.jpg new file mode 100644 index 0000000..5b44525 Binary files /dev/null and b/trunk/black-streak.jpg differ diff --git a/trunk/courier-prime.css b/trunk/courier-prime.css new file mode 100644 index 0000000..0a38383 --- /dev/null +++ b/trunk/courier-prime.css @@ -0,0 +1,30 @@ +/* COURIER PRIME FONT for Autocento project. + * ONLY PUT @font-face RULES HERE. + */ + +/* Normal = normal */ +@font-face { + font-family: "Courier Prime"; + font-weight: normal; + font-style: normal; + src: url("Courier_Prime.ttf"); +} +@font-face { + font-family: "Courier Prime"; + font-weight: normal; + font-style: italic; + src: url("Courier_Prime_Italic.ttf"); +} +/* Bold = bold */ +@font-face { + font-family: "Courier Prime"; + font-weight: bold; + font-style: normal; + src: url("Courier_Prime_Bold.ttf"); +} +@font-face { + font-family: "Courier Prime"; + font-weight: bold; + font-style: italic; + src: url("Courier_Prime_Bold_Italic.ttf"); +} diff --git a/trunk/external.js b/trunk/external.js new file mode 100644 index 0000000..ee425cd --- /dev/null +++ b/trunk/external.js @@ -0,0 +1,5 @@ +/* External.js for Autocento of the breakfast table + * this gives external links the class "external." + */ + + diff --git a/trunk/favico.png b/trunk/favico.png new file mode 100644 index 0000000..4f85004 Binary files /dev/null and b/trunk/favico.png differ diff --git a/trunk/favico.xcf b/trunk/favico.xcf new file mode 100644 index 0000000..bdd2949 Binary files /dev/null and b/trunk/favico.xcf differ diff --git a/trunk/gould.png b/trunk/gould.png new file mode 100644 index 0000000..833c2dd Binary files /dev/null and b/trunk/gould.png differ diff --git a/trunk/hapax.lua b/trunk/hapax.lua new file mode 100644 index 0000000..7e8410c --- /dev/null +++ b/trunk/hapax.lua @@ -0,0 +1,256 @@ +-- Pandoc River writer +-- it takes out all formatting, leaving only a river of text +-- running down the page: one word per line +-- vim: fdm=marker +-- invoke with: pandoc -t river.lua + +os.setlocale("en_US.UTF-8") + +function hapax(s) + local function tablify (s, p) + local t={} + for w in s:gmatch(p) do + table.insert(t, w) + end + return t + end + local function stripDupes (t) + local seen = {} + local remove = {} + for i = 1, #t do + element = t[i] + if seen[element] then + remove[element] = true + else + seen[element] = true + end + end + for i = #t, 1, -1 do + if remove[t[i]] then + table.remove(t, i) + end + end + return t + end + return table.concat(stripDupes(tablify(s, "%S+")), "\n") +end + +function flow(s) + return s:gsub("%s+", "\n") +end + +function nude(s) + -- Expand contractions + s = s:gsub("'%a+%s", function (x) + if x == "'ll" then + return " will " + elseif x == "'ve" then + return " have " + elseif x == "'re" then + return " are " + else + return x + end + end) + s = s:gsub("it's", "it is") + s = s:gsub("n't", " not ") + -- Get rid of quotes around words + s = s:gsub('"', ' ') + s = s:gsub("%s'", ' ') + s = s:gsub("'%s", ' ') + -- Remove HTML entities + s = s:gsub('&.-;', ' ') + s = s:gsub('%b<>', ' ') + -- Remove end-of-line backslashes + s = s:gsub('\\$', ' ') + -- Remove dashes (not hyphens) + s = s:gsub('%-[%-%s]+', ' ') + -- Remove everything that is not letters or numbers + s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ') + -- Remove extra spaces + s = s:gsub('%s+', ' ') + return s:lower() +end + +-- This function is called once for the whole document. Parameters: +-- body is a string, metadata is a table, variables is a table. +-- One could use some kind of templating +-- system here; this just gives you a simple standalone HTML file. +function Doc(body, metadata, variables) + local buffer = "" + local function add(s) + buffer = buffer .. nude(s) .. "\n" + end + if metadata['title'] then + add(metadata['title']) + end + if metadata['subtitle'] then + add(metadata['subtitle']) + end + add(body) + return hapax(flow(buffer)) +end + +-- Remove all formatting {{{ +function Note(s) + return nude(s) +end + +function Blocksep() + return "\n" +end +function Emph(s) + return nude(s) +end + +function Strong(s) + return nude(s) +end + +function Subscript(s) + return nude(s) +end + +function Superscript(s) + return nude(s) +end + +function SmallCaps(s) + return nude(s) +end + +function Strikeout(s) + return nude(s) +end + +function Code(s, attr) + return nude(s) +end + +function CodeBlock(s, attr) + return nude(s) +end + +function InlineMath(s) + return nude(s) +end + +function DisplayMath(s) + return nude(s) +end + +function Span(s, attr) + return nude(s) +end + +function Cite(s) + return nude(s) +end + +function Plain(s) + return nude(s) +end + +-- Links only include the link text +function Link(s, src, tit) + return nude(s) +end + +-- Images have nothing to give us +-- (but add a space just in case) +function Image(s, src, tit) + return "\n" +end + +function CaptionedImage(s, src, tit) + return "\n" +end + +function Str(s) + return nude(s) +end + +function Div(s, attr) + return nude(s) +end + +function Space(s) + return "\n" +end + +function LineBreak() + return "\n" +end + +function Para(s) + return nude(s) +end + +function Header(lev, s, attr) + return nude(s) +end + +function BlockQuote(s) + return nude(s) +end + +function HorizontalRule() + return "\n" +end + +function BulletList(items) + local buffer = "" + for _, item in pairs(items) do + buffer = buffer .. nude(item) .. "\n" + end + return buffer .. "\n" +end + +function OrderedList(items) + local buffer = "" + for _, item in pairs(items) do + buffer = buffer .. nude(item) .. "\n" + end + return buffer .. "\n" +end + +function DefinitionList(items) + local buffer = "" + for _, item in pairs(items) do + for k, v in pairs(item) do + buffer = buffer .. nude(k) .. "\n" .. nude(v) .. "\n" + end + end + return buffer .. "\n" +end + +function Table(caption, aligns, widths, headers, rows) + local buffer = "" + local function add(s) + buffer = buffer .. nude(s) .. "\n" + end + if caption ~= "" then + add(caption) + end + for _,h in pairs(headers) do + add(h) + end + for _, row in pairs(rows) do + for _, cell in pairs(row) do + add(cell) + end + end + return buffer +end +-- }}} + +-- The following code will produce runtime warnings when you haven't defined +-- all of the functions you need for the custom writer, so it's useful +-- to include when you're working on a writer. +local meta = {} +meta.__index = + function(_, key) + io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key)) + return function() return "" end + end +setmetatable(_G, meta) diff --git a/trunk/hylo.js b/trunk/hylo.js new file mode 100644 index 0000000..5a39427 --- /dev/null +++ b/trunk/hylo.js @@ -0,0 +1,21 @@ +/* + * Hyphenator_Loader 1.1.0 - client side hyphenation for webbrowsers + * Copyright (C) 2014 Mathias Nater, Zürich (mathias at mnn dot ch) + * Project and Source hosted on http://code.google.com/p/hyphenator/ + * + * This JavaScript code is free software: you can redistribute + * it and/or modify it under the terms of the GNU Lesser + * General Public License (GNU LGPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + */ + +var Hyphenator_Loader=(function(window){'use strict';var languages,config,path,createElem=function(tagname){var r;if(window.document.createElementNS){r=window.document.createElementNS('http://www.w3.org/1999/xhtml',tagname);}else if(window.document.createElement){r=window.document.createElement(tagname);}return r;},checkLangSupport=function(lang,longword){var shadow,computedHeight,bdy=window.document.getElementsByTagName('body')[0];shadow=createElem('div');shadow.style.width='5em';shadow.style.MozHyphens='auto';shadow.style['-webkit-hyphens']='auto';shadow.style['-ms-hyphens']='auto';shadow.style.hyphens='auto';shadow.style.fontSize='12px';shadow.style.lineHeight='12px';shadow.style.visibility='hidden';shadow.lang=lang;shadow.style['-webkit-locale']="'"+lang+"'";shadow.innerHTML=longword;bdy.appendChild(shadow);computedHeight=shadow.offsetHeight;bdy.removeChild(shadow);return(computedHeight>12)?true:false;},loadNrunHyphenator=function(config){var head,script,interval;head=window.document.getElementsByTagName('head').item(0);script=createElem('script');script.src=path;script.type='text/javascript';head.appendChild(script);interval=window.setInterval(function(){if(window.Hyphenator!==undefined){window.clearInterval(interval);Hyphenator.config(config);Hyphenator.run();}},10);},runner=function(){var loadHyphenator=false,r,results={},lang;for(lang in languages){if(languages.hasOwnProperty(lang)){r=checkLangSupport(lang,languages[lang]);results[lang]=r;loadHyphenator=loadHyphenator||!r;}}if(loadHyphenator){loadNrunHyphenator(config);}},runOnContentLoaded=function(window,f){var toplevel,hyphRunForThis={},doFrames=false,contextWindow,documentLoaded,add=window.document.addEventListener?'addEventListener':'attachEvent',rem=window.document.addEventListener?'removeEventListener':'detachEvent',pre=window.document.addEventListener?'':'on',init=function(context){contextWindow=context||window;if(!hyphRunForThis[contextWindow.location.href]&&(!documentLoaded||!!contextWindow.frameElement)){documentLoaded=true;f();hyphRunForThis[contextWindow.location.href]=true;}},doScrollCheck=function(){try{window.document.documentElement.doScroll("left");}catch(error){window.setTimeout(doScrollCheck,1);return;}init(window);},doOnLoad=function(){var i,haveAccess,fl=window.frames.length;if(doFrames&&fl>0){for(i=0;i', ' ') + -- Remove end-of-line backslashes + s = s:gsub('%s+\\$', ' ') + -- Remove dashes (not hyphens) + s = s:gsub('%-%-+', ' ') + s = s:gsub('%-%s', ' ') + -- Remove everything that is not letters or numbers + s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ') + -- Remove extra spaces + s = s:gsub('%s+', ' ') + return s:lower() +end + +-- This function is called once for the whole document. Parameters: +-- body is a string, metadata is a table, variables is a table. +-- One could use some kind of templating +-- system here; this just gives you a simple standalone HTML file. +function Doc(body, metadata, variables) + local buffer = "" + local function add(s) + buffer = buffer .. nude(s) .. "\n" + end + if metadata['title'] then + add(metadata['title']) + end + if metadata['subtitle'] then + add(metadata['subtitle']) + end + -- TODO: epigraph.content, epigraph.attrib, dedication, other metadata? + add(body) + return flow(buffer) +end + +-- Remove all formatting {{{ +function Note(s) + return nude(s) +end + +function Blocksep() + return "\n" +end +function Emph(s) + return nude(s) +end + +function Strong(s) + return nude(s) +end + +function Subscript(s) + return nude(s) +end + +function Superscript(s) + return nude(s) +end + +function SmallCaps(s) + return nude(s) +end + +function Strikeout(s) + return nude(s) +end + +function Code(s, attr) + return nude(s) +end + +function CodeBlock(s, attr) + return nude(s) +end + +function InlineMath(s) + return nude(s) +end + +function DisplayMath(s) + return nude(s) +end + +function Span(s, attr) + return nude(s) +end + +function Cite(s) + return nude(s) +end + +function Plain(s) + return nude(s) +end + +-- Links only include the link text +function Link(s, src, tit) + return nude(s) +end + +-- Images have nothing to give us +-- (but add a space just in case) +function Image(s, src, tit) + return "\n" +end + +function CaptionedImage(s, src, tit) + return "\n" +end + +function Str(s) + return nude(s) +end + +function Div(s, attr) + return nude(s) +end + +function Space(s) + return "\n" +end + +function LineBreak() + return "\n" +end + +function Para(s) + return nude(s) +end + +function Header(lev, s, attr) + return nude(s) +end + +function BlockQuote(s) + return nude(s) +end + +function HorizontalRule() + return "\n" +end + +function BulletList(items) + local buffer = "" + for _, item in pairs(items) do + buffer = buffer .. nude(item) .. "\n" + end + return buffer .. "\n" +end + +function OrderedList(items) + local buffer = "" + for _, item in pairs(items) do + buffer = buffer .. nude(item) .. "\n" + end + return buffer .. "\n" +end + +function DefinitionList(items) + local buffer = "" + for _, item in pairs(items) do + for k, v in pairs(item) do + buffer = buffer .. nude(k) .. "\n" .. nude(v) .. "\n" + end + end + return buffer .. "\n" +end + +function Table(caption, aligns, widths, headers, rows) + local buffer = "" + local function add(s) + buffer = buffer .. nude(s) .. "\n" + end + if caption ~= "" then + add(caption) + end + for _,h in pairs(headers) do + add(h) + end + for _, row in pairs(rows) do + for _, cell in pairs(row) do + add(cell) + end + end + return buffer +end +-- }}} + +-- The following code will produce runtime warnings when you haven't defined +-- all of the functions you need for the custom writer, so it's useful +-- to include when you're working on a writer. +local meta = {} +meta.__index = + function(_, key) + io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key)) + return function() return "" end + end +setmetatable(_G, meta) + diff --git a/trunk/tbedemugshot.jpg b/trunk/tbedemugshot.jpg new file mode 100644 index 0000000..0fd03b2 Binary files /dev/null and b/trunk/tbedemugshot.jpg differ diff --git a/trunk/white-streak.jpg b/trunk/white-streak.jpg new file mode 100644 index 0000000..318f654 Binary files /dev/null and b/trunk/white-streak.jpg differ -- cgit 1.4.1-21-gabe81