diff --git a/doc/www-data.in/_layout/base b/doc/www-data.in/_layout/base index b1f175c112c8d16ac7a8f850ae6fbdf3e0638451..ac0c70aba11c8f800fa4fc5b961c2fedd6f29d33 100644 --- a/doc/www-data.in/_layout/base +++ b/doc/www-data.in/_layout/base @@ -5,8 +5,9 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="shortcut icon" href="favicon.ico" /> {% if not docs %} - <link rel="stylesheet" type="text/css" href="/global.css" /> + <link rel="stylesheet" type="text/css" href="global.css" /> {% endif %} + <link rel="stylesheet" type="text/css" href="styles/default.css" /> {% include "script" ignore missing %} </head> <body id="tarantool" class ="{{ page_name }}"> diff --git a/doc/www-data.in/_layout/script b/doc/www-data.in/_layout/script index b01384ec34eb50f6c7e2e6f73cbc57aaefc2c5b6..04163fe09a557713b5a7af9863a5a7dde0e46140 100644 --- a/doc/www-data.in/_layout/script +++ b/doc/www-data.in/_layout/script @@ -21,3 +21,5 @@ <img src="http://dd.cd.b2.a2.top.mail.ru/counter?id=2284916;js=na" style="border:0;position:absolute;left:-10000px;" height="1" width="1" alt="" /> </noscript> +<script src="highlight.js"></script> +<script>hljs.initHighlightingOnLoad();</script> diff --git a/doc/www-data.in/_text/index.md b/doc/www-data.in/_text/index.md index ec4b6c489478acd37ec297d2f3e7d960760cef0a..13e0b8f7ee5a6d381f16ceffad1490c07446b6de 100644 --- a/doc/www-data.in/_text/index.md +++ b/doc/www-data.in/_text/index.md @@ -2,39 +2,50 @@ index: main: | # Introduction - Tarantool is a NoSQL database running inside a Lua program. It's - created to store and process the most volatile and highly accessible - Web data. Tarantool has been extensively used in production since 2009. - It's **open source**, BSD licensed. + Tarantool is a NoSQL database running inside a Lua program. It + combines the network programming power of Node.JS with data + persistency capabilities of Redis. It's **open source**, BSD licensed. + The latest release is Tarantool 1.6.3, published on July 20, 2014. # Features - a drop-in replacement for Lua 5.1, based on LuaJIT 2.0; simply use *#!/usr/bin/tarantool* instead of *#!/usr/bin/lua* in your script, + - Lua packages for non-blocking I/O, fibers and HTTP, - [MsgPack](http://msgpack.org) data format and MsgPack based client-server protocol, - two data engines: 100% in-memory with optional persistence and a [2-level disk-based B-tree](http://sphia.org), to use with large data sets, - - secondary key and index iterators support, + - *secondary key* and index iterators support, - asynchronous master-master replication, - - authentication and access control, - - [lowest CPU overhead](benchmark.html) to store or serve a - piece of content. - - # Get started - - ``` bash - # apt-get install tarantool - # tarantool - # tarantool> box.cfg{{admin_port=3313}} - # tarantool> myspace = box.schema.create_space('myspace') - # tarantool> myspace:create_index('primary') - # tarantool> tuple = {{ name = 'Tarantool', release = box.info.version, - # type = {{ 'NoSQL database', 'Lua interpreter'}}}} - # tarantool> myspace:auto_increment{{tuple}} - # - [1, {{'release': '1.6.1-445-ge8d3201', 'name': 'Tarantool' - # 'type': ['NoSQL database', 'Lua interpreter']}}] + - authentication and access control. + + # Example + + ``` lua + #!/usr/bin/env tarantool + + box.cfg{{}} + hosts = box.space.hosts + if not hosts then + hosts = box.schema.create_space('hosts') + hosts:create_index('primary', {{ parts = {{1, 'STR'}} }}) + end + + local function handler(self) + local host = self.req.peer.host + local response = {{ + host = host; + counter = space:inc(host); + }} + self:render({{ json = response }}) + end + + httpd = require('http.server') + server = httpd.new('127.0.0.1', 8080) + server:route({{ path = '/' }}, handler) + server:start() ``` # Learn more diff --git a/doc/www-data/global.css b/doc/www-data/global.css index 91e1a90dfbb5ed1c0208ace5044dd63955922128..0574e23287b4e57404142ed4c1453037b6531962 100644 --- a/doc/www-data/global.css +++ b/doc/www-data/global.css @@ -103,7 +103,7 @@ blockquote { pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; - font-size: 80%; + font-size: 100%; }