soywiki 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -7,5 +7,4 @@ pkg/
7
7
  .rvmrc
8
8
  notes.txt
9
9
  *buffer
10
- website/
11
10
  wiki/
@@ -25,8 +25,8 @@ and refactor wiki content at the speed of thought.
25
25
 
26
26
  SoyWiki is good for tracking projects, contacts, ideas, and collecting
27
27
  and organizing research. SoyWiki combines the affordances of notebooks,
28
- index cards, and Post-it notes, and adds the power of hyperlinks and
29
- automatic indexing.
28
+ index cards, and Post-it notes, and adds to them the power of hyperlinks
29
+ and automatic indexing.
30
30
 
31
31
  SoyWiki makes a great writing aid, especially if you do your writing in
32
32
  Vim. You can have SoyWiki open in multiple Vim windows, tabs, and
@@ -35,13 +35,6 @@ of Vim abbreviations (`:help abbreviations`), a large monitor, and a
35
35
  teapot, and you'll have your paper, essay, book, or screenplay written
36
36
  in record time.
37
37
 
38
- You don't need to shell out $$ for tools like [Scrivener][scriv] if you
39
- appreciate how much more powerful Vim is for editing and navigating text
40
- and how liberating it is to be able to store your content in the
41
- non-proprietary, universal plain-text format. Proprietary tools and
42
- formats will come and go every few years, but the plain text file format
43
- and Vim are forever.
44
-
45
38
  SoyWiki is free and open source.
46
39
 
47
40
  [scriv]:http://www.literatureandlatte.com/scrivener.php
@@ -55,9 +48,7 @@ SoyWiki is free and open source.
55
48
 
56
49
  The current version of SoyWiki assumes a Unix environment.
57
50
 
58
- To use SoyWiki you should be fairly good at using Vim. More than 80
59
- percent of the SoyWiki codebase implements the VimScript interface
60
- layer.
51
+ To use SoyWiki you should be fairly good at using Vim.
61
52
 
62
53
  ## Installation
63
54
 
@@ -105,7 +96,7 @@ just run `soywiki`.
105
96
  For basic use, SoyWiki works exactly like a typical wiki.
106
97
 
107
98
  You write text, and when you want to create a new wiki page, you come up
108
- with a WikiWord for it and format it in CamelCase. The wiki-link you
99
+ with a WikiWord for it and format it in CamelCase. The WikiLink you
109
100
  just typed will automatically be syntax-highlighted, and pressing ENTER
110
101
  on it will take you to the new page. Creating WikiWords and pressing
111
102
  ENTER on them is the main way of linking wiki pages together. You'll be
@@ -116,16 +107,16 @@ That's all you need to know to get started.
116
107
 
117
108
  ## Wiki navigation
118
109
 
119
- Because SoyWiki is not just wiki but a Vim program, it lets you work a
120
- lot faster and with more economy than browser-based wikis.
110
+ Because SoyWiki is not just wiki but also a Vim program, it lets you
111
+ work a lot faster and with more economy than browser-based wikis.
121
112
 
122
113
  You can navigate a SoyWiki wiki very quickly with the following
123
114
  commands.
124
115
 
125
- * `CTRL-n` and `CTRL-p` move the cursor directly to the next or previous wiki-link on the page
126
- * `ENTER` follows the wiki-link under the cursor
127
- * `,f` follows the first wiki-link after the cursor
128
- * `,-` opens a wiki-link in a split window
116
+ * `CTRL-n` and `CTRL-p` move the cursor directly to the next or previous WikiLink on the page
117
+ * `ENTER` follows the WikiLink under the cursor
118
+ * `,f` follows the first WikiLink after the cursor
119
+ * `,-` opens a WikiLink in a split window
129
120
  * `,|` does the same, but in a vertical split window
130
121
 
131
122
  You can also use Vim's jump motions `CTRL-o` and `CTRL-i` to move back
@@ -158,10 +149,10 @@ window by putting the cursor at the beginning of a hyperlink and typing
158
149
  `gf`, or `C-w f` if you want to open the webpage in a split window. See
159
150
  `:help netrw` for more information.
160
151
 
161
- ## Wiki-link autocompletion
152
+ ## WikiLink autocompletion
162
153
 
163
154
  When you're writing a wiki page and you want to link to another page,
164
- SoyWiki can help you autocomplete your wiki-link. Press `CTRL-x CTRL-u`
155
+ SoyWiki can help you autocomplete your WikiLink. Press `CTRL-x CTRL-u`
165
156
  in Vim insert mode to invoke it.
166
157
 
167
158
 
@@ -257,16 +248,16 @@ But if you want, you can also namespace your WikiWords, like so:
257
248
 
258
249
  namespaced.WikiWord
259
250
 
260
- A namespaced WikiWord is a WikiWord prefixed by a namespace. The
261
- namespace word must start with a lower-case letter and consist
262
- only of letters, numbers, and underscore characters. You can't chain
263
- namespace words together: the maximum nesting level is 1.
251
+ A namespaced WikiWord is a WikiWord prefixed by a namespace and a
252
+ period. The namespace word must start with a lower-case letter and
253
+ consist only of letters, numbers, and underscore characters. You can't
254
+ chain namespace words together: the maximum nesting level is 1.
264
255
 
265
- Namespaced WikiWords help organize your conceptual wiki space. They also
256
+ Namespaced WikiWords help organize your wiki space conceptually. They also
266
257
  have two other benefits:
267
258
 
268
259
  First, wiki pages that represent a namespaced WikiWord are stored under a
269
- subdirectory named after the namespace. This can help reduce the clutter in
260
+ subdirectory named after the namespace. This can help reduce clutter in
270
261
  your wiki directory.
271
262
 
272
263
  Second, a WikiWord namespace lets you use abbreviated links within that
@@ -284,17 +275,19 @@ WikiLink autocompletion also works with abbreviated namespaced links. Just type
284
275
  period, and invoke autocompletion with `CTRL-x CTRL-u`.
285
276
 
286
277
 
287
- ## Expanding a Wiki page
278
+ ## Expanding a wiki page
288
279
 
289
- SoyWiki lets you render a wiki page in "expanded" form. What this does
290
- is expand all the wiki links on the page that appear alone on a line to
291
- include their content inline. This works recursively in all the included
292
- wiki pages (though it does not go into vicious circles because it only
293
- expands each link once).
280
+ SoyWiki lets you "expand" a wiki page. What this does is expand all the
281
+ wiki links in the page that appear alone on a line. Each of these links
282
+ is replaced by the content of the wiki page the link points to. This
283
+ expansion works recursively on all the expanded content. Don't worry.
284
+ It can't fall into an infinite recursive loop because it will only
285
+ expand each WikiWord it encounters once, leaving all subsequent
286
+ references to the same WikiWord unexpanded.
294
287
 
295
- The rendered page appears in a Vim scratch buffer. From there you can
296
- write it out to a new text file, pipe it to `lpr` to print it, or
297
- whatever you like.
288
+ The expanded version of the page will appear in a new Vim scratch buffer.
289
+ From there you can write it out to a new text file, pipe it to `lpr` to
290
+ print it, or whatever you like.
298
291
 
299
292
  There are two forms of expansion: seamful and seamless. Seamful
300
293
  expansion expands wiki links into wiki pages and clearly marks where
@@ -306,14 +299,14 @@ anything, and it erases the WikiWord that got expanded.
306
299
  * `,X` expands a wiki page seamlessly
307
300
 
308
301
  Both modes of expansion are useful when you want to assemble a long
309
- piece of writing by using one page as a master outline and linking from
310
- this to other wiki pages that include the real content. And since
311
- expansion is recursive, you can effectively nest outlines within
312
- outlines, like dreams within dreams.
302
+ piece of writing by using one page as a master outline that links to
303
+ other wiki pages that include the real content. And since expansion is
304
+ recursive, you can effectively nest outlines within outlines, like
305
+ dreams within dreams.
313
306
 
314
307
  ## Getting help
315
308
 
316
- Typing `,?` will open this webpage in a browser.
309
+ Typing `,?` will open the help webpage in a browser.
317
310
 
318
311
 
319
312
  ## Why CamelCase WikiLinks rule
@@ -323,10 +316,9 @@ pattern. But SoyWiki embraces it and wants everyone to adopt it, for the
323
316
  following reasons:
324
317
 
325
318
  * Besides being the original, CamelCase is the most elegantly minimalist approach to linking wiki pages together -- "with no additional markup whatsoever," as [Ward Cunningham put it][ward].
326
- * It encourages you more than other wiki link patterns to create wiki pages with succinctly descriptive names.
327
- * Because the link pattern is so minimal and succinct, inserting them in
328
- your notes interrupts your flow of
329
- thought a lot less than other wiki patterns.
319
+ * It encourages you more than other wiki link patterns to create wiki pages with succinctly descriptive names that are easy to remember.
320
+ * Because the link pattern is so minimal and succinct, writing
321
+ them interrupts your flow of thought a lot less than other wiki patterns.
330
322
  * It is very conducive to storing
331
323
  wiki pages in plain text files: the page names can map directly to Unix
332
324
  file names without any awkward character escaping.
data/Rakefile CHANGED
@@ -10,12 +10,8 @@ require 'soywiki'
10
10
  Bundler::GemHelper.install_tasks
11
11
 
12
12
  desc "build and push website"
13
- task :web do
14
- version = Soywiki::VERSION
15
- Dir.chdir("website") do
16
- puts "updating website"
17
- puts `./run.sh #{Soywiki::VERSION}`
18
- end
13
+ task :web => :build_webpage do
14
+ `scp website/soywiki.html zoe2@instantwatcher.com:~/danielchoi.com/public/software/`
19
15
  end
20
16
 
21
17
  desc "build website locally"
@@ -27,7 +27,7 @@ end
27
27
 
28
28
 
29
29
  module Soywiki
30
- VERSION = '0.0.3'
30
+ VERSION = '0.0.4'
31
31
  WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b|\.[A-Z][a-z]+[A-Z]\w*\b/
32
32
 
33
33
  def self.run
@@ -476,7 +476,7 @@ func! s:expand(seamless)
476
476
  echom "Expanding seamlessly. Please wait."
477
477
  let res = system(s:expand_command . " seamful " . bufname('%'))
478
478
  endif
479
- vertical botright new
479
+ split new
480
480
  setlocal buftype=nofile "scratch buffer for viewing; user can write
481
481
  silent! put =res
482
482
  silent! 1delete
@@ -0,0 +1 @@
1
+ images-original/
File without changes
@@ -0,0 +1,19 @@
1
+ require 'liquid'
2
+ require 'rdiscount'
3
+
4
+ module Webpage
5
+ def self.generate(version)
6
+ screenshots = RDiscount.new(File.read("top.screenshots")).to_html
7
+ readme = File.expand_path("../../README.markdown", __FILE__)
8
+ raise "no README" unless File.size?(readme)
9
+ md = File.read(readme).split(/^\s*$/)
10
+ headers = md.grep(/## Prerequisites/)
11
+ insert_at = md.index headers.first
12
+ md.insert(insert_at, screenshots)
13
+ md = md.join("\n\n")
14
+ # for some reason markdown inserts extra blank lines
15
+ content = RDiscount.new(md).to_html.gsub(/\n\n{3,}/, "\n\n")
16
+ template = File.read("soywiki-template.html")
17
+ out = Liquid::Template.parse(template).render 'content' => content, 'timestamp' => Time.now.to_i, 'version' => version
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ #lightbox{ position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;}
2
+ #lightbox img{ width: auto; height: auto;}
3
+ #lightbox a img{ border: none; }
4
+
5
+ #outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; }
6
+ #imageContainer{ padding: 10px; }
7
+
8
+ #loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; }
9
+ #hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; }
10
+ #imageContainer>#hoverNav{ left: 0;}
11
+ #hoverNav a{ outline: none;}
12
+
13
+ #prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; }
14
+ #prevLink { left: 0; float: left;}
15
+ #nextLink { right: 0; float: right;}
16
+ #prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; }
17
+ #nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; }
18
+
19
+ #imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100% ; }
20
+
21
+ #imageData{ padding:0 10px; color: #666; }
22
+ #imageData #imageDetails{ width: 70%; float: left; text-align: left; }
23
+ #imageData #caption{ font-weight: bold; }
24
+ #imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; }
25
+ #imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;}
26
+
27
+ #overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; }
@@ -0,0 +1,63 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
4
+ <head>
5
+
6
+ <title>Lightbox JS v2.0 | Test Page</title>
7
+
8
+ <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
9
+
10
+ <script src="js/prototype.js" type="text/javascript"></script>
11
+ <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
12
+ <script src="js/lightbox.js" type="text/javascript"></script>
13
+
14
+ <style type="text/css">
15
+ body{ color: #333; font: 13px 'Lucida Grande', Verdana, sans-serif; }
16
+ </style>
17
+
18
+ </head>
19
+ <body>
20
+
21
+
22
+ <h1><a href="http://www.lokeshdhakar.com/projects/lightbox2/">Lightbox JS <em>v2.04</em></a></h1>
23
+ <p><a href="http://www.lokeshdhakar.com">by Lokesh Dhakar</a></p>
24
+
25
+ <h2>Example</h2>
26
+
27
+ <a href="images/image-1.jpg" rel="lightbox"><img src="images/thumb-1.jpg" width="100" height="40" alt="" /></a>
28
+
29
+
30
+
31
+
32
+ <h2>How to Use:</h2>
33
+ <h3>Part 1 - Setup</h3>
34
+ <ol>
35
+ <li>Lightbox v2.0 uses the Prototype Framework and Scriptaculous Effects Library. You will need to include these three Javascript files in your header.
36
+ <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;js/prototype.js&quot;&gt;&lt;/script&gt;
37
+ &lt;script type=&quot;text/javascript&quot; src=&quot;js/scriptaculous.js?load=effects,builder&quot;&gt;&lt;/script&gt;
38
+ &lt;script type=&quot;text/javascript&quot; src=&quot;js/lightbox.js&quot;&gt;&lt;/script&gt;
39
+ </code></pre>
40
+ </li>
41
+ <li>Include the Lightbox CSS file (or append your active stylesheet with the Lightbox styles).
42
+ <pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;css/lightbox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
43
+ </code></pre>
44
+ </li>
45
+ <li>Check the CSS and make sure the referenced <code>prevlabel.gif</code> and <code>nextlabel.gif</code> files are in the right location. Also, make sure the <code>loading.gif</code> and <code>closelabel.gif</code> files as referenced near the top of the <code>lightbox.js</code> file are in the right location.</li>
46
+ </ol>
47
+ <h3>Part 2 - Activate</h3>
48
+ <ol>
49
+ <li>Add a <code>rel="lightbox"</code> attribute to any link tag to activate the lightbox. For example:
50
+ <pre><code>&lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox&quot; title=&quot;my caption&quot;&gt;image #1&lt;/a&gt;
51
+ </code></pre>
52
+ <em>Optional: </em>Use the <code>title</code> attribute if you want to show a caption. </li>
53
+ <li>If you have a set of related images that you would like to group, follow step one but additionally include a group name between square brackets in the rel attribute. For example:
54
+ <pre><code>&lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #1&lt;/a&gt;
55
+ &lt;a href=&quot;images/image-2.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #2&lt;/a&gt;
56
+ &lt;a href=&quot;images/image-3.jpg&quot; rel=&quot;lightbox[roadtrip]&quot;&gt;image #3&lt;/a&gt;
57
+ </code></pre>
58
+ No limits to the number of image sets per page or how many images are allowed in each set. Go nuts!</li>
59
+ </ol>
60
+
61
+
62
+ </body>
63
+ </html>
@@ -0,0 +1,136 @@
1
+ // script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
2
+
3
+ // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
+ //
5
+ // script.aculo.us is freely distributable under the terms of an MIT-style license.
6
+ // For details, see the script.aculo.us web site: http://script.aculo.us/
7
+
8
+ var Builder = {
9
+ NODEMAP: {
10
+ AREA: 'map',
11
+ CAPTION: 'table',
12
+ COL: 'table',
13
+ COLGROUP: 'table',
14
+ LEGEND: 'fieldset',
15
+ OPTGROUP: 'select',
16
+ OPTION: 'select',
17
+ PARAM: 'object',
18
+ TBODY: 'table',
19
+ TD: 'table',
20
+ TFOOT: 'table',
21
+ TH: 'table',
22
+ THEAD: 'table',
23
+ TR: 'table'
24
+ },
25
+ // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
26
+ // due to a Firefox bug
27
+ node: function(elementName) {
28
+ elementName = elementName.toUpperCase();
29
+
30
+ // try innerHTML approach
31
+ var parentTag = this.NODEMAP[elementName] || 'div';
32
+ var parentElement = document.createElement(parentTag);
33
+ try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
34
+ parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
35
+ } catch(e) {}
36
+ var element = parentElement.firstChild || null;
37
+
38
+ // see if browser added wrapping tags
39
+ if(element && (element.tagName.toUpperCase() != elementName))
40
+ element = element.getElementsByTagName(elementName)[0];
41
+
42
+ // fallback to createElement approach
43
+ if(!element) element = document.createElement(elementName);
44
+
45
+ // abort if nothing could be created
46
+ if(!element) return;
47
+
48
+ // attributes (or text)
49
+ if(arguments[1])
50
+ if(this._isStringOrNumber(arguments[1]) ||
51
+ (arguments[1] instanceof Array) ||
52
+ arguments[1].tagName) {
53
+ this._children(element, arguments[1]);
54
+ } else {
55
+ var attrs = this._attributes(arguments[1]);
56
+ if(attrs.length) {
57
+ try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
58
+ parentElement.innerHTML = "<" +elementName + " " +
59
+ attrs + "></" + elementName + ">";
60
+ } catch(e) {}
61
+ element = parentElement.firstChild || null;
62
+ // workaround firefox 1.0.X bug
63
+ if(!element) {
64
+ element = document.createElement(elementName);
65
+ for(attr in arguments[1])
66
+ element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
67
+ }
68
+ if(element.tagName.toUpperCase() != elementName)
69
+ element = parentElement.getElementsByTagName(elementName)[0];
70
+ }
71
+ }
72
+
73
+ // text, or array of children
74
+ if(arguments[2])
75
+ this._children(element, arguments[2]);
76
+
77
+ return element;
78
+ },
79
+ _text: function(text) {
80
+ return document.createTextNode(text);
81
+ },
82
+
83
+ ATTR_MAP: {
84
+ 'className': 'class',
85
+ 'htmlFor': 'for'
86
+ },
87
+
88
+ _attributes: function(attributes) {
89
+ var attrs = [];
90
+ for(attribute in attributes)
91
+ attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
92
+ '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;') + '"');
93
+ return attrs.join(" ");
94
+ },
95
+ _children: function(element, children) {
96
+ if(children.tagName) {
97
+ element.appendChild(children);
98
+ return;
99
+ }
100
+ if(typeof children=='object') { // array can hold nodes and text
101
+ children.flatten().each( function(e) {
102
+ if(typeof e=='object')
103
+ element.appendChild(e)
104
+ else
105
+ if(Builder._isStringOrNumber(e))
106
+ element.appendChild(Builder._text(e));
107
+ });
108
+ } else
109
+ if(Builder._isStringOrNumber(children))
110
+ element.appendChild(Builder._text(children));
111
+ },
112
+ _isStringOrNumber: function(param) {
113
+ return(typeof param=='string' || typeof param=='number');
114
+ },
115
+ build: function(html) {
116
+ var element = this.node('div');
117
+ $(element).update(html.strip());
118
+ return element.down();
119
+ },
120
+ dump: function(scope) {
121
+ if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
122
+
123
+ var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
124
+ "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
125
+ "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
126
+ "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
127
+ "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
128
+ "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
129
+
130
+ tags.each( function(tag){
131
+ scope[tag] = function() {
132
+ return Builder.node.apply(Builder, [tag].concat($A(arguments)));
133
+ }
134
+ });
135
+ }
136
+ }