/
index.html
140 lines (109 loc) · 9.44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<h1>oBloq literate programming tool</h1>
<p>oBloq is a system designed to solve several problems I've encountered in years of developing complex web sites and web applications. One problem is getting the system documented well. I've experimented with literate programming languages before, but none of them seemed like a good fit for web programming. Another, and possibly more pressing problem, is locality of reference. What I mean is how to keep related code close together when it is scattered across HTML, CSS, Javascript, database, server-side controllers, etc. Relatedly, how do we develop a consistent vocabulary between all of the participants in a project, as well as all the components of the project? Another nice to have would be to gather this all in a text-based format that is easily diff'd and kept in version control.</p>
<p>That might sound like a lot to ask for one tool, but oBloq is standing on the shoulders of giants. By leveraging Node.js, Markdown formatting, Stylus for CSS, and JSON it can organize all the relevant information for your web site or webapp, including wireframes, in a simple, readable text format. It can easily be extended to support the tools of your choice (it already supports Coffeescript in addition to Javascript, and Mustache for templates). oBloq works best if design and development is based on CSS more than on Photoshop, but it can work either way.</p>
<p>oBloq isn't finished. I am working to add support for visually testing layouts and modules, a tool for watching files and rebuilding them as needed, and a server for distributed editing of the oBloq files. It's already handy for creating documentation and extracting the files needed to build an app. Soon it will also support concatenating and compressing the resulting files for production, as well as control over how the files are build (building different production files for editing than for viewers, for instance). Development is progressing quickly and I am currently seeking feedback on the ideas captured in oBloq.</p>
<h2>About the name</h2>
<p>oBloq was developed around the idea of "card-based programming," which is that most web sites and web applications have roughly modular, often rectangular types of content which can be designed and assembled as components. These are then, "bloqs." Also, it reminds me of the great Dr. Seuss book on web programming, "Bartholemew and the Ooblek."</p>
<h2>How to use oBloq</h2>
<p>Rewrite this section.</p>
<h2>Dependencies</h2>
<p>Rewrite this section</p>
<h2>Text-based wireframes</h2>
<p>Code blocks whose file extension is .sketch are preserved and converted in-browser. Other types are formatted in-browser for syntax highlighting, but .sketch blocks are converted to line drawings using Raphael.js and a plugin for Raphael called Sketchy.js. Sketchy lets you draw line which are rough and resemble hand-drawn (and not with a particularly steady hand) and is still in development in parallel with oBloq, but the commands recognized in oBloq at the time of writing this are below. Arguments x, y, w, and h are all assumed to be integers, text is any string following them. Text strings do not have to be quoted. The offset of strings is a little wonky, that's something I'm looking into. Comments are not supported by the sketchy syntax, but #comments below are used to describe the results.</p>
<pre><code>size w h # REQUIRED, sets the size of the canvas to sketch into. I plan to make this calculated from the sketch commands at some point.
line x1 y1 x2 y2 # draws a line from the point x1 y2 to the point x2 y2
arrow x1 y1 x2 y2 # like line, but puts an arrowhead at x2 y2
rect x y w h text # draws a rectangle with its upper-left-hand corner at x y and the dimensions w h. The text argument is optional and will be centered in the rectangle.
img x y w h # draws a rect with an x across it, to represent an image
ellipse x y w h text # draws an ellipse inside the rect described by x y w h, optionally with text centered in the ellipse
crossellipse x y w h # draws an ellipse, and a cross inside it. Useful for things like close buttons
fatarrowright x y w h # draws an outlined arrow to fit inside the rect defined by x y w h
fatarrowleft x y w h
fatarrowdown x y w h
fatarrowup x y w h
triangleright x y w h # draws a triangle pointing right, useful for disclosure triangles
triangleleft x y w h
triangledown x y w h
triangleup x y w h
text x y text # draws text centered on x y in the "dadhand" handwriting font
ltext x y text # draws text left justified starting at x y
rtext x y text # draws text right justified and ending at x y
avatar x y w h # draws a rectangle with a very rough sketch of a person. Needs work.
</code></pre>
<p>For example:</p>
<pre><code class="text">size 400 200
img 10 10 180 180
text 300 10 Title
rect 210 30 180 100 Article
rect 210 110 180 80 Article
</code></pre>
<p>becomes</p>
<pre><code class="sketch">size 400 200
img 10 10 180 180
text 300 10 Title
rect 210 30 180 100 Article
rect 210 110 180 80 Article
</code></pre>
<h2>Other uses</h2>
<p>There is no specific support, but oBloq can be used to document Ajax paths, URL patterns, Events generated or listened for, APIs, permissions, reasons for hacks and work-arounds, problems encountered, etc. Essentially, all development-related documentation (and most code) should be able to be fit into readable oBloq documents. I haven't used it for server-side development yet, but see no overwhelming reason not to do so (especially if the server uses Node.js). For any documentation which does not fit into a language that oBloq supports, it can kept in plain Markdown, or oBloq can be extended to support the language</p>
<h2>Todo</h2>
<h3>oBloq 2.0</h3>
<ul>
<li>Allow raw HTML, CSS, JS files to be in bloqs directory?</li>
<li>Build an editor based on CodeMirror (<a href="http://codemirror.net/doc/manual.html">http://codemirror.net/doc/manual.html</a>)</li>
<li>Minimized and compress concatenated files for production (side-effect of moving to Grunt)</li>
<li>Support coffeescript on server-side (side-effect of multiple targets, better specificity)</li>
<li>More example code</li>
<li>Comment extracted code to show where it was extracted from, for tracing back to source file</li>
<li>Code clean up and commenting</li>
<li>Allow mustache placeholders to be used in markdown for template generation (*.mushdown?)</li>
<li>Include useful snippets of HTML, CSS, JS to be assembled as standard components (with commentary on use)</li>
<li>Componentization - use x-tag (<a href="http://csuwldcat.github.com/x-tag/">http://csuwldcat.github.com/x-tag/</a>) or Enyo (<a href="http://enyojs.com/">http://enyojs.com/</a>) to help define bloqs?</li>
</ul>
<h3>Generated docs</h3>
<ul>
<li>Build list of classes used and in which bloqs (need to parse html templates)</li>
<li>Build list of IDs used and in which bloqs (ditto)</li>
<li>Build list of events emitted and in which bloqs (need to parse JS: use Escrima?)</li>
<li>Build list of events listened for and in which bloqs (ditto)</li>
<li>Build list of functions defined and in which bloqs (ditto)</li>
<li>Build list of functions called? (ditto)</li>
<li>Syntax highlighting (stylus was missing)</li>
</ul>
<h3>Testing</h3>
<ul>
<li>Validate / lint / hint all files (side effect of moving to Grunt)</li>
<li>Build visual tests into the docs, including tools to check with various data (for overflow), state (loggged in?), and block size (for responsive design). Seeing the visual tests update while you're in the oBloq editor would be pretty nifty.</li>
</ul>
<h3>Sketchy</h3>
<ul>
<li>Fix offset of text in sketchy</li>
<li>Different units for sketches (grid-based?)</li>
<li>Convert sketchy to build dom objects for layout where applicable</li>
<li>Determine sketch size automatically from content (this would avoid the need to give room for sketchy lines to overflow, done manually now</li>
<li>Reduce the "nudge" factor in small sketches</li>
<li>Smoothing: keep each point's nudge factor within 2px of last nudge</li>
<li>Make sketch components clickable links to docs for those items (interpage linking)</li>
<li>New component: rich text</li>
<li>New component: text</li>
<li>New component: tab view</li>
<li>New component: social noise</li>
<li>New component: video player</li>
</ul>
<h3>To-dones</h3>
<ul>
<li>√ Sketches not showing up</li>
<li>√ Allow user configuration for which files get concatenated, minimized, and compressed and in what order (side-effect of Grunt)</li>
<li>√ Generate links to documentation automatically</li>
<li>√ Have default filename targets</li>
<li>√ Make client vs. server code explicit rather than a naming convention. Default to both?</li>
<li>√ Allow alternate filename targets in comments</li>
<li>√ Convert to be an extension of Grunt (<a href="https://github.com/cowboy/grunt">https://github.com/cowboy/grunt</a>) (mainly the code extraction from markdown)</li>
<li>√ Allow multiple filename targets</li>
<li>√ Watch command to re-run extraction whenever a source file is changed</li>
<li>√ Package as a Node module</li>
<li>√ Gather all extracted *.js and *.css files into concatenated files</li>
<li>√ Include files global.stylus (deferred: or bloqs/global/*.stylus) when processing other stylus files (for definitions of site-wide variables for things like colours and fonts)</li>
<li>√ Include files global.markdown (deferred: or bloqs/global/*.markdown) when processing other markdown files (for link definitions)</li>
</ul>
<script src="http://dethe.github.com/obloq/lib/loader.js"></script>