summary refs log tree commit diff stats
path: root/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'trunk')
-rw-r--r--trunk/Courier_Prime.ttfbin0 -> 98156 bytes
-rw-r--r--trunk/Courier_Prime_Bold.ttfbin0 -> 91368 bytes
-rw-r--r--trunk/Courier_Prime_Bold_Italic.ttfbin0 -> 91908 bytes
-rw-r--r--trunk/Courier_Prime_Italic.ttfbin0 -> 96196 bytes
-rw-r--r--trunk/LinLibertine_R.otfbin0 -> 528064 bytes
-rw-r--r--trunk/LinLibertine_R.woffbin0 -> 515460 bytes
-rw-r--r--trunk/LinLibertine_RB.otfbin0 -> 426060 bytes
-rw-r--r--trunk/LinLibertine_RB.woffbin0 -> 442244 bytes
-rw-r--r--trunk/LinLibertine_RBI.otfbin0 -> 363740 bytes
-rw-r--r--trunk/LinLibertine_RBI.woffbin0 -> 301560 bytes
-rw-r--r--trunk/LinLibertine_RI.otfbin0 -> 445044 bytes
-rw-r--r--trunk/LinLibertine_RI.woffbin0 -> 458368 bytes
-rw-r--r--trunk/amber.jpgbin0 -> 20805 bytes
-rw-r--r--trunk/black-streak.jpgbin0 -> 128292 bytes
-rw-r--r--trunk/courier-prime.css30
-rw-r--r--trunk/external.js5
-rw-r--r--trunk/favico.pngbin0 -> 877 bytes
-rw-r--r--trunk/favico.xcfbin0 -> 2147 bytes
-rw-r--r--trunk/gould.pngbin0 -> 1740535 bytes
-rw-r--r--trunk/hapax.lua256
-rw-r--r--trunk/hylo.js21
-rw-r--r--trunk/libertine.css31
-rw-r--r--trunk/lozenge.js27
-rw-r--r--trunk/moongone.jpgbin0 -> 1922472 bytes
-rw-r--r--trunk/panorama-apollo11.jpgbin0 -> 720983 bytes
-rw-r--r--trunk/river.lua230
-rw-r--r--trunk/tbedemugshot.jpgbin0 -> 137980 bytes
-rw-r--r--trunk/white-streak.jpgbin0 -> 352757 bytes
28 files changed, 600 insertions, 0 deletions
diff --git a/trunk/Courier_Prime.ttf b/trunk/Courier_Prime.ttf new file mode 100644 index 0000000..db4e6c1 --- /dev/null +++ b/trunk/Courier_Prime.ttf
Binary files differ
diff --git a/trunk/Courier_Prime_Bold.ttf b/trunk/Courier_Prime_Bold.ttf new file mode 100644 index 0000000..1b0888c --- /dev/null +++ b/trunk/Courier_Prime_Bold.ttf
Binary files differ
diff --git a/trunk/Courier_Prime_Bold_Italic.ttf b/trunk/Courier_Prime_Bold_Italic.ttf new file mode 100644 index 0000000..d4e7186 --- /dev/null +++ b/trunk/Courier_Prime_Bold_Italic.ttf
Binary files differ
diff --git a/trunk/Courier_Prime_Italic.ttf b/trunk/Courier_Prime_Italic.ttf new file mode 100644 index 0000000..75a1343 --- /dev/null +++ b/trunk/Courier_Prime_Italic.ttf
Binary files differ
diff --git a/trunk/LinLibertine_R.otf b/trunk/LinLibertine_R.otf new file mode 100644 index 0000000..6d345d5 --- /dev/null +++ b/trunk/LinLibertine_R.otf
Binary files differ
diff --git a/trunk/LinLibertine_R.woff b/trunk/LinLibertine_R.woff new file mode 100644 index 0000000..0357ad4 --- /dev/null +++ b/trunk/LinLibertine_R.woff
Binary files differ
diff --git a/trunk/LinLibertine_RB.otf b/trunk/LinLibertine_RB.otf new file mode 100644 index 0000000..811cea8 --- /dev/null +++ b/trunk/LinLibertine_RB.otf
Binary files differ
diff --git a/trunk/LinLibertine_RB.woff b/trunk/LinLibertine_RB.woff new file mode 100644 index 0000000..a0dbbbf --- /dev/null +++ b/trunk/LinLibertine_RB.woff
Binary files differ
diff --git a/trunk/LinLibertine_RBI.otf b/trunk/LinLibertine_RBI.otf new file mode 100644 index 0000000..c1a4ff7 --- /dev/null +++ b/trunk/LinLibertine_RBI.otf
Binary files differ
diff --git a/trunk/LinLibertine_RBI.woff b/trunk/LinLibertine_RBI.woff new file mode 100644 index 0000000..402494e --- /dev/null +++ b/trunk/LinLibertine_RBI.woff
Binary files differ
diff --git a/trunk/LinLibertine_RI.otf b/trunk/LinLibertine_RI.otf new file mode 100644 index 0000000..288f5d0 --- /dev/null +++ b/trunk/LinLibertine_RI.otf
Binary files differ
diff --git a/trunk/LinLibertine_RI.woff b/trunk/LinLibertine_RI.woff new file mode 100644 index 0000000..e2a0ae4 --- /dev/null +++ b/trunk/LinLibertine_RI.woff
Binary files differ
diff --git a/trunk/amber.jpg b/trunk/amber.jpg new file mode 100644 index 0000000..7b70b35 --- /dev/null +++ b/trunk/amber.jpg
Binary files differ
diff --git a/trunk/black-streak.jpg b/trunk/black-streak.jpg new file mode 100644 index 0000000..5b44525 --- /dev/null +++ b/trunk/black-streak.jpg
Binary files 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 @@
1/* COURIER PRIME FONT for Autocento project.
2 * ONLY PUT @font-face RULES HERE.
3 */
4
5/* Normal = normal */
6@font-face {
7 font-family: "Courier Prime";
8 font-weight: normal;
9 font-style: normal;
10 src: url("Courier_Prime.ttf");
11}
12@font-face {
13 font-family: "Courier Prime";
14 font-weight: normal;
15 font-style: italic;
16 src: url("Courier_Prime_Italic.ttf");
17}
18/* Bold = bold */
19@font-face {
20 font-family: "Courier Prime";
21 font-weight: bold;
22 font-style: normal;
23 src: url("Courier_Prime_Bold.ttf");
24}
25@font-face {
26 font-family: "Courier Prime";
27 font-weight: bold;
28 font-style: italic;
29 src: url("Courier_Prime_Bold_Italic.ttf");
30}
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 @@
1/* External.js for Autocento of the breakfast table
2 * this gives external links the class "external."
3 */
4
5
diff --git a/trunk/favico.png b/trunk/favico.png new file mode 100644 index 0000000..4f85004 --- /dev/null +++ b/trunk/favico.png
Binary files differ
diff --git a/trunk/favico.xcf b/trunk/favico.xcf new file mode 100644 index 0000000..bdd2949 --- /dev/null +++ b/trunk/favico.xcf
Binary files differ
diff --git a/trunk/gould.png b/trunk/gould.png new file mode 100644 index 0000000..833c2dd --- /dev/null +++ b/trunk/gould.png
Binary files 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 @@
1-- Pandoc River writer
2-- it takes out all formatting, leaving only a river of text
3-- running down the page: one word per line
4-- vim: fdm=marker
5-- invoke with: pandoc -t river.lua
6
7os.setlocale("en_US.UTF-8")
8
9function hapax(s)
10 local function tablify (s, p)
11 local t={}
12 for w in s:gmatch(p) do
13 table.insert(t, w)
14 end
15 return t
16 end
17 local function stripDupes (t)
18 local seen = {}
19 local remove = {}
20 for i = 1, #t do
21 element = t[i]
22 if seen[element] then
23 remove[element] = true
24 else
25 seen[element] = true
26 end
27 end
28 for i = #t, 1, -1 do
29 if remove[t[i]] then
30 table.remove(t, i)
31 end
32 end
33 return t
34 end
35 return table.concat(stripDupes(tablify(s, "%S+")), "\n")
36end
37
38function flow(s)
39 return s:gsub("%s+", "\n")
40end
41
42function nude(s)
43 -- Expand contractions
44 s = s:gsub("'%a+%s", function (x)
45 if x == "'ll" then
46 return " will "
47 elseif x == "'ve" then
48 return " have "
49 elseif x == "'re" then
50 return " are "
51 else
52 return x
53 end
54 end)
55 s = s:gsub("it's", "it is")
56 s = s:gsub("n't", " not ")
57 -- Get rid of quotes around words
58 s = s:gsub('"', ' ')
59 s = s:gsub("%s'", ' ')
60 s = s:gsub("'%s", ' ')
61 -- Remove HTML entities
62 s = s:gsub('&.-;', ' ')
63 s = s:gsub('%b<>', ' ')
64 -- Remove end-of-line backslashes
65 s = s:gsub('\\$', ' ')
66 -- Remove dashes (not hyphens)
67 s = s:gsub('%-[%-%s]+', ' ')
68 -- Remove everything that is not letters or numbers
69 s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ')
70 -- Remove extra spaces
71 s = s:gsub('%s+', ' ')
72 return s:lower()
73end
74
75-- This function is called once for the whole document. Parameters:
76-- body is a string, metadata is a table, variables is a table.
77-- One could use some kind of templating
78-- system here; this just gives you a simple standalone HTML file.
79function Doc(body, metadata, variables)
80 local buffer = ""
81 local function add(s)
82 buffer = buffer .. nude(s) .. "\n"
83 end
84 if metadata['title'] then
85 add(metadata['title'])
86 end
87 if metadata['subtitle'] then
88 add(metadata['subtitle'])
89 end
90 add(body)
91 return hapax(flow(buffer))
92end
93
94-- Remove all formatting {{{
95function Note(s)
96 return nude(s)
97end
98
99function Blocksep()
100 return "\n"
101end
102function Emph(s)
103 return nude(s)
104end
105
106function Strong(s)
107 return nude(s)
108end
109
110function Subscript(s)
111 return nude(s)
112end
113
114function Superscript(s)
115 return nude(s)
116end
117
118function SmallCaps(s)
119 return nude(s)
120end
121
122function Strikeout(s)
123 return nude(s)
124end
125
126function Code(s, attr)
127 return nude(s)
128end
129
130function CodeBlock(s, attr)
131 return nude(s)
132end
133
134function InlineMath(s)
135 return nude(s)
136end
137
138function DisplayMath(s)
139 return nude(s)
140end
141
142function Span(s, attr)
143 return nude(s)
144end
145
146function Cite(s)
147 return nude(s)
148end
149
150function Plain(s)
151 return nude(s)
152end
153
154-- Links only include the link text
155function Link(s, src, tit)
156 return nude(s)
157end
158
159-- Images have nothing to give us
160-- (but add a space just in case)
161function Image(s, src, tit)
162 return "\n"
163end
164
165function CaptionedImage(s, src, tit)
166 return "\n"
167end
168
169function Str(s)
170 return nude(s)
171end
172
173function Div(s, attr)
174 return nude(s)
175end
176
177function Space(s)
178 return "\n"
179end
180
181function LineBreak()
182 return "\n"
183end
184
185function Para(s)
186 return nude(s)
187end
188
189function Header(lev, s, attr)
190 return nude(s)
191end
192
193function BlockQuote(s)
194 return nude(s)
195end
196
197function HorizontalRule()
198 return "\n"
199end
200
201function BulletList(items)
202 local buffer = ""
203 for _, item in pairs(items) do
204 buffer = buffer .. nude(item) .. "\n"
205 end
206 return buffer .. "\n"
207end
208
209function OrderedList(items)
210 local buffer = ""
211 for _, item in pairs(items) do
212 buffer = buffer .. nude(item) .. "\n"
213 end
214 return buffer .. "\n"
215end
216
217function DefinitionList(items)
218 local buffer = ""
219 for _, item in pairs(items) do
220 for k, v in pairs(item) do
221 buffer = buffer .. nude(k) .. "\n" .. nude(v) .. "\n"
222 end
223 end
224 return buffer .. "\n"
225end
226
227function Table(caption, aligns, widths, headers, rows)
228 local buffer = ""
229 local function add(s)
230 buffer = buffer .. nude(s) .. "\n"
231 end
232 if caption ~= "" then
233 add(caption)
234 end
235 for _,h in pairs(headers) do
236 add(h)
237 end
238 for _, row in pairs(rows) do
239 for _, cell in pairs(row) do
240 add(cell)
241 end
242 end
243 return buffer
244end
245-- }}}
246
247-- The following code will produce runtime warnings when you haven't defined
248-- all of the functions you need for the custom writer, so it's useful
249-- to include when you're working on a writer.
250local meta = {}
251meta.__index =
252 function(_, key)
253 io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))
254 return function() return "" end
255 end
256setmetatable(_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 @@
1/*
2 * Hyphenator_Loader 1.1.0 - client side hyphenation for webbrowsers
3 * Copyright (C) 2014 Mathias Nater, Zürich (mathias at mnn dot ch)
4 * Project and Source hosted on http://code.google.com/p/hyphenator/
5 *
6 * This JavaScript code is free software: you can redistribute
7 * it and/or modify it under the terms of the GNU Lesser
8 * General Public License (GNU LGPL) as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option)
10 * any later version. The code is distributed WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
13 *
14 * As additional permission under GNU GPL version 3 section 7, you
15 * may distribute non-source (e.g., minimized or compacted) forms of
16 * that code without the copy of the GNU GPL normally required by
17 * section 4, provided you include this license notice and a URL
18 * through which recipients can access the Corresponding Source.
19 */
20
21var 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<fl;i+=1){haveAccess=undefined;try{haveAccess=window.frames[i].document.toString();}catch(e){haveAccess=undefined;}if(!!haveAccess){if(window.frames[i].location.href!=='about:blank'){init(window.frames[i]);}}}contextWindow=window;f();hyphRunForThis[window.location.href]=true;}else{init(window);}},DOMContentLoaded=function(e){if(e.type==='readystatechange'&&window.document.readyState!=='complete'){return;}window.document[rem](pre+e.type,DOMContentLoaded,false);if(!doFrames&&window.frames.length===0){init(window);}};if(window.document.readyState==="complete"||window.document.readyState==="interactive"){window.setTimeout(doOnLoad,1);}else{window.document[add](pre+"DOMContentLoaded",DOMContentLoaded,false);window.document[add](pre+'readystatechange',DOMContentLoaded,false);window[add](pre+'load',doOnLoad,false);toplevel=false;try{toplevel=!window.frameElement;}catch(ignore){}if(window.document.documentElement.doScroll&&toplevel){doScrollCheck();}}};return{init:function(langs,p,configs){languages=langs;path=p;config=configs||{};runOnContentLoaded(window,runner);}};}(window));Hyphenator_Loader.init({"en":"hyphenationalgorithm",},"./Hyphenator.js",{classname:'prose',defaultlanguage:'en',displaytogglebox:true,togglebox:function(){var bdy,myTextNode,text=(Hyphenator.doHyphenation?'-':'~'),myBox=contextWindow.document.getElementById('HyphenatorToggleBox');if(!!myBox){myBox.firstChild.data=text;}else{bdy=contextWindow.document.getElementsByTagName('body')[0];myBox=createElem('div',contextWindow);myBox.setAttribute('id','HyphenatorToggleBox');myBox.setAttribute('class',dontHyphenateClass);myTextNode=contextWindow.document.createTextNode(text);myBox.appendChild(myTextNode);myBox.onclick=Hyphenator.toggleHyphenation;myBox.style.position='absolute';myBox.style.top='0px';myBox.style.right='0px';myBox.style.margin='0';myBox.style.backgroundColor=rgba(0,0,0,255);myBox.style.color=rgba(255,255,255,100);myBox.style.font='6pt Arial';myBox.style.letterSpacing='0.2em';myBox.style.padding='3px';myBox.style.cursor='pointer';myBox.style.WebkitBorderBottomLeftRadius='4px';myBox.style.MozBorderRadiusBottomleft='4px';myBox.style.borderBottomLeftRadius='4px';bdy.appendChild(myBox);}},useCSS3hyphenation:true});
diff --git a/trunk/libertine.css b/trunk/libertine.css new file mode 100644 index 0000000..7432d14 --- /dev/null +++ b/trunk/libertine.css
@@ -0,0 +1,31 @@
1/* CSS for Linux Libertine family of fonts */
2
3@font-face {
4 font-family: "Libertine";
5 src: url('LinLibertine_R.woff'),
6 url('LinLibertine_R.otf');
7 font-weight: 400;
8 font-style: normal;
9}
10@font-face {
11 font-family: "Libertine";
12 src: url('LinLibertine_RB.woff'),
13 url('LinLibertine_RB.otf');
14 font-weight: 700;
15 font-style: normal;
16}
17
18@font-face {
19 font-family: "Libertine";
20 src: url('LinLibertine_RI.woff'),
21 url('LinLibertine_RI.otf');
22 font-weight: 400;
23 font-style: italic;
24}
25@font-face {
26 font-family: "Libertine";
27 src: url('LinLibertine_RBI.woff'),
28 url('LinLibertine_RBI.otf');
29 font-weight: 700;
30 font-style: italic;
31}
diff --git a/trunk/lozenge.js b/trunk/lozenge.js new file mode 100644 index 0000000..2df6cad --- /dev/null +++ b/trunk/lozenge.js
@@ -0,0 +1,27 @@
1/* Lozenge.js for Autocento of the breakfast table
2 * Cause a#lozenge to link to random file in array
3 * vim: fdm=marker
4 */
5
6function _lozenge() {
7 var lozenge = document.getElementById('lozenge');
8 // array with all files {{{
9 var files=["100-lines.html","about-the-author.html","about.html","about_author.html","amber-alert.html","and.html","angeltoabraham.html","apollo11.html","arspoetica.html","art.html","axe.html","big-dipper.html","boar.html","boy_bus.html","building.html","call-me-aural-pleasure.html","cereal.html","cold-wind.html","collage-instrument.html","common-titles.html","creation-myth.html","deadman.html","death-zone.html","deathstrumpet.html","dollywood.html","dream.html","early.html","elegyforanalternateself.html","epigraph.html","ex-machina.html","exasperated.html","father.html","feedingtheraven.html","finding-the-lion.html","fire.html","first-lines.html","found-typewriter-poem.html","hands.html","hapax.html","hard-game.html","hardware.html","howithappened.html","howtoread.html","hymnal.html","i-am.html","i-think-its-you.html","i-want-to-say.html","i-wanted-to-tell-you-something.html","in-bed.html","initial-conditions.html","january.html","joke.html","lappel-du-vide.html","largest-asteroid.html","last-bastion.html","last-passenger.html","leaf.html","leg.html","likingthings.html","listen.html","love-as-god.html","lovesong.html","man.html","manifesto_poetics.html","moon-drowning.html","moongone.html","mountain.html","movingsideways.html","music-433.html","no-nothing.html","notes.html","nothing-is-ever-over.html","on-genre-dimension.html","onformalpoetry.html","options.html","ouroboros_memory.html","paul.html","peaches.html","philosophy.html","phone.html","planks.html","plant.html","poetry-time.html","prelude.html","problems.html","proverbs.html","punch.html","purpose-dogs.html","question.html","real-writer.html","reports.html","riptide_memory.html","ronaldmcdonald.html","roughgloves.html","sapling.html","seasonal-affective-disorder.html","sense-of-it.html","serengeti.html","shed.html","shipwright.html","sixteenth-chapel.html","snow.html","something-simple.html","spittle.html","squirrel.html","stagnant.html","statements-frag.html","stayed-on-the-bus.html","stump.html","swansong-alt.html","swansong.html","swear.html","table_contents.html","tapestry.html","telemarketer.html","the-night-we-met.html","the-sea_the-beach.html","theoceanoverflowswithcamels.html","time-looks-up-to-the-sky.html","todaniel.html","toilet.html","toothpaste.html","treatise.html","underwear.html","walking-in-the-rain.html","wallpaper.html","weplayedthosegamestoo.html","what-we-are-made-of.html","when-im-sorry-i.html","window.html","words-irritable-reaching.html","words-meaning.html","worse-looking-over.html","writing.html","x-ray.html","yellow.html"]
10 // }}}
11
12 var index = Math.floor(Math.random() * files.length);
13
14 var url = window.location.pathname;
15 var current = url.substring(url.lastIndexOf('/')+1);
16
17 if (current != files[index]) {
18 lozenge.setAttribute("href", files[index]);
19 lozenge.setAttribute("title", "Random article");
20 } else {
21 _lozenge()
22 }
23}
24
25window.onload = function () {
26 _lozenge()
27};
diff --git a/trunk/moongone.jpg b/trunk/moongone.jpg new file mode 100644 index 0000000..f49a75e --- /dev/null +++ b/trunk/moongone.jpg
Binary files differ
diff --git a/trunk/panorama-apollo11.jpg b/trunk/panorama-apollo11.jpg new file mode 100644 index 0000000..c56a109 --- /dev/null +++ b/trunk/panorama-apollo11.jpg
Binary files differ
diff --git a/trunk/river.lua b/trunk/river.lua new file mode 100644 index 0000000..4abb6d8 --- /dev/null +++ b/trunk/river.lua
@@ -0,0 +1,230 @@
1-- Pandoc River writer
2-- it takes out all formatting, leaving only a river of text
3-- running down the page: one word per line
4-- vim: fdm=marker
5-- invoke with: pandoc -t river.lua
6
7os.setlocale("en_US.UTF-8")
8
9local function flow(s)
10 return s:gsub("%s+", "\n")
11end
12
13local function nude(s)
14 -- Expand contractions
15 s = s:gsub("'%a+%s", function (x)
16 if x == "'ll" then
17 return " will "
18 elseif x == "'ve" then
19 return " have "
20 elseif x == "'re" then
21 return " are "
22 else
23 return x
24 end
25 end)
26 s = s:gsub("it's", "it is")
27 s = s:gsub("n't", " not ")
28 -- Get rid of quotes around words
29 s = s:gsub('"', ' ')
30 s = s:gsub("%s+'", ' ')
31 s = s:gsub("'%s+", ' ')
32 -- Remove HTML entities
33 s = s:gsub('&.-;', ' ')
34 s = s:gsub('%b<>', ' ')
35 -- Remove end-of-line backslashes
36 s = s:gsub('%s+\\$', ' ')
37 -- Remove dashes (not hyphens)
38 s = s:gsub('%-%-+', ' ')
39 s = s:gsub('%-%s', ' ')
40 -- Remove everything that is not letters or numbers
41 s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ')
42 -- Remove extra spaces
43 s = s:gsub('%s+', ' ')
44 return s:lower()
45end
46
47-- This function is called once for the whole document. Parameters:
48-- body is a string, metadata is a table, variables is a table.
49-- One could use some kind of templating
50-- system here; this just gives you a simple standalone HTML file.
51function Doc(body, metadata, variables)
52 local buffer = ""
53 local function add(s)
54 buffer = buffer .. nude(s) .. "\n"
55 end
56 if metadata['title'] then
57 add(metadata['title'])
58 end
59 if metadata['subtitle'] then
60 add(metadata['subtitle'])
61 end
62 -- TODO: epigraph.content, epigraph.attrib, dedication, other metadata?
63 add(body)
64 return flow(buffer)
65end
66
67-- Remove all formatting {{{
68function Note(s)
69 return nude(s)
70end
71
72function Blocksep()
73 return "\n"
74end
75function Emph(s)
76 return nude(s)
77end
78
79function Strong(s)
80 return nude(s)
81end
82
83function Subscript(s)
84 return nude(s)
85end
86
87function Superscript(s)
88 return nude(s)
89end
90
91function SmallCaps(s)
92 return nude(s)
93end
94
95function Strikeout(s)
96 return nude(s)
97end
98
99function Code(s, attr)
100 return nude(s)
101end
102
103function CodeBlock(s, attr)
104 return nude(s)
105end
106
107function InlineMath(s)
108 return nude(s)
109end
110
111function DisplayMath(s)
112 return nude(s)
113end
114
115function Span(s, attr)
116 return nude(s)
117end
118
119function Cite(s)
120 return nude(s)
121end
122
123function Plain(s)
124 return nude(s)
125end
126
127-- Links only include the link text
128function Link(s, src, tit)
129 return nude(s)
130end
131
132-- Images have nothing to give us
133-- (but add a space just in case)
134function Image(s, src, tit)
135 return "\n"
136end
137
138function CaptionedImage(s, src, tit)
139 return "\n"
140end
141
142function Str(s)
143 return nude(s)
144end
145
146function Div(s, attr)
147 return nude(s)
148end
149
150function Space(s)
151 return "\n"
152end
153
154function LineBreak()
155 return "\n"
156end
157
158function Para(s)
159 return nude(s)
160end
161
162function Header(lev, s, attr)
163 return nude(s)
164end
165
166function BlockQuote(s)
167 return nude(s)
168end
169
170function HorizontalRule()
171 return "\n"
172end
173
174function BulletList(items)
175 local buffer = ""
176 for _, item in pairs(items) do
177 buffer = buffer .. nude(item) .. "\n"
178 end
179 return buffer .. "\n"
180end
181
182function OrderedList(items)
183 local buffer = ""
184 for _, item in pairs(items) do
185 buffer = buffer .. nude(item) .. "\n"
186 end
187 return buffer .. "\n"
188end
189
190function DefinitionList(items)
191 local buffer = ""
192 for _, item in pairs(items) do
193 for k, v in pairs(item) do
194 buffer = buffer .. nude(k) .. "\n" .. nude(v) .. "\n"
195 end
196 end
197 return buffer .. "\n"
198end
199
200function Table(caption, aligns, widths, headers, rows)
201 local buffer = ""
202 local function add(s)
203 buffer = buffer .. nude(s) .. "\n"
204 end
205 if caption ~= "" then
206 add(caption)
207 end
208 for _,h in pairs(headers) do
209 add(h)
210 end
211 for _, row in pairs(rows) do
212 for _, cell in pairs(row) do
213 add(cell)
214 end
215 end
216 return buffer
217end
218-- }}}
219
220-- The following code will produce runtime warnings when you haven't defined
221-- all of the functions you need for the custom writer, so it's useful
222-- to include when you're working on a writer.
223local meta = {}
224meta.__index =
225 function(_, key)
226 io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))
227 return function() return "" end
228 end
229setmetatable(_G, meta)
230
diff --git a/trunk/tbedemugshot.jpg b/trunk/tbedemugshot.jpg new file mode 100644 index 0000000..0fd03b2 --- /dev/null +++ b/trunk/tbedemugshot.jpg
Binary files differ
diff --git a/trunk/white-streak.jpg b/trunk/white-streak.jpg new file mode 100644 index 0000000..318f654 --- /dev/null +++ b/trunk/white-streak.jpg
Binary files differ