Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Prototyping 3 — Data
Search
Florian Plank
June 12, 2012
Programming
2
170
Prototyping 3 — Data
Brief overview over YAML and how to use it within a prototype for I18n and other purposes.
Florian Plank
June 12, 2012
Tweet
Share
More Decks by Florian Plank
See All by Florian Plank
Ready, set, immersion!
polarblau
0
160
Prototyping all the things
polarblau
2
160
CoffeeScript vs. ECMAScript 6
polarblau
5
3.4k
Design for a complex Reality — Siili Breakfast Edition
polarblau
0
120
Enabling Design for a Complex Reality
polarblau
2
120
A primer on Content Security Policy
polarblau
1
380
Rails and the future of the open web
polarblau
3
110
Brief Ruby/Ruby on Rails intro
polarblau
3
160
Ruby Idioms
polarblau
3
550
Other Decks in Programming
See All in Programming
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.4k
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
120
[JAWS DAYS 2025] 最近の DB の競合解決の仕組みが分かった気になってみた
maroon1st
0
130
Learning Kotlin with detekt
inouehi
1
140
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
230
2025.2.14_Developers Summit 2025_登壇資料
0101unite
0
200
5分で理解する SOLID 原則 #phpcon_nagoya
shogogg
1
330
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
170
CloudNativePGを布教したい
nnaka2992
0
120
負債になりにくいCSSをデザイナとつくるには?
fsubal
10
2.6k
Generating OpenAPI schema from serializers throughout the Rails stack - Kyobashi.rb #5
envek
1
390
もう少しテストを書きたいんじゃ〜 #phpstudy
o0h
PRO
18
4.1k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
How STYLIGHT went responsive
nonsquared
98
5.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
260
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Git: the NoSQL Database
bkeepers
PRO
427
65k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Transcript
Prototyping in the browser
III / Data
CONTENT
XML
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
“XML is like violence. — If it hasn’t solved your
problem, you’re not using enough of it.”
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?><books><book id="1"><title>Pride and Prejudice</title><author>Jane Austen</author></book><book id="2"><title>Brave New
World</title><author>Aldous Huxley</author></book></ books>
Length? => 216 Content length? => 60 Markup / Content
ratio? => 2.6:1
JSON
{ "books": { "book": [ { "id": 1, "title ":
" Pride and Prejudice", "author ": " Jane Austen" }, { "id": 2, "title": "Brave New World", "author": "Aldous Huxley" } ] } }
{ "books": { "book": [ { "id": 1, "title ":
"Pride and Prejudice", "author ": "Jane Austen" }, { "id": 2, "title": "Brave New World", "author": "Aldous Huxley" } ] } }
Length? => 148 Content length? => 60 Markup / Content
ratio? => 1.5:1
YAML
YAML Ain’t Markup Language* * recursive acronym
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
Length? => 139 (including whitespace and header) Content length? =>
60 Markup / Content ratio? => 1.3:1
I18n / serve
require File.join(File.dirname(__FILE__), 'lib', 'nested_ostruct')
require 'active_support/inflector' I18n.load_path = Dir['locale/**/*.yml'] I18n.reload!
module ViewHelpers # … def list(key, &block) data = t(key).clone
rescue {} raise data if data =~ /translation missing/ data = NestedOstruct.import(data) raise data unless data.is_a? Array data.each {|i| yield i } end def t(key, args={}) I18n.t(key, args) end end
--- en: foo: bar: Bat
#container %h2= t 'foo.bar'
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
#container %ul - list 'books' do |book| %li %strong= book.title
= "(#{book.author})"
<ul> <li> <strong>Pride and Prejudice</strong> (Jane Austen) </li> <li> <strong>Brave
New World</strong> (Aldous Huxley) </li> </ul>
PROTOTYPES