| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 14 Jan 2026 23:55:07 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20101213095339
location: https://web.archive.org/web/20101213095339/https://markaby.github.com/
server-timing: captures_list;dur=0.546039, exclusion.robots;dur=0.041673, exclusion.robots.policy;dur=0.031073, esindex;dur=0.010823, cdx.remote;dur=48.085751, LoadShardBlock;dur=207.567553, PetaboxLoader3.datanode;dur=166.323621
x-app-server: wwwb-app218-dc8
x-ts: 302
x-tr: 277
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app218; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 14 Jan 2026 23:55:08 GMT
content-type: text/html
x-archive-orig-server: nginx/0.7.67
x-archive-orig-date: Mon, 13 Dec 2010 09:53:39 GMT
x-archive-orig-content-length: 5335
x-archive-orig-last-modified: Thu, 19 Aug 2010 04:26:31 GMT
x-archive-orig-connection: close
x-archive-orig-expires: Tue, 14 Dec 2010 09:53:39 GMT
x-archive-orig-cache-control: max-age=86400
x-archive-orig-accept-ranges: bytes
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 13 Dec 2010 09:53:39 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: alexa-web-20110622061933-00008/52_19_20101213094137_crawl101.arc.gz
server-timing: captures_list;dur=0.510792, exclusion.robots;dur=0.020690, exclusion.robots.policy;dur=0.009144, esindex;dur=0.009436, cdx.remote;dur=14.834807, LoadShardBlock;dur=197.891070, PetaboxLoader3.datanode;dur=209.341189, PetaboxLoader3.resolve;dur=109.810834, load_resource;dur=225.969863
x-app-server: wwwb-app218-dc8
x-ts: 200
x-tr: 467
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
_why's Markaby
_why's Markaby
You know that WebPage code I’ve been playing with lately? Tim Fletcher e-mailed me a revamped version, a plugin for Rails. We’ve gone back and forth on this and found a very satisfying resting point, which I’m calling Markaby. Markup as Ruby. To install in your Rails app: script/plugin install https://code.whytheluckystiff.net/svn/markaby/trunk To use it, add templates with a .mab extension. Examples For example, an app/views/layout/application.mab could look like:
html do
head do
title action_name
stylesheet_link_tag 'scaffold'
end
body do
p flash[:notice], :style => "color: green"
self << @content_for_layout
end
end
As you can see all the normal helpers and variables are present. There is one caveat: in default Markaby, helper methods are automatically output when called. So, in the above, the stylesheet_link_tag gets output. (To turn that off, use @output_helpers = false.)
A scaffolding page could look like this (app/views/products/list.mab):
h1 'Listing products'
table.editor.classic do
tr do
for column in Product.content_columns
th column.human_name
end
end
for product in @products
tr do
for column in Product.content_columns
td product.send(column.name)
end
td { link_to 'Show', :action => 'show', :id => product }
td { link_to 'Edit', :action => 'edit', :id => product }
td { link_to 'Destroy', { :action => 'destroy', :id => product }, :confirm => 'Are you sure?' }
end
end
end
link_to 'Previous page', { :page => @product_pages.current.previous } if @product_pages.current.previous
link_to 'Next page', { :page => @product_pages.current.next } if @product_pages.current.next
br
link_to 'New product', :action => 'new'
As you can see classes can be assigned just like in previous experiments. The table.editor.classic gets output as <table class="editor classic">.
One really wonderfully trippy thing about Markaby is that you can use capture to treat elements as strings, if you like. This satisfies one of Dgtized’s feature requests from a few days ago.
div.menu do
%w[5.gets bits inspect cult -h].map do |m|
capture { link_to m, "/#{m}" }
end.join(" | ")
end
So, in the above example, the output of link_to is captured for each element of the array and then patched together with pipes between. But how does it get output to div.menu?
The rule is: each element with a block opens a new buffer. You can fill up that buffer by printing elements to it. Or by returning a string from the block.
Markup Shortcuts
Really, there’s not much more to this at present. For example, RedCloth support isn’t built in, nor is the auto-header and auto-body stuff from WebPage.
Just a few shortcuts:
- img tags will default to :alt => '', :border => 0.
- head automatically includes tag!(:meta, 'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8').
- html defaults to an xml instruction, the XHTML 1.0 Transitional doctype and :xmlns => "https://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en" on the html element.
- xhtml_transitional is an alias for html.
- xhtml_strict does the same, but with the proper XHTML 1.0 Strict doctype and so on.
github.com/markaby/markaby
_why's Markaby
github.com/whymirror
Decentralizing _why's code projects
Thanks to github.com/mojombo for the swanky HTML layout.