Permalink
Browse files

renewal

  • Loading branch information...
1 parent 25e32a5 commit 05d86930cf9d4baad57c621e56048d586fbfa531 @frsyuki frsyuki committed Jul 1, 2013
Showing with 728 additions and 751 deletions.
  1. +409 −368 css/all.css
  2. BIN images/intro.png
  3. BIN images/treasuredata.png
  4. +73 −378 index.html
  5. +133 −0 index.html.erb
  6. +14 −5 js/all.js
  7. +99 −0 update-index.rb
View
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
View
@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="keywords" content="MessagePack, msgpack, JSON, Binary JSON, Serializer, Serialization" />
+ <link href='favicon.ico' rel='icon' type='image/x-icon'/>
+
+ <title>MessagePack: It's like JSON. but fast and small.</title>
+
+ <!--[if lt IE 9]><script type="text/javascript" src="http://html5shim.googlecode.com/svn/trunk/html5.js" ></script><![endif]-->
+ <link media="all" rel="stylesheet" type="text/css" href="css/yuibase.css" />
+ <link media="all" rel="stylesheet" type="text/css" href="js/prettify/prettify.css" />
+ <link media="all" rel="stylesheet" type="text/css" href="css/all.css" />
+ <link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,200' rel='stylesheet' type='text/css'>
+ <script type="text/javascript" src="js/all.js" ></script>
+ <script type="text/javascript" src="js/prettify/prettify.js" ></script>
+</head>
+<body onload="prettyPrint();changeQuickStart(document.getElementsByClassName('qs')[0].id,document.getElementsByClassName('qs-a')[0])">
+ <header>
+ <div>
+ <h1><a href="/">MessagePack</a></h1>
+ <nav id="topnav">
+ <ul>
+ <li><a href="https://github.com/msgpack">GitHub</a></li>
+ <li><a href="http://wiki.msgpack.org/display/MSGPACK/Format+specification">Spec</a></li>
+ <li><a href="http://twitter.com/search/MessagePack%20OR%20msgpack">#msgpack</a></li>
+ </ul>
+ </nav>
+ </div>
+ </header>
+
+ <main>
+ <section id="introduction">
+ <div id="description">
+ <h2>It's like JSON.<br />but fast and small.</h2>
+ <p>MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small integers are encoded into a single byte, and typical short strings require only one extra byte in addition to the strings themselves.</p>
+ <!--<p>Best for memcached, and network protocol aiming for performance and loosly-coupling.</p>-->
+ </div>
+
+ <div id="next">
+ <h3>Next:</h3>
+ <p>MessagePack has new spec! See <a href="https://gist.github.com/frsyuki/5432559">MessagePack update proposal v5</a> for the spec and migration plan.<br />See <a href="https://github.com/msgpack/msgpack/issues/128">github issue 128</a> for discussion.</p>
+ </div>
+ </section>
+
+ <section id="usecases">
+ <div id="testimonials">
+ <div class="tmset">
+ <div class="tm">
+ <a class="tmlogo" href="http://redis.io/"><img src="images/redis.png" alt="Redis" width="150" height="50" /></a>
+ <p class="tmtext">Redis scripting has support for MessagePack because it is a fast and compact serialization format with a simple to implement specification. I liked it so much that I implemented a MessagePack C extension for Lua just to include it into Redis.</p>
+ <p class="tmauthor">Salvatore Sanfilippo, creator of Redis</p>
+ </div>
+
+ <div class="tm">
+ <a class="tmlogo" href="http://fluentd.org/" style="height:131px;margin-top:-66px;"><img src="images/fluentd.png" alt="Fluentd" width="240" height="122" /></a>
+ <p class="tmtext">Fluentd uses MessagePack for all internal data representation. It's crazy fast because of zero-copy optimization of msgpack-ruby. Now MessagePack is an essential component of Fluentd to achieve high performance and flexibility at the same time.</p>
+ <p class="tmauthor">Sadayuki Furuhashi, creator of Fluentd</p>
+ </div>
+ </div>
+
+ <div class="tmset">
+ <div class="tm">
+ <a class="tmlogo" href="http://treasure-data.com/"><img src="images/treasuredata.png" alt="Treasure Data" width="272" height="54" /></a>
+ <p class="tmtext">Treasure Data built a multi-tenant database optimized for analytical queries using MessagePack. The schemaless database is growing by billions of records every month. We also use MessagePack as a glue between components. Actually we just wanted a fast replacement of JSON, and MessagePack is simply useful.</p>
+ <p class="tmauthor">Kazuki Ohta, CTO</p>
+ </div>
+
+ <div class="tm">
+ <a class="tmlogo" href="http://pinterest.com/"><img src="images/pinterest.png" alt="Pinterest" width="197" height="50" /></a>
+ <p class="tmtext">MessagePack has been simply invaluable to us. We use MessagePack + Memcache to cache many of our feeds on Pinterest. These feeds are compressed and very quick to unpack thanks to MessagePack while Memcache gives us fast atomic pushes.</p>
+ <p class="tmauthor">Marty Weiner, Software Engineer</p>
+
+ <p class="tmcontribute">Also use MessagePack? <a href="https://github.com/msgpack/website">Waiting for your testimonial!</a></p>
+ </div>
+ </div>
+ </div>
+
+ <div id="twitter">
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/search?q=msgpack+OR+MessagePack" data-widget-id="343624208380735490" width="350" height="500">Tweets about "msgpack OR MessagePack"</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ <!--
+ -->
+ </div>
+ </section>
+
+ <section id="usage">
+ <div id="languages">
+ <h3>Languages</h3>
+
+ <ul class="qslist">
+ <% @repos.each do |repo| %>
+ <li><a class="qs-a" onclick="changeQuickStart('qs-<%= repo['id'] %>',this)"><%= repo['lang'] %> <span class="qs-sub"><%= repo['owner'] %></span></a></li>
+ <% end %>
+ </ul>
+ </div>
+
+ <div id="api">
+ <h3>API</h3>
+ <h4 id="language">&nbsp;</h4>
+ <div id="quickstart" class="qsholder"></div>
+ <p id="quickstart-guide">Add 'msgpack.org[LANG]' at the end of description of a github repository to list your code here!</p>
+
+ <% @repos.each_with_index do |repo,i| %>
+ <div id="qs-<%= repo['id'] %>" class="qs"><h4><a href="<%= repo['url'] %>" target="_blank"><%= repo['owner'] %>/<%= repo['name'] %> <span class="qs-url"><%= repo['url'] %></a></li></h4>
+<%= repo['quickstart_html'] %>
+ </div>
+ <% end %>
+ </div>
+ </section>
+
+ <section id="related">
+ <h3>Related projects</h3>
+
+ <div class="paragraphs">
+ <h4><a href="https://github.com/dotcloud/zerorpc-python">ZeroRPC</a> by DotCloud</h4>
+ <p>zerorpc is a flexible RPC implementation based on zeromq and messagepack. Service APIs exposed with zerorpc are called "zeroservices".</p>
+
+ <h4><a href="https://github.com/pfi/pficommon">pficommon</a> by Preferred Infrastructure, Inc.</h4>
+ <p>General purpose C++ library for Preferred Infrastructure, Inc. It includes MessagePack-RPC implementation for C++</p>
+ </div>
+
+ </section>
+ </main>
+
+ <footer>
+ <div>
+ <div id="thanks">
+ <p>MessagePack &trade; Copyright &copy; 2008-2013 Sadayuki Furuhashi</p>
+ </div>
+ </div>
+ </footer>
+</body>
View
@@ -1,20 +1,29 @@
-function changeQuickStart(name, selected) {
+function changeQuickStart(targetId, selected) {
var holder = document.getElementById("quickstart");
- var target = document.getElementById(name);
+ var title = document.getElementById("language");
+ var target = document.getElementById(targetId);
+
if(target == null) {
return false;
}
- /* remove all elements from the holder */
+ /* remove all elements from the holder and title */
var lastChild;
while((lastChild = holder.lastChild) != null) {
holder.removeChild(lastChild);
}
+ while((lastChild = title.lastChild) != null) {
+ title.removeChild(lastChild);
+ }
- /* copy all elements from the target to the holder */
var children = target.childNodes;
var childrenLength = children.length;
- for(var i=0; i < childrenLength; i++) {
+
+ /* copy first element from target to title */
+ title.appendChild(children[0].cloneNode(true));
+
+ /* copy remaining elements from target to holder */
+ for(var i=1; i < childrenLength; i++) {
holder.appendChild(children[i].cloneNode(true));
}
View
@@ -0,0 +1,99 @@
+require 'rest-client'
+require 'json'
+require 'cgi'
+require 'time'
+require 'nokogiri'
+#require 'github/markup'
+require 'erb'
+
+here = File.dirname(__FILE__)
+
+REPO_DESC_MATCH = /msgpack\.org\[([^\]]+)\]/
+
+DOC_FILES = %w[msgpack.org.md README.md README.rdoc README.rst README]
+
+def github_search(keyword, &callback)
+ url = "https://api.github.com/legacy/repos/search/#{CGI.escape(keyword)}"
+ page = 1
+ while true
+ js = RestClient.get(url, :params=>{'start_page'=>page})
+ repos = JSON.parse(js)['repositories']
+ break if repos.empty?
+ repos.each(&callback)
+ page += 1
+ end
+end
+
+def get_quickstart_html(repo_url)
+ DOC_FILES.each {|fname|
+ begin
+ if fname.include?('.')
+ data = RestClient.get("#{repo_url}/blob/master/#{fname}")
+ html = Nokogiri::HTML(data).css('.file')[0].xpath('div').last.to_s
+ else
+ raw_url = repo_url.sub('github.com', 'raw.github.com')
+ data = RestClient.get("#{raw_url}/master/#{fname}")
+ html = "<pre>#{CGI.escape_html(data)}</pre>"
+ end
+
+ return html, fname
+ rescue RestClient::ResourceNotFound
+ # do nothing
+ rescue
+ STDERR.puts $!
+ end
+ }
+
+ return nil
+end
+
+def tweak_quickstart_html(html)
+ html.gsub!(/<(\/?)h4/, "<\\1h8")
+ html.gsub!(/<(\/?)h3/, "<\\1h7")
+ html.gsub!(/<(\/?)h2/, "<\\1h6")
+ html.gsub!(/<(\/?)h1/, "<\\1h5")
+ html
+end
+
+Repo = Struct.new(:url, :homepage, :created_at, :html)
+
+repos = []
+
+github_search('msgpack.org') do |repo|
+ # description needs to include msgpack[LANG]
+ m = REPO_DESC_MATCH.match(repo['description'])
+ next unless m
+ repo['lang'] = CGI.escape_html(m[1])
+
+ # skip forked repos
+ next if repo['fork']
+
+ url = repo['url']
+
+ homepage = repo['homepage']
+ homepage = nil if homepage == url
+ homepage = nil if homepage =~ /\Ahttp\:\/\/msgpack.org\/?/
+ repo['homepage'] = homepage
+
+ html, fname = get_quickstart_html(url)
+ next unless html
+
+ html = tweak_quickstart_html(html)
+ repo['quickstart_html'] = html
+ repo['quickstart_fname'] = fname
+
+ repo['id'] = "#{repo['owner']}-#{repo['name']}".gsub(/[^a-zA-Z0-9_\-]+/,'-')
+
+ repos << repo
+end
+
+@repos = repos.sort_by {|repo| Time.parse(repo['created_at']) }
+
+html = ERB.new(File.read("#{here}/index.html.erb")).result
+
+orig = File.read("#{here}/index.html")
+
+if orig != html
+ File.open("#{here}/index.html", 'w') {|f| f.write html }
+end
+

0 comments on commit 05d8693

Please sign in to comment.