From cd4e3270794d0167e3e17d4eb63e8879d529c25f Mon Sep 17 00:00:00 2001 From: Eugine Blikh <bigbes@gmail.com> Date: Tue, 24 Dec 2013 18:24:24 +0400 Subject: [PATCH] ### site building All layouts are in doc/www-data.in/_layout and are written in Jinja1 (django-like templates). All texts are in doc/www-data.in/_texts Text files contains YAML files with chunks of markdown strings: ``` $module: $uno: | some text in markdown $dos: | it may be multiline $tres: | # header 1 ``` may have some embedded code ``` e.t.c ... ``` where `$module` is name of layout file, `$uno`, `$dos`, `$tres`... are name of parts (template parts `{{ $module.$part }}`) Site still stores files in `doc/www-data` for copying on server. Also it integrates documentation (only on stable/master branches) into site (still templlates) Usage of new `extra/static.py`: ```bash $ cmake . -DENABLE-DOC=TRUE $ make $ cd /doc/www-data.in/ $ ../../extra/static.py site `# build site` $ ../../extra/static.py docs `# embed docs` ``` ### documentation building Add `html-saxon-chunk` and `html-chunk` targets for building chunked html documentation. `make` in `doc/user` now builds `html-saxon` and `html-saxon-chunk` targets --- CMakeLists.txt | 9 - doc/CMakeLists.txt | 10 + doc/user/CMakeLists.txt | 63 +++- doc/user/tnt-html-chunk.xsl.cmake | 21 ++ doc/user/tnt-html.xsl | 48 --- doc/user/tnt-html.xsl.cmake | 16 + doc/user/tnt.css | 47 ++- doc/user/user.xml | 2 +- doc/www-data.in/CMakeLists.txt | 4 +- doc/www-data.in/_config | 11 - doc/www-data.in/_ignore | 8 - doc/www-data.in/_layout/base | 18 +- doc/www-data.in/_layout/benchmark | 8 +- doc/www-data.in/_layout/documentation | 8 + doc/www-data.in/_layout/download | 7 + doc/www-data.in/_layout/faq | 6 +- doc/www-data.in/_layout/index | 22 +- doc/www-data.in/_layout/intro | 8 + doc/www-data.in/_layout/support | 7 + doc/www-data.in/_text/benchmark.md | 102 ++++++ doc/www-data.in/_text/faq.md | 71 +++++ doc/www-data.in/_text/index.md | 49 +++ doc/www-data.in/_text/intro.md | 95 ++++++ doc/www-data.in/_text/support.md | 22 ++ doc/www-data.in/benchmark | 97 ------ doc/www-data.in/download.cmake | 419 +++++++++++------------- doc/www-data.in/faq | 45 --- doc/www-data.in/index | 69 ---- doc/www-data.in/intro | 194 ------------ doc/www-data.in/support | 20 -- doc/www-data/global.css | 72 ++--- extra/static.py | 438 ++++++++------------------ 32 files changed, 877 insertions(+), 1139 deletions(-) create mode 100644 doc/user/tnt-html-chunk.xsl.cmake delete mode 100644 doc/user/tnt-html.xsl create mode 100644 doc/user/tnt-html.xsl.cmake delete mode 100644 doc/www-data.in/_config delete mode 100644 doc/www-data.in/_ignore create mode 100644 doc/www-data.in/_layout/documentation create mode 100644 doc/www-data.in/_text/benchmark.md create mode 100644 doc/www-data.in/_text/faq.md create mode 100644 doc/www-data.in/_text/index.md create mode 100644 doc/www-data.in/_text/intro.md create mode 100644 doc/www-data.in/_text/support.md delete mode 100644 doc/www-data.in/benchmark delete mode 100644 doc/www-data.in/faq delete mode 100644 doc/www-data.in/index delete mode 100644 doc/www-data.in/intro delete mode 100644 doc/www-data.in/support diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d2265b8d1..6e4925e323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,15 +357,6 @@ configure_file( "${PROJECT_SOURCE_DIR}/include/tarantool/config.h.cmake" "${PROJECT_BINARY_DIR}/include/tarantool/config.h" ) -configure_file( - "${PROJECT_SOURCE_DIR}/doc/tnt.ent.cmake" - "${PROJECT_BINARY_DIR}/doc/tnt.ent" - ) - -configure_file( - "${PROJECT_SOURCE_DIR}/doc/www-data.in/download.cmake" - "${PROJECT_BINARY_DIR}/doc/www-data.in/download" - ) message (STATUS "") message (STATUS "Tarantool configuration is complete:") message (STATUS "") diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 416698e60b..8a2feabf7a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,3 +1,12 @@ +configure_file( + "${PROJECT_SOURCE_DIR}/doc/tnt.ent.cmake" + "${PROJECT_BINARY_DIR}/doc/tnt.ent" + ) + +configure_file( + "${PROJECT_SOURCE_DIR}/doc/www-data.in/download.cmake" + "${PROJECT_BINARY_DIR}/doc/www-data.in/_text/download.md" + ) add_subdirectory(man) @@ -6,4 +15,5 @@ if (ENABLE_DOC) add_subdirectory(developer) endif() + add_subdirectory(www-data.in EXCLUDE_FROM_ALL) diff --git a/doc/user/CMakeLists.txt b/doc/user/CMakeLists.txt index 6a0c45e16e..85c9f6d161 100644 --- a/doc/user/CMakeLists.txt +++ b/doc/user/CMakeLists.txt @@ -1,4 +1,37 @@ +# ================= GET BRANCH NAME +if (EXISTS "${CMAKE_SOURCE_DIR}/.git") + execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if (GIT_BRANCH STREQUAL "") + message (FATAL_ERROR "Failed to retrive git branch.") + endif (GIT_BRANCH STREQUAL "") + + if (GIT_BRANCH STREQUAL "stable" OR GIT_BRANCH STREQUAL "master") + set (GIT_BRANCH "${GIT_BRANCH}/") + else () + set (GIT_BRANCH "") + endif (GIT_BRANCH STREQUAL "stable" OR GIT_BRANCH STREQUAL "master") +else (EXISTS "${CMAKE_SOURCE_DIR}/.git") + set (GIT_BRANCH "") +endif (EXISTS "${CMAKE_SOURCE_DIR}/.git") + +set(PATH_USERGUIDE_HTML "${PROJECT_BINARY_DIR}/doc/www-data.in/doc/${GIT_BRANCH}user_guide.html") +set(PATH_USERGUIDE_HTML_CHUNK "${PROJECT_BINARY_DIR}/doc/www-data.in/doc/${GIT_BRANCH}mpage") +set(PATH_USERGUIDE_TXT "${PROJECT_BINARY_DIR}/doc/user/tarantool_user_guide.txt") + +configure_file( + "${PROJECT_SOURCE_DIR}/doc/user/tnt-html-chunk.xsl.cmake" + "${PROJECT_BINARY_DIR}/doc/user/tnt-html-chunk.xsl") +configure_file( + "${PROJECT_SOURCE_DIR}/doc/user/tnt-html.xsl.cmake" + "${PROJECT_BINARY_DIR}/doc/user/tnt-html.xsl") + if (XMLLINT STREQUAL "XMLLINT-NOTFOUND") message (FATAL_ERROR "xmllint is missing") endif() @@ -11,9 +44,6 @@ if (LYNX STREQUAL "LYNX-NOTFOUND") message (FATAL_ERROR "lynx is missing") endif() -set(PATH_USERGUIDE_HTML "${PROJECT_BINARY_DIR}/doc/www-data/tarantool_user_guide.html") -set(PATH_USERGUIDE_TXT "${PROJECT_BINARY_DIR}/doc/user/tarantool_user_guide.txt") - # XMLLINT is not able to validate SCHEMATRON constraints, and # therefore is not a good validation tool for DocBook 5. However, # it can validate the entire document, following xinclude @@ -29,10 +59,14 @@ add_custom_target(doc-check ALL # # xsltproc-based documentation generation (default) # +add_custom_command(OUTPUT ${PATH_USERGUIDE_HTML_CHUNK} + COMMAND ${XSLTPROC} --nonet --xinclude + ${CMAKE_SOURCE_DIR}/doc/user/tnt-html-chunk.xsl + ${CMAKE_SOURCE_DIR}/doc/user/user.xml) + add_custom_command(OUTPUT ${PATH_USERGUIDE_HTML} - COMMAND ${XSLTPROC} --nonet - --stringparam collect.xref.targets "all" - --xinclude -o ${PATH_USERGUIDE_HTML} + COMMAND ${XSLTPROC} --nonet --xinclude + -o ${PATH_USERGUIDE_HTML} ${CMAKE_SOURCE_DIR}/doc/user/tnt-html.xsl ${CMAKE_SOURCE_DIR}/doc/user/user.xml) @@ -41,14 +75,17 @@ add_custom_command(OUTPUT ${PATH_USERGUIDE_TXT} COMMAND ${LYNX} -dump ${PATH_USERGUIDE_HTML} > ${PATH_USERGUIDE_TXT}) add_custom_target(html DEPENDS ${PATH_USERGUIDE_HTML}) +add_custom_target(html-chunk DEPENDS ${PATH_USERGUIDE_HTML_CHUNK}) add_custom_target(txt DEPENDS ${PATH_USERGUIDE_TXT}) add_custom_target(doc-autogen ALL - DEPENDS ${PATH_USERGUIDE_HTML} ${PATH_USERGUIDE_TXT}) + DEPENDS html-saxon html-saxon-chunk) install (FILES ${PATH_USERGUIDE_HTML} ${PATH_USERGUIDE_TXT} DESTINATION share/doc/tarantool) +install (DIRECTORY ${PATH_USERGUIDE_HTML_CHUNK} DESTINATION share/doc/tarantool) + add_custom_target(pdf COMMAND ${XSLTPROC} --nonet --stringparam collect.xref.targets "all" @@ -77,6 +114,18 @@ add_custom_target(html-saxon -r org.apache.xml.resolver.tools.CatalogResolver -u -o ${PATH_USERGUIDE_HTML} user.xml tnt-html.xsl) +add_custom_target(html-saxon-chunk + COMMAND java -cp "/usr/share/java/saxon.jar:/usr/share/java/xml-resolver.jar:/usr/share/java/docbook-xsl-saxon.jar:/usr/share/java/xercesImpl.jar:/etc/xml/resolver:/usr/share/java/xslthl.jar:/usr/share/java/xml-commons-resolver-1.1.jar" + -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl + -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl + -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration + com.icl.saxon.StyleSheet + -x org.apache.xml.resolver.tools.ResolvingXMLReader + -y org.apache.xml.resolver.tools.ResolvingXMLReader + -r org.apache.xml.resolver.tools.CatalogResolver + -u user.xml tnt-html-chunk.xsl) + + add_custom_target(pdf-saxon COMMAND java -cp "/usr/share/java/saxon.jar:/usr/share/java/xml-commons-resolver-1.1.jar:/usr/share/java/docbook-xsl-saxon.jar:/usr/share/java/xercesImpl.jar:/etc/xml/resolver:/usr/share/java/xslthl.jar" -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl diff --git a/doc/user/tnt-html-chunk.xsl.cmake b/doc/user/tnt-html-chunk.xsl.cmake new file mode 100644 index 0000000000..bd3e2248cd --- /dev/null +++ b/doc/user/tnt-html-chunk.xsl.cmake @@ -0,0 +1,21 @@ +<?xml version='1.0'?> + +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:xslthl="http://xslthl.sf.net"> + + <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/chunk.xsl"/> + <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/highlight.xsl"/> + <xsl:param name="highlight.source" select="1"/> + <xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> + <xsl:param name="base.dir">@PATH_USERGUIDE_HTML_CHUNK@/</xsl:param> + <xsl:param name="use.id.as.filename" select="1"></xsl:param> + + <xsl:param name="generate.toc"> + chapter toc + book toc + </xsl:param> + <xsl:param name="html.stylesheet" select="'tnt.css'"/> + <xsl:param name="collect.xref.targets">all</xsl:param> + +</xsl:stylesheet> diff --git a/doc/user/tnt-html.xsl b/doc/user/tnt-html.xsl deleted file mode 100644 index ab747ded7b..0000000000 --- a/doc/user/tnt-html.xsl +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version='1.0'?> -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" - xmlns:xslthl="http://xslthl.sf.net"> - -<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/docbook.xsl"/> - -<xsl:import href="html-highlight.xsl"/> - -<xsl:param name="generate.toc" select="'book toc'"/> -<xsl:param name="html.stylesheet" select="'tnt.css'"/> -<xsl:param name="highlight.source" select="1"/> -<xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> - -<!-- Add Google Analytics to the generated html--> - -<xsl:template name="user.head.content"> - <script type="text/javascript"> - - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-22120502-1']); - _gaq.push(['_trackPageview']); - - (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); - - </script> - -<!-- Rating@Mail.ru counter --> - - <script type="text/javascript">//<![CDATA[ - (function(w,n,d,r,s){(new Image).src='http://dd.cd.b2.a2.top.mail.ru/counter?id=2284916;js=13'+ - ((r=d.referrer)?';r='+escape(r):'')+((s=w.screen)?';s='+s.width+'*'+s.height:'')+';_='+Math.random();})(window,navigator,document);//]]> - </script> - <noscript> - <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> - -<!-- //Rating@Mail.ru counter --> - - <div id="header"> - <p class='book'><a id="home_link" href="/">Tarantool - Front page</a></p> - </div> -</xsl:template> -</xsl:stylesheet> diff --git a/doc/user/tnt-html.xsl.cmake b/doc/user/tnt-html.xsl.cmake new file mode 100644 index 0000000000..c4e7a862a9 --- /dev/null +++ b/doc/user/tnt-html.xsl.cmake @@ -0,0 +1,16 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:xslthl="http://xslthl.sf.net"> + + <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/docbook.xsl"/> + + <xsl:import href="html-highlight.xsl"/> + + <xsl:param name="collect.xref.targets">all</xsl:param> + <xsl:param name="generate.toc" select="'book toc'"/> + <xsl:param name="html.stylesheet" select="'tnt.css'"/> + <xsl:param name="highlight.source" select="1"/> + <xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> + +</xsl:stylesheet> diff --git a/doc/user/tnt.css b/doc/user/tnt.css index 1ec36c0252..70562743e2 100644 --- a/doc/user/tnt.css +++ b/doc/user/tnt.css @@ -20,14 +20,55 @@ font-weight: bold; } +body { + min-width: 768px; + max-width: 1024px; + margin: auto; +} + .book { - width: 768px; margin: 2pt auto; /*font-family: Verdana, Arial, Helvetica, sans-serif; */ - font-size: 120% + font-size: 100% } .book h1 { - margin: 80pt auto; font-size: 150% } + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + text-decoration: none; + outline: 0; + padding: 5px; + background-color: rgba(0,0,0,0.1); + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + box-shadow: 0 1px 3px rgba(0,0,0,0.3); +} + +div#header { + display: flex; +} + +div#content { + border-top: 1px dotted black; +} + +div#headwrap { + width: 100%; +} +div.column { + display: inline-block; +} +div#headl { + float: left; + width: 30%; +} +div#headr { + float: right; + width: 69%; + text-align: right +} diff --git a/doc/user/user.xml b/doc/user/user.xml index 05ba8bd1ab..e2f6138b55 100644 --- a/doc/user/user.xml +++ b/doc/user/user.xml @@ -4,7 +4,7 @@ %tnt; ]> <book xmlns="http://docbook.org/ns/docbook" version="5.0" - xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="tarantool-user-guide"> <title>Tarantool User Guide, version &tnt_version;</title> diff --git a/doc/www-data.in/CMakeLists.txt b/doc/www-data.in/CMakeLists.txt index bf27b9d3d4..63220942a5 100644 --- a/doc/www-data.in/CMakeLists.txt +++ b/doc/www-data.in/CMakeLists.txt @@ -1,4 +1,2 @@ add_custom_target(www-data ALL - COMMAND ${PROJECT_SOURCE_DIR}/extra/static.py - --source-path ${PROJECT_SOURCE_DIR}/doc/www-data.in - --output-path ${PROJECT_BINARY_DIR}/doc/www-data) + COMMAND ${PROJECT_SOURCE_DIR}/extra/site.py) diff --git a/doc/www-data.in/_config b/doc/www-data.in/_config deleted file mode 100644 index 568dbe6002..0000000000 --- a/doc/www-data.in/_config +++ /dev/null @@ -1,11 +0,0 @@ - -languages: - en: { source-encoding: 'utf-8', output-encoding: 'utf-8', suffix: '.html' } - ru: { source-encoding: 'utf-8', output-encoding: 'utf-8', suffix: '.ru.html' } - -# i18n for small bits -home_tag: { en: 'Tarantool - Front page', ru: 'Tarantool - ГлавнаÑ' } - -# implement language switch in the header, note the reversed language tags -lang_tag: { en: 'РуÑÑкий', ru: 'English' } -lang_ext: { en: '.ru.html', ru: '.html' } diff --git a/doc/www-data.in/_ignore b/doc/www-data.in/_ignore deleted file mode 100644 index b9be31d411..0000000000 --- a/doc/www-data.in/_ignore +++ /dev/null @@ -1,8 +0,0 @@ -README -*.py *.pyc -CMakeLists.txt -CMakeFiles -cmake_install.cmake -download.cmake -Makefile -.*.swp diff --git a/doc/www-data.in/_layout/base b/doc/www-data.in/_layout/base index 528101eaab..44646dfbe5 100644 --- a/doc/www-data.in/_layout/base +++ b/doc/www-data.in/_layout/base @@ -4,7 +4,9 @@ <title>{{ title }}</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="shortcut icon" href="favicon.ico" /> -<link rel="stylesheet" type="text/css" href="global.css" /> +{% if not docs %} + <link rel="stylesheet" type="text/css" href="/global.css" /> +{% endif %} {% include "script" ignore missing %} </head> <body id="tarantool"> @@ -12,26 +14,14 @@ <div id="wrapper"> <div id="header"> {% block header %} - <p class='lwrap'><a id="home_link" href="index{{ languages[pagelang].suffix | e }}">{{ home_tag | langselect | e }}</a></p> -<!-- <p class='rwrap'><a id="lang_link" href="{{ pagename + lang_ext | langselect | e }}">{{ lang_tag | langselect | e }}</a></p> --> + <p class='lwrap'><a id="home_link" href="index.html">{{ home_tag | e }}</a></p> {% endblock header %} </div> <div id="content"> {% block content %} - <div class="grid"> - {{ content }} - </div> {% endblock content %} </div> - - <div id="footer"> - {% block footer %} - <p class='lwrap'>Last modified: {{ date.strftime('%Y-%m-%d') }}</p> - <p class='rwrap'>Sponsored by <a class='imglink' href="http://api.mail.ru"><img src="mail-logo.png" alt="Mail.Ru" /></a></p> - {% endblock footer %} - </div> - </div> </body> </html> diff --git a/doc/www-data.in/_layout/benchmark b/doc/www-data.in/_layout/benchmark index d373ba89d2..6343b76071 100644 --- a/doc/www-data.in/_layout/benchmark +++ b/doc/www-data.in/_layout/benchmark @@ -1,5 +1,9 @@ {% extends "base" %} {% set title = "Tarantool: a benchmark" %} {% block content %} - {{ benchmark | langselect }} -{% endblock content%} + <div id="blurb"> + {{ benchmark.blurb }} + <div class="clear"></div> + </div> + {{ benchmark.main }} +{% endblock content %} diff --git a/doc/www-data.in/_layout/documentation b/doc/www-data.in/_layout/documentation new file mode 100644 index 0000000000..37749ad6dc --- /dev/null +++ b/doc/www-data.in/_layout/documentation @@ -0,0 +1,8 @@ +{% extends "base" %} +{% set title = "Tarantool: documentation" %} +{% block header %} + {{ documentation.header }} +{% endblock header %} +{% block content %} + {{ documentation.main }} +{% endblock content %} diff --git a/doc/www-data.in/_layout/download b/doc/www-data.in/_layout/download index ea1f5aebbf..8abb15f1c2 100644 --- a/doc/www-data.in/_layout/download +++ b/doc/www-data.in/_layout/download @@ -1,2 +1,9 @@ {% extends "base" %} {% set title = "Tarantool: downloads" %} +{% block content %} + <div id="blurb"> + {{ download.blurb }} + <div class="clear"></div> + </div> + {{ download.main }} +{% endblock content %} diff --git a/doc/www-data.in/_layout/faq b/doc/www-data.in/_layout/faq index f0134bf4a1..c4992653f3 100644 --- a/doc/www-data.in/_layout/faq +++ b/doc/www-data.in/_layout/faq @@ -1,5 +1,9 @@ {% extends "base" %} {% set title = "Tarantool: Frequently Asked Questions" %} {% block content %} - {{ faq | langselect }} + <div id="blurb"> + {{ faq.blurb }} + <div class="clear"></div> + </div> + {{ faq.main }} {% endblock content%} diff --git a/doc/www-data.in/_layout/index b/doc/www-data.in/_layout/index index dd75f0a746..4cdf83a8c2 100644 --- a/doc/www-data.in/_layout/index +++ b/doc/www-data.in/_layout/index @@ -1,26 +1,10 @@ {% extends "base" %} {% set title = "Tarantool -- an in-memory NoSQL database" %} -{% block header %} -<!-- <p class='rwrap'><a id="lang_link" href="{{ pagename + lang_ext | langselect | e }}">{{ lang_tag | langselect | e }}</a></p> --> -{% endblock header %} - {% block content %} - <div id="blurb"> - - {{ blurb | langselect }} - + {{ index.blurb }} <div class="clear"></div> - </div> - - {{ tagline | langselect }} - - {{ features | langselect }} - - {{ example | langselect }} - - {{ links | langselect }} - -{% endblock content%} + {{ index.main }} +{% endblock content %} diff --git a/doc/www-data.in/_layout/intro b/doc/www-data.in/_layout/intro index 268efc1307..44ed658e88 100644 --- a/doc/www-data.in/_layout/intro +++ b/doc/www-data.in/_layout/intro @@ -1,2 +1,10 @@ {% extends "base" %} {% set title = "Tarantool: an introduction" %} +{% block content %} + <div id="blurb"> + {{ intro.blurb }} + <div class="clear"></div> + </div> + {{ intro.main }} +{% endblock content %} + diff --git a/doc/www-data.in/_layout/support b/doc/www-data.in/_layout/support index cc94e59d4e..e5f82a2472 100644 --- a/doc/www-data.in/_layout/support +++ b/doc/www-data.in/_layout/support @@ -1,2 +1,9 @@ {% extends "base" %} {% set title = "Tarantool: getting support" %} +{% block content %} + <div id="blurb"> + {{ support.blurb }} + <div class="clear"></div> + </div> + {{ support.main }} +{% endblock content %} diff --git a/doc/www-data.in/_text/benchmark.md b/doc/www-data.in/_text/benchmark.md new file mode 100644 index 0000000000..2a5b258249 --- /dev/null +++ b/doc/www-data.in/_text/benchmark.md @@ -0,0 +1,102 @@ +benchmark: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### [Overview][ovw] [Documentation][doc] [Download][dow] [Support][sup] + + [ovw]: intro.html + [doc]: doc/stable/mpage/index.html + [dow]: download.html + [sup]: support.html + + main: | + # Preface + + There are lies, then there is statistics, but the first place in + misrepresenting the truth is undoubtedly owned by benchmarks. + + Comparing Tarantool with other systems, apples to apples, is + not strictly correct: the server networking subsystem is fully + asynchronous and it's possible to proxy all clients via a single + socket. In this case, responses to queries are sent as soon they + are ready. Most production application use asynchronous and + batched I/O with Tarantool. + + As long as the overhead of system calls and context switches is + the single largest contributor to the cost of serving a single + request, use of batched and multiplexed I/O produces an order of + magnitude better results, when compared with traditional + multi-threaded workloads. A tool we developed for our own use, + [nosqlbench](http://github.com/mailru/nosqlbench), is utilizing + this approach at full. + + However, to compare with the rest of the world, a standardized + benchmarking kit is more appropriate. This is why Yahoo! Cloud + Serving Benchmark (c) was used to produce the charts + below. A fork of YCSB with Tarantool support is available + [here](https://github.com/bigbes92/YCSB). Since YCSB was developed + to compare cloud key/value servers, it provides a very narrow view + at performance of a tested server. For example, performance of + secondary keys or overhead of locking (which Tarantool doesn't + have) is not tested at all. + + # What is YCSB + + Yahoo! Cloud Serving Benchmark (c) consists of two components: + + - the client, which generates the load according to a workload type + and analyzes latency and throughput, + - workload files, which define a single benchmark by describing + the size of the data set, the total amount of requests, the ratio of + read and write queries. + + There are 6 major workload types in YCSB: + + - workload **A**, 50/50 update/read ratio, size of the data set + is 200 000 key/value pairs, + - workload **B**, 5/95 update/read ratio, the same size of the data set, + - workload **C** is 100% read-only, + - workload **D** 5/95 insert/read ratio, the read load is skewed + towards the end of the key range, + - workload **E**, 5/95 ratio of insert/reads over a range of 10 + records, + - workload **F**, 95% read/modify/write, 5% read. + + For additional information on YCSB and workload types, please visit + [YCSB official page on Github](http://github.com/brianfrankcooper/YCSB). + + All charts below were measured using 1M queries per test, averaged + over 8 consecutive test runs. + + Configuration files for the tested systems can be found + [here](https://github.com/bigbes92/ycsb-expand-db/tree/master/confs). + + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> + <script src="http://code.highcharts.com/highcharts.js"></script> + <script type="text/javascript" src="highcharts.js"></script> + <div class="b-tabs"> + <div> + <ul class="b-tabs__list"> + <li class="b-tabs__li b-tabs__li_on">A</li> + <li class="b-tabs__li">B</li> + <li class="b-tabs__li">C</li> + <li class="b-tabs__li">D</li> + <li class="b-tabs__li">E</li> + <li class="b-tabs__li">F</li> + <li class="b-tabs__li">LOAD</li> + </ul> + </div> + + <div class="b-tabs__body"> + <h3 align=center><p class="b-tabs__header">Workload A</p></h3> + <div id="picture1"></div> + <ul class="b-tabs__buttons"> + <li class="b-button b-button_on">A_Read</li> + <li class="b-button">A_Update</li> + </ul> + <div class="clear"></div> + <div id="picture2"></div> + <p class="b-tabs__description" align="center">50/50 update/read ratio</p> + </div> + </div> + <script type="text/javascript" src="tabs.js"></script> diff --git a/doc/www-data.in/_text/faq.md b/doc/www-data.in/_text/faq.md new file mode 100644 index 0000000000..28852e94f5 --- /dev/null +++ b/doc/www-data.in/_text/faq.md @@ -0,0 +1,71 @@ +faq: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### [Overview][ovw] [Documentation][doc] [Download][dow] [Support][sup] + + [ovw]: intro.html + [doc]: doc/stable/mpage/index.html + [dow]: download.html + [sup]: support.html + + main: | + ## Frequently Asked Questions + + **Q. Why Tarantool?** + + A. Tarantool is a result of a long trial and error process within Mail.Ru. + It's the Nth generation of a family of custom in-memory data servers, + developed for various web applications. Besides, when Tarantool + development started (2008) there were no stable and sufficiently + functional open source alternative. + + ** Q. Why Lua?** + + A. Lua is a ligthweight, fast, extensible multi-paradigm language. Lua also + happens to be very easy to embed. Lua coroutines relate very closely to + Tarantool fibers, and Lua architecture works well with Tarantool internals. + Lua is the first, but, hopefully, not the last stored program language for Tarantool. + + **Q. What's the key advantage of Tarantool?** + + A. Tarantool provides a fairly rich core feature set (HASH, TREE BITSET + indexes, secondary indexes, composite indexes, asynchronous replication, + hot standby, data durability) along with support for Lua stored procedures. + These two properties make it possible to code fast, atomic and reliable + in-memory data servers which handle non-trivial application-specific logic. + The win over traditional SQL servers is in performance: low-overhead, + lock-free architecture means Tarantool can serve an order of magnitude + more requests per second, on comparable hardware. The win over NoSQL + alternatives is in flexibility: Lua allows flexible processing of + data stored in a compact, denormalized format. + + **Q. What are your development plans?** + + A. They are standard. Performance. Better support for transactions. + Master-master replication, automatic sharding. + + **Q. Who is developing Tarantool?** + + A. There is a small engineering team employed by Mail.ru -- check out + our commit logs on github. The development is fully open, and most + of the connectors authors and maintainers in different distributions + are from the community. + + **Q. How serious is Mail.Ru about Tarantool?** + + A. Tarantool is an open source project, distributed under a BSD license, + and as such does not depend on any one sponsor. However, it is currently + and integral part of Mail.Ru backbone, so it gets a lot of support from Mail.ru. + + **Q. Why is Tarantool primary port number 33013?** + + A. It's a prime number which is easy to remember, because 3313, 3301, 313, 13 and 3 are also prime numbers. + + **Q. My arena_used/items_used in SHOW SLAB output is >> 1. What does it mean and what should I do?** + + A. If the ratio of arena_used to items_used >> 1, that indicates that there is + fragmentation accumulated by the slab allocator. Imagine there are a lot of + small tuples stored in the system initially, and later on each tuple becomes + bigger and doesn't fit into its old slab size. The old slabs are never + relinquished by the allocator. Currently this can be solved only by a server restart. diff --git a/doc/www-data.in/_text/index.md b/doc/www-data.in/_text/index.md new file mode 100644 index 0000000000..7759f67c31 --- /dev/null +++ b/doc/www-data.in/_text/index.md @@ -0,0 +1,49 @@ +index: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### [Overview][ovw] [Documentation][doc] [Download][dow] [Support][sup] + + [ovw]: intro.html + [doc]: doc/stable/mpage/index.html + [dow]: download.html + [sup]: support.html + + main: | + # Introduction + + Tarantool is an in-memory database designed to store the most volatile + and highly accessible web content. Tarantool has been extensively used + in production since 2009. It's **open source**, BSD licensed. + + # Features + + - [lowest CPU overhead](benchmark.html) to store or serve a + piece of content, + - optional Write Ahead Logging for persistency and reliability, + - universal data access with [rich Lua stored + procedures](http://github.com/mailru/tntlua), which can exchange messages + between each other or networked peers, + - asynchronous master-slave replication and hot backup. + + # Get started + + ```bash + # apt-get install tarantool tarantool-client + # cd /etc/tarantool + # cp instances.available/example.cfg instances.enabled/fqueue.cfg + # cd /usr/share/tarantool/lua + # wget http://github.com/mailru/tntlua/raw/master/fqueue.lua -O init.lua + # service tarantool start + tarantool: Staring instances + Starting 'fqueue' ... ok + ``` + + A fast and customizable message queue server is up and running. + + # Learn more + + - [YCSB benchmark results](benchmark.html) + - [FAQ](faq.html) + - [Source repository](http://github.com/tarantool/tarantool) + - [Lua stored procedures repository]( http://github.com/mailru/tntlua) diff --git a/doc/www-data.in/_text/intro.md b/doc/www-data.in/_text/intro.md new file mode 100644 index 0000000000..a0b69bcac2 --- /dev/null +++ b/doc/www-data.in/_text/intro.md @@ -0,0 +1,95 @@ +intro: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### Overview [Documentation][doc] [Download][dow] [Support][sup] + + [doc]: doc/stable/mpage/index.html + [dow]: download.html + [sup]: support.html + + main: | + ## What is Tarantool? + + Tarantool is an in-memory NoSQL database. The code is available + for free under the terms of [BSD license]. Supported platforms + are GNU/Linux, Mac OS and FreeBSD. + + ## An overview of the architecture + + The server **maintains all its data in random-access memory**, + and therefore has very low read latency. At the same time, + a copy of the data is kept on non-volatile storage (a disk drive), + and inserts and updates are performed atomically. + + To ensure atomicity, consistency and crash-safety of the + persistent copy, a write-ahead log (WAL) is maintained, and + each change is recorded in the WAL before it is considered + complete. The logging subsystem supports group commit. + + If update and delete rate is high, a constantly growing write-ahead log file + (or files) can pose a disk space problem, and significantly increase time + necessary to restart from disk. A simple solution is employed: the server + **can be requested to save a concise snapshot** of its current data. The + underlying operating system's "`copy-on-write`" feature is employed to take + the snapshot in a quick, resource-savvy and non-blocking manner. The + "`copy-on-write`" technique guarantees that snapshotting has minimal impact + on server performance. + + **Tarantool is lock-free**. Instead of the operating system's concurrency + primitives, such as threads and mutexes, Tarantool uses a cooperative + multitasking environment to simultaneously operate on thousands of + connections. A fixed number of independent execution threads within + the server do not share state, but exchange data using low overhead + message queues. While this approach limits server scalability to a + few CPU cores, it removes competition for the memory bus and sets the + scalability limit to the top of memory and network throughput. CPU + utilization of a typical highly-loaded Tarantool server is under 10%. + + ## Key features + + Unlike most of NoSQL databases, Tarantool supports primary, **secondary + keys, multi-part keys**, HASH, TREE and BITSET index types. + + Tarantool supports **Lua stored procedures**, which can access and + modify data atomically. Procedures can be created, modified and + dropped at runtime. + + Use of Lua as an extension language does not end with stored + procedures: Lua programs can be used during startup, to define + triggers and background tasks, interact with networked peers. + Unlike popular application development frameworks implemented + around "reactor" pattern, networking in server-side Lua is + sequential, yet very efficient, as is built on top of the + cooperating multitasking environment used by the server + itself. + + Extended with Lua, Tarantool typically replaces more not one but + a few existing components with a single well-performing system, + changing and simplifying complex multi-tier Web application + architectures. + + Tarantool supports replication. Replicas may run locally or on + a remote host. Tarantool replication is asynchronous and does + not block writes to the master. When or if the master becomes + unavailable, the replica can be switched to assume the role of + the master without server restart. + + ## How stable is the software? + + **The software is production-ready**. Tarantool has been created and is + actively used at [Mail.Ru], one of the leading Russian web content providers. + At Mail.Ru, the software serves the "`hottest`" data, such as online users + and their sessions, online application properties, mapping between users + and their serving shards, and so on. + + Outside Mail.Ru + the software is used by a growing number of projects in online gaming, + digital marketing, social media industries. While product development is + sponsored by Mail.Ru, the roadmap, bugs database and the development process + are fully open. The software incorporates patches from dozens of community + contributors, and most of the programming language drivers are written and + supported by the community. + + [BSD license]: http://www.gnu.org/licenses/license-list.html#ModifiedBSD + [Mail.Ru]: http://api.mail.ru diff --git a/doc/www-data.in/_text/support.md b/doc/www-data.in/_text/support.md new file mode 100644 index 0000000000..215e07b1e2 --- /dev/null +++ b/doc/www-data.in/_text/support.md @@ -0,0 +1,22 @@ +support: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### [Overview][ovw] [Documentation][doc] [Download][dow] Support + + [ovw]: intro.html + [doc]: doc/stable/mpage/index.html + [dow]: download.html + + main: | + # Getting support + + We are happy to provide help on [tarantool@groups.google.com]. If you need immediate help, try to + ping maintainers on [#tarantool] channel at irc.freenode.net. + + Terms of commercial 24x7 support are available upon request, please send + an inquiry to [support@tarantool.org]. + + [#tarantool]: http://webchat.freenode.net/?channels=#tarantool + [tarantool@groups.google.com]: http://groups.google.com/group/tarantool + [support@tarantool.org]: mailto:support@tarantool.org diff --git a/doc/www-data.in/benchmark b/doc/www-data.in/benchmark deleted file mode 100644 index 81423c1722..0000000000 --- a/doc/www-data.in/benchmark +++ /dev/null @@ -1,97 +0,0 @@ -{% page benchmark en %} - -{% text benchmark en %} - -# Preface - -There are lies, then there is statistics, but the first place in -misrepresenting the truth is undoubtedly owned by benchmarks. - -Comparing Tarantool with other systems, apples to apples, is -not strictly correct: the server networking subsystem is fully -asynchronous and it's possible to proxy all clients via a single -socket. In this case, responses to queries are sent as soon they -are ready. Most production application use asynchronous and -batched I/O with Tarantool. - -As long as the overhead of system calls and context switches is -the single largest contributor to the cost of serving a single -request, use of batched and multiplexed I/O produces an order of -magnitude better results, when compared with traditional -multi-threaded workloads. A tool we developed for our own use, -[nosqlbench](http://github.com/mailru/nosqlbench), is utilizing -this approach at full. - -However, to compare with the rest of the world, a standardized -benchmarking kit is more appropriate. This is why Yahoo! Cloud -Serving Benchmark (c) was used to produce the charts -below. A fork of YCSB with Tarantool support is available -[here](https://github.com/bigbes92/YCSB). Since YCSB was developed -to compare cloud key/value servers, it provides a very narrow view -at performance of a tested server. For example, performance of -secondary keys or overhead of locking (which Tarantool doesn't -have) is not tested at all. - -# What is YCSB - -Yahoo! Cloud Serving Benchmark (c) consists of two components: - -- the client, which generates the load according to a workload type -and analyzes latency and throughput, -- workload files, which define a single benchmark by describing -the size of the data set, the total amount of requests, the ratio of -read and write queries. - -There are 6 major workload types in YCSB: - -- workload **A**, 50/50 update/read ratio, size of the data set -is 200 000 key/value pairs, -- workload **B**, 5/95 update/read ratio, the same size of the data set, -- workload **C** is 100% read-only, -- workload **D** 5/95 insert/read ratio, the read load is skewed -towards the end of the key range, -- workload **E**, 5/95 ratio of insert/reads over a range of 10 -records, -- workload **F**, 95% read/modify/write, 5% read. - -For additional information on YCSB and workload types, please visit -[YCSB official page on Github](http://github.com/brianfrankcooper/YCSB). - -All charts below were measured using 1M queries per test, averaged -over 8 consecutive test runs. - -Configuration files for the tested systems can be found -[here](https://github.com/bigbes92/ycsb-expand-db/tree/master/confs). - -<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> -<script src="http://code.highcharts.com/highcharts.js"></script> -<script type="text/javascript" src="highcharts.js"></script> -<div class="b-tabs"> - <div> - <ul class="b-tabs__list"> - <li class="b-tabs__li b-tabs__li_on">A</li> - <li class="b-tabs__li">B</li> - <li class="b-tabs__li">C</li> - <li class="b-tabs__li">D</li> - <li class="b-tabs__li">E</li> - <li class="b-tabs__li">F</li> - <li class="b-tabs__li">LOAD</li> - </ul> - </div> - - <div class="b-tabs__body"> - <h3 align=center><p class="b-tabs__header">Workload A</p></h3> - <div id="picture1"></div> - <ul class="b-tabs__buttons"> - <li class="b-button b-button_on">A_Read</li> - <li class="b-button">A_Update</li> - </ul> - <div class="clear"></div> - <div id="picture2"></div> - <p class="b-tabs__description" align="center">50/50 update/read ratio</p> - </div> -</div> -<script type="text/javascript" src="tabs.js"></script> - - -{% page benchmark ru %} diff --git a/doc/www-data.in/download.cmake b/doc/www-data.in/download.cmake index a38cd556e2..df5adb572b 100644 --- a/doc/www-data.in/download.cmake +++ b/doc/www-data.in/download.cmake @@ -1,236 +1,183 @@ -{% page download en %} -# All downloads - -All published releases are available at <a -href="http://tarantool.org/dist">http://tarantool.org/dist</a>. - -# How to choose the right version for download - -Tarantool uses a 3-digit versioning scheme -<major>-<minor>-<patch>. -Major digits change rarely. A minor version increase indicates one -or few incompatibile changes. Patch verison counter is increased -whenever the source tree receives a few important bugfixes. - -The version string may also contain a git revision id, to ease -identification of the unqiue commit used to generate the build. - -The current version of the stable branch is **@PACKAGE_VERSION@**. - -An automatic build system creates, tests and publishes packages -for every push into the stable branch. All binary packages contain -symbol information. Additionally, **-debug-** -packages contain asserts and are compiled without optimization. - -## Source tarball - -The latest source archive is -<a href="http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-src.tar.gz">tarantool-@PACKAGE_VERSION@-src.tar.gz</a>. -Please consult with README for build instructions on your system. - -## Binary downloads - -To simplify problem analysis and avoid various bugs induced -by compilation parameters and environment, it is recommended -that production systems use the builds provided on this site. - -### Debian GNU/Linux and Ubuntu - -We maintain an always up-to-date Debian GNU/Linux and Ubuntu package -repository at <a -href="http://tarantool.org/dist/debian">http://tarantool.org/dist/debian</a> and <a -href="http://tarantool.org/dist/ubuntu">http://tarantool.org/dist/ubuntu</a> respectively. - -At the moment the repository contains builds for Debian "Sid", "Jessie", -"Wheezy" and Ubuntu "Precise", "Quantal", "Raring", "Saucy". -It can be added to your apt sources list with: - - wget http://tarantool.org/dist/public.key - sudo apt-key add ./public.key - release=`lsb_release -c -s` - - # For Debian: - - echo "deb http://tarantool.org/dist/debian/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - echo "deb-src http://tarantool.org/dist/debian/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - - # For Ubuntu: - - echo "deb http://tarantool.org/dist/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - echo "deb-src http://tarantool.org/dist/ubuntu/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - - sudo apt-get update - sudo apt-get install tarantool tarantool-client - -### CentOS 5-6 and RHEL 5-6 - -CentOS repository is available at -<a href="http://tarantool.org/dist/centos">http://tarantool.org/dist/centos</a>. - -Add the following section to your yum repository list (/etc/yum.repos.d/tarantool.repo) -to enable it: - - [tarantool] - name=CentOS-$releasever - Tarantool - baseurl=http://tarantool.org/dist/centos/$releasever/os/$basearch/ - enabled=1 - gpgcheck=0 - -### Fedora - -Fedora repository is available at -<a href="http://tarantool.org/dist/fedora">http://tarantool.org/dist/fedora</a>. - -Add the following section to your yum repository list (/etc/yum.repos.d/tarantool.repo) -to enable it: - - [tarantool] - name=Fedora-$releasever - Tarantool - baseurl=http://tarantool.org/dist/fedora/$releasever/os/$basearch/ - enabled=1 - gpgcheck=0 - -### Gentoo Linux - -Tarantool is available from `tarantool` portage overlay. Use -[layman](http://wiki.gentoo.org/wiki/Layman) to add the overlay to your system: - - # layman -S - # layman -a tarantool - # emerge dev-db/tarantool -av - -### Other Linux distributions - -<table border=1 title="Download the latest build, @PACKAGE_VERSION@" width=100%> -<!-- .tar.gz --> - <th colspan=3>Static builds for Linux</th> - <tr> - <td> - Binary tarball (<b>.tar.gz</b>) - </td> - <td align=center> - <a href="http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-linux-i686.tar.gz">32-bit</a> - </td> - - <td align=center> - <a href="http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-linux-x86_64.tar.gz">64-bit</a> - </td> - </tr> -</table> - -### FreeBSD - -Tarantool is available from the FreeBSD Ports collection -(`databases/tarantool`). - -### OS X - -You can install Tarantool using homebrew: - - $ brew install --use-clang http://tarantool.org/dist/tarantool.rb - -Please upgrade `clang` to version 3.2 or later using -```Command Line Tools for Xcode``` disk image version 4.6+ from -[Apple Developer](https://developer.apple.com/downloads/) web-site. - -# Development branch - -In the same manner as for [the stable -branch](http://github.com/tarantool/tarantool/tree/stable), every push into [the master -branch](http://github.com/tarantool/tarantool) is [available -online](http://tarantool.org/dist/master). -The server roadmap is maintained on -[Github](http://github.com/tarantool/tarantool/issues?labels=feature). - -## Connectors - -- Perl driver, [DR:Tarantool](http://search.cpan.org/~unera/DR-Tarantool-0.37/lib/DR/Tarantool.pm) -- Java driver, [Maven repository](http://dgreenru.github.com/tarantool-java) -- Ruby driver, [http://github.com/mailru/tarantool-ruby](https://github.com/mailru/tarantool-ruby) -- Python driver, [http://pypi.python.org/pypi/tarantool](http://pypi.python.org/pypi/tarantool) -- PHP driver, [https://github.com/tarantool/tarantool-php](https://github.com/tarantool/tarantool-php) -- node.js driver, - [https://github.com/devgru/node-tarantool](https://github.com/devgru/node-tarantool) -- Erlang driver, - [https://github.com/rtsisyk/etarantool](https://github.com/rtsisyk/etarantool) -- C connector [is maintained in the server source tree](https://github.com/tarantool/tarantool/blob/master/connector/c) - -{% page download ru %} - -### Как правильно выбрать верÑию Ñервера - -Tarantool иÑпользует Ñтандартную Ñхему Ð½ÑƒÐ¼ÐµÑ€Ð¾Ð²Ð°Ð½Ð¸Ñ -релизов <major>-<minor>-<patch>. - -ÐŸÐµÑ€Ð²Ð°Ñ Ñ†Ð¸Ñ„Ñ€Ð° в верÑии изменÑетÑÑ ÐºÑ€Ð°Ð¹Ð½Ðµ редко, по итогам -Ð½Ð°ÐºÐ¾Ð¿Ð»ÐµÐ½Ð¸Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¾Ð³Ð¾ количеÑтва новых возможноÑтей. -Изменение Ñредней цифры ÑвлÑетÑÑ Ð¸Ð½Ð´Ð¸ÐºÐ°Ñ‚Ð¾Ñ€Ð¾Ð¼ неÑовмеÑтимых -изменений в Ñервере, таких как изменение протокола, удаление -опций командной Ñтроки или конфигурационного файла. -ПоÑледнÑÑ Ñ†Ð¸Ñ„Ñ€Ð° увеличиваетÑÑ Ð¿Ñ€Ð¸ Ñоздании очередного -релиза, направленного на уÑтранение обнаруженных ошибок. - -Ð’ конце Ñтроки верÑии также может приÑутÑтвовать git commit id, -что упрощает определение конкретной верÑии репозиториÑ, иÑпользованной -Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ñ€ÐµÐ»Ð¸Ð·Ð°. - -Ð¢ÐµÐºÑƒÑ‰Ð°Ñ ÑÑ‚Ð°Ð±Ð¸Ð»ÑŒÐ½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ **@PACKAGE_VERSION@**. - -#### ИÑходный код - -Ðрхив .tar.gz Ñ Ð¿Ð¾Ñледний верÑией иÑходного кода доÑтупен по Ñледующей -ÑÑылке: -<a href="http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-src.tar.gz">tarantool-@PACKAGE_VERSION@-src.tar.gz</a>. -Файл README.<OS> Ñодержит инÑтрукции по Ñборке из иÑходников. - -### Бинарные пакеты - -Ð”Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² выÑоконагруженных проектах -рекомендуютÑÑ Ð¿Ð°ÐºÐµÑ‚Ñ‹, опубликованные на Ñтом Ñайте. - -#### Debian GNU/Linux and Ubuntu - -Мы поддерживаем ÑобÑтвенные репозитории .deb пакетов, который -Ñодержит поÑледние верÑии Ñервера и клиентÑких библиотек Ð´Ð»Ñ -*Debian GNU/Linux* и *Ubuntu*: -<a href="http://tarantool.org/dist/debian">http://tarantool.org/dist/debian</a>, -<a href="http://tarantool.org/dist/ubuntu">http://tarantool.org/dist/ubuntu</a>. - -Репозитории Ñодержат пакеты Ð´Ð»Ñ Debian "Sid", "Jessy", -"Wheezy" и Ubuntu "Precise", "Quantal", "Raring", "Saucy". -Ð”Ð»Ñ ÑƒÑтановки можно воÑпользоватьÑÑ Ñледующим Ñкриптом: - - wget http://tarantool.org/dist/public.key - sudo apt-key add ./public.key - release=`lsb_release -c -s` - echo "deb http://tarantool.org/dist/debian/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - echo "deb-src http://tarantool.org/dist/debian/ $release main" | sudo tee -a /etc/apt/sources.list.d/tarantool.list - sudo apt-get update - sudo apt-get install tarantool tarantool-client - -CentOS GNU/Linux репозиторий доÑтупен по адреÑу: -<a href="http://tarantool.org/dist/centos">http://tarantool.org/dist/centos</a>. - -Добавьте Ñледующую Ñекцию в Ваш ÑпиÑок репозиториев -(/etc/yum.repos.d/tarantool.repo) чтобы Ñделать его доÑтупным Ð´Ð»Ñ Yum: - - [tarantool] - name=CentOS-$releasever - Tarantool - baseurl=http://tarantool.org/dist/centos/$releasever/os/$basearch/ - enabled=1 - gpgcheck=0 - -### Ðрхив Ñтарых релизов - -Ðрхив Ñтарых релизов доÑтупен по адреÑу <a -href="http://tarantool.org/dist">http://tarantool.org/dist</a>. - -### ДоÑтуп из Ñзыков Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ - -- Perl driver [DR:Tarantool](http://search.cpan.org/~unera/DR-Tarantool-0.37/lib/DR/Tarantool.pm) -- [Ruby driver](https://github.com/mailru/tarantool-ruby) -- Python driver, [hosted at pypi.python.org](http://pypi.python.org/pypi/tarantool) -- PHP driver [https://github.com/tarantool/tarantool-php](https://github.com/tarantool/tarantool-php) -- Java driver, [Maven repository](http://dgreenru.github.com/tarantool-java) -- node.js driver, - [https://github.com/devgru/node-tarantool](https://github.com/devgru/node-tarantool) +download: + blurb: | + # Tarantool + ## An in-memory NoSQL database + ### [Overview][ovw] [Documentation][doc] Download [Support][sup] + + [ovw]: intro.html + [doc]: doc/stable/mpage/index.html + [sup]: support.html + + main: | + # All downloads + + All published releases are available at [http://tarantool.org/dist]. + + # How to choose the right version for download + + Tarantool uses a 3-digit versioning scheme `<major>-<minor>-<patch>`. + Major digits change rarely. A minor version increase indicates one + or few incompatibile changes. Patch verison counter is increased + whenever the source tree receives a few important bugfixes. + + The version string may also contain a git revision id, to ease + identification of the unqiue commit used to generate the build. + + The current version of the stable branch is **@PACKAGE_VERSION@**. + + An automatic build system creates, tests and publishes packages + for every push into the stable branch. All binary packages contain + symbol information. Additionally, **-debug-** + packages contain asserts and are compiled without optimization. + + ## Source tarball + + The latest source archive is [tarantool-@PACKAGE_VERSION@-src.tar.gz] + Please consult with README for build instructions on your system. + + [tarantool-@PACKAGE_VERSION@-src.tar.gz]: http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-src.tar.gz + + ## Binary downloads + + To simplify problem analysis and avoid various bugs induced + by compilation parameters and environment, it is recommended + that production systems use the builds provided on this site. + + ### Debian GNU/Linux and Ubuntu + + We maintain an always up-to-date Debian GNU/Linux and Ubuntu package + repository at [http://tarantool.org/dist/debian] and [http://tarantool.org/dist/ubuntu] + respectively. + + At the moment the repository contains builds for Debian "Sid", "Jessie", + "Wheezy" and Ubuntu "Precise", "Quantal", "Raring", "Saucy". + It can be added to your apt sources list with: + + ```bash + wget http://tarantool.org/dist/public.key + sudo apt-key add ./public.key + release=`lsb_release -c -s` + + # For Debian: + cat > /etc/apt/sources.list.d/tarantool.list <<- EOF + deb http://tarantool.org/dist/debian/ $release main + deb-src http://tarantool.org/dist/debian/ $release main + EOF + + # For Ubuntu: + cat > /etc/apt/sources.list.d/tarantool.list <<- EOF + deb http://tarantool.org/dist/ubuntu/ $release main + deb-src http://tarantool.org/dist/ubuntu/ $release main + EOF + + sudo apt-get update + sudo apt-get install tarantool tarantool-client + ``` + + ### CentOS 5-6 and RHEL 5-6 + + CentOS repository is available at [http://tarantool.org/dist/centos] + + Add the following section to your yum repository list (/etc/yum.repos.d/tarantool.repo) + to enable it: + + ```ini + [tarantool] + name=CentOS-$releasever - Tarantool + baseurl=http://tarantool.org/dist/centos/$releasever/os/$basearch/ + enabled=1 + gpgcheck=0 + ``` + + ### Fedora + + Fedora repository is available at [http://tarantool.org/dist/fedora] + + Add the following section to your yum repository list (/etc/yum.repos.d/tarantool.repo) + to enable it: + + ```ini + [tarantool] + name=Fedora-$releasever - Tarantool + baseurl=http://tarantool.org/dist/fedora/$releasever/os/$basearch/ + enabled=1 + gpgcheck=0 + ``` + + ### Gentoo Linux + + Tarantool is available from `tarantool` portage overlay. Use + [layman] to add the overlay to your system: + + ``` + # layman -S + # layman -a tarantool + # emerge dev-db/tarantool -av + ``` + + [layman]: http://wiki.gentoo.org/wiki/Layman + + ### Other Linux distributions + <table border=1 title="Download the latest build, @PACKAGE_VERSION@" width=100%> + <th colspan=3>Static builds for Linux</th> + <tr> + <td> Binary tarball (**.tar.gz**) </td> + <td align=center> [32-bit] </td> + <td align=center> [64-bit] </td> + </tr> + </table> + + [32-bit]: http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-linux-i686.tar.gz + [64-bit]: http://tarantool.org/dist/tarantool-@PACKAGE_VERSION@-linux-x86_64.tar.gz + + ### FreeBSD + + Tarantool is available from the FreeBSD Ports collection + (`databases/tarantool`). + + ### OS X + + You can install Tarantool using homebrew: + + ``` + $ brew install --use-clang http://tarantool.org/dist/tarantool.rb + ``` + + Please upgrade `clang` to version 3.2 or later using + `Command Line Tools for Xcode` disk image version 4.6+ from + [Apple Developer] web-site. + + [Apple Developer]: https://developer.apple.com/downloads/ + + # Development branch + + In the same manner as for [the stable branch][stable], every push into + [the master branch][master] is [available online][builds-m]. + The server roadmap is maintained on [Github][issues]. + + [stable]: http://github.com/tarantool/tarantool/tree/stable + [master]: http://github.com/tarantool/tarantool/tree/master + [builds-m]: http://tarantool.org/dist/master + [issues]: http://github.com/tarantool/tarantool/issues?labels=feature + + ## Connectors + + - Perl driver, [DR:Tarantool](http://search.cpan.org/~unera/DR-Tarantool-0.37/lib/DR/Tarantool.pm) + - Java driver, [Maven repository](http://dgreenru.github.com/tarantool-java) + - Ruby driver, [https://github.com/mailru/tarantool-ruby] + - Python driver, [http://pypi.python.org/pypi/tarantool] + - PHP driver, [https://github.com/tarantool/tarantool-php] + - node.js driver, [https://github.com/devgru/node-tarantool] + - Erlang driver, [https://github.com/rtsisyk/etarantool] + - C connector [is maintained in the server source tree](https://github.com/tarantool/tarantool/blob/master/connector/c) + + [http://tarantool.org/dist]: http://tarantool.org/dist + [http://tarantool.org/dist/debian]: http://tarantool.org/dist/debian + [http://tarantool.org/dist/ubuntu]: http://tarantool.org/dist/ubuntu + [http://tarantool.org/dist/centos]: http://tarantool.org/dist/centos + [http://tarantool.org/dist/fedora]: http://tarantool.org/dist/fedora + [https://github.com/mailru/tarantool-ruby]: https://github.com/mailru/tarantool-ruby + [http://pypi.python.org/pypi/tarantool]: http://pypi.python.org/pypi/tarantool + [https://github.com/tarantool/tarantool-php]: https://github.com/tarantool/tarantool-php + [https://github.com/devgru/node-tarantool]: https://github.com/devgru/node-tarantool + [https://github.com/rtsisyk/etarantool]: https://github.com/rtsisyk/etarantool diff --git a/doc/www-data.in/faq b/doc/www-data.in/faq deleted file mode 100644 index 379eee0260..0000000000 --- a/doc/www-data.in/faq +++ /dev/null @@ -1,45 +0,0 @@ -{% page faq en %} - -{% text faq en %} - -## Frequently Asked Questions - -**Q. Why Tarantool?** - -A. Tarantool is a result of a long trial and error process within Mail.Ru. It's the Nth generation of a family of custom in-memory data servers, developed for various web applications. Besides, when Tarantool development started (2008) there were no stable and sufficiently functional open source alternative. - -** Q. Why Lua?** - -A. Lua is a ligthweight, fast, extensible multi-paradigm language. Lua also -happens to be very easy to embed. Lua coroutines relate very closely to -Tarantool fibers, and Lua architecture works well with Tarantool internals. -Lua is the first, but, hopefully, not the last stored program language for Tarantool. - -**Q. What's the key advantage of Tarantool?** - -A. Tarantool provides a fairly rich core feature set (HASH, TREE BITSET indexes, secondary indexes, composite indexes, -asynchronous replication, hot standby, data durability) along with support for Lua stored procedures. -These two properties make it possible to code fast, atomic and reliable in-memory data servers which handle non-trivial application-specific logic. The win over traditional SQL servers is in performance: low-overhead, lock-free architecture means Tarantool can serve -an order of magnitude more requests per second, on comparable hardware. The win over NoSQL alternatives is in flexibility: Lua allows flexible processing of data stored in a compact, denormalized format. - -**Q. What are your development plans?** - -A. They are standard. Performance. Better support for transactions. Master-master replication, automatic sharding. - -**Q. Who is developing Tarantool?** - -A. There is a small engineering team employed by Mail.ru -- check out our commit logs on github. The development is fully open, and most of the connectors authors and maintainers in different distributions are from the community. - -**Q. How serious is Mail.Ru about Tarantool?** - -A. Tarantool is an open source project, distributed under a BSD license, and as such does not depend on any one sponsor. However, it is currently and integral part of Mail.Ru backbone, so it gets a lot of support from Mail.ru. - -**Q. Why is Tarantool primary port number 33013?** - -A. It's a prime number which is easy to remember, because 3313, 3301, 313, 13 and 3 are also prime numbers. - -**Q. My arena_used/items_used in SHOW SLAB output is >> 1. What does it mean and what should I do?** - -A. If the ratio of arena_used to items_used >> 1, that indicates that there is fragmentation accumulated by the slab allocator. Imagine there are a lot of small tuples stored in the system initially, and later on each tuple becomes bigger and doesn't fit into its old slab size. The old slabs are never relinquished by the allocator. Currently this can be solved only by a server restart. - -{% page faq ru %} diff --git a/doc/www-data.in/index b/doc/www-data.in/index deleted file mode 100644 index 6b533dc3fb..0000000000 --- a/doc/www-data.in/index +++ /dev/null @@ -1,69 +0,0 @@ -{% page index en %} - -{% text blurb en %} - -# Tarantool -## An in-memory NoSQL database -###[Overview](intro.html) [Documentation](tarantool_user_guide.html) [Download](download.html) [Support](support.html) - -{% text blurb ru %} - -# Tarantool -## NoSQL СУБД Ð´Ð»Ñ Ð²Ñ‹Ñокой нагрузки -###[Введение](intro.html) [ДокументациÑ](tarantool_user_guide.html) [Скачать](download.html) [Поддержка](support.html) - -{% text tagline en %} - -# Introduction - -Tarantool is an in-memory database designed to store the most volatile -and highly accessible web content. Tarantool has been extensively used -in production since 2009. It's **open source**, BSD licensed. - -{% text tagline ru %} - -## Что такое Tarantool? - -Tarantool - раÑширÑемаÑ, Ñ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ð¸Ð¾Ð½Ð½Ð°Ñ Ð¡Ð£Ð‘Ð” Ð´Ð»Ñ Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ -запрашиваемых и чаÑто менÑющихÑÑ Ð´Ð°Ð½Ð½Ñ‹Ñ…. - -{% text features en %} - -# Features - -- [lowest CPU overhead](benchmark.html) to store or serve a -piece of content, -- optional Write Ahead Logging for persistency and reliability, -- universal data access with [rich Lua stored -procedures](http://github.com/mailru/tntlua), which can exchange messages -between each other or networked peers, -- asynchronous master-slave replication and hot backup. - -{% text example en %} - -# Get started - -<pre class="example"> -# apt-get install tarantool tarantool-client -# cd /etc/tarantool -# cp instances.available/example.cfg instances.enabled/fqueue.cfg -# cd /usr/share/tarantool/lua -# wget http://github.com/mailru/tntlua/raw/master/fqueue.lua -O init.lua -# service tarantool start -tarantool: Staring instances - Starting 'fqueue' ... ok -</pre> - -A fast and customizable message queue server is up and running. - -{% text links en %} - -# Learn more - -- [YCSB benchmark results](benchmark.html) -- [FAQ](faq.html) -- [Source repository](http://github.com/tarantool/tarantool) -- [Lua stored procedures repository]( http://github.com/mailru/tntlua) - - -{% page index ru %} diff --git a/doc/www-data.in/intro b/doc/www-data.in/intro deleted file mode 100644 index 488a51f072..0000000000 --- a/doc/www-data.in/intro +++ /dev/null @@ -1,194 +0,0 @@ -{% page intro en %} - -## What is Tarantool? - -Tarantool is an in-memory NoSQL -database. The code is available for free under the terms of -<em class="citetitle"><a class="citetitle" href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD" target="_top">BSD -license</a></em>. Supported platforms are GNU/Linux, Mac OS -and FreeBSD. - -## An overview of the architecture - -The server <span class="strong"><strong>maintains all its data in -random-access memory</strong></span>, and therefore has very low read -latency. At the same time, a copy of the data -is kept on non-volatile storage (a disk drive), and inserts -and updates are performed atomically. - -To ensure atomicity, consistency and crash-safety of the -persistent copy, a write-ahead log (WAL) is maintained, and -each change is recorded in the WAL before it is considered -complete. The logging subsystem supports group commit. - -If update and delete rate is high, a constantly growing write-ahead log file -(or files) can pose a disk space problem, and significantly increase time -necessary to restart from disk. A simple solution is employed: the server -<span class="strong"><strong>can be requested to save a concise -snapshot</strong></span> of its current data. The underlying operating -system's <span class="quote">“<span -class="quote">copy-on-write</span>”</span> feature is employed to take -the snapshot in a quick, resource-savvy and non-blocking manner. The <span -class="quote">“<span class="quote">copy-on-write</span>”</span> -technique guarantees that snapshotting has minimal impact on server -performance. - -<span class="strong"><strong>Tarantool is lock-free</strong></span>. -Instead of the operating system's concurrency primitives, such -as threads and mutexes, Tarantool uses a cooperative -multitasking environment to simultaneously operate on -thousands of connections. A fixed number of independent -execution threads within the server do not share state, but -exchange data using low overhead message queues. While this -approach limits server scalability to a few CPU cores, -it removes competition for the memory bus and sets -the scalability limit to the top of memory and network -throughput. CPU utilization of a typical highly-loaded -Tarantool server is under 10%. - -## Key features - -Unlike most of NoSQL databases, Tarantool supports primary, <span -class="strong"><strong> secondary keys, multi-part keys</strong></span>, -HASH, TREE and BITSET index types. - -Tarantool supports <span class="strong"><strong>Lua stored -procedures</strong></span>, which can access and modify data atomically. -Procedures can be created, modified and dropped at runtime. - -Use of Lua as an extension language does not end with stored -procedures: Lua programs can be used during startup, to define -triggers and background tasks, interact with networked peers. -Unlike popular application development frameworks implemented -around "reactor" pattern, networking in server-side Lua is -sequential, yet very efficient, as is built on top of the -cooperating multitasking environment used by the server -itself. - -Extended with Lua, Tarantool typically replaces -more not one but a few existing components with a single -well-performing system, changing and simplifying complex -multi-tier Web application architectures. - -Tarantool supports replication. Replicas may run locally or on -a remote host. Tarantool replication is asynchronous and does -not block writes to the master. When or if the master becomes -unavailable, the replica can be switched to assume the role of -the master without server restart. - -## How stable is the software? - -<span class="strong"><strong>The software is -production-ready</strong></span>. Tarantool has been created and is -actively used at <em class="citetitle"><a class="citetitle" -href="http://api.mail.ru" target="_top">Mail.Ru</a></em>, one of the leading -Russian web content providers. At Mail.Ru, the software serves the <span -class="quote">“<span class="quote">hottest</span>”</span> data, -such as online users and their sessions, online application properties, -mapping between users and their serving shards, and so on. - -Outside Mail.Ru -the software is used by a growing number of projects in online gaming, -digital marketing, social media industries. While product development is -sponsored by Mail.Ru, the roadmap, bugs database and the development process -are fully open. The software incorporates patches from dozens of community -contributors, and most of the programming language drivers are written and -supported by the community. - -{% page intro ru %} - -## What is Tarantool? - -Tarantool is an in-memory NoSQL -database. The code is available for free under the terms of -<em class="citetitle"><a class="citetitle" href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD" target="_top">BSD -license</a></em>. Supported platforms are GNU/Linux, Mac OS -and FreeBSD. - -## An overview of the architecture - -The server <span class="strong"><strong>maintains all its data in -random-access memory</strong></span>, and therefore has very low read -latency. At the same time, a copy of the data -is kept on non-volatile storage (a disk drive), and inserts -and updates are performed atomically. - -To ensure atomicity, consistency and crash-safety of the -persistent copy, a write-ahead log (WAL) is maintained, and -each change is recorded in the WAL before it is considered -complete. The logging subsystem supports group commit. - -If update and delete rate is high, a constantly growing write-ahead log file -(or files) can pose a disk space problem, and significantly increase time -necessary to restart from disk. A simple solution is employed: the server -<span class="strong"><strong>can be requested to save a concise -snapshot</strong></span> of its current data. The underlying operating -system's <span class="quote">“<span -class="quote">copy-on-write</span>”</span> feature is employed to take -the snapshot in a quick, resource-savvy and non-blocking manner. The <span -class="quote">“<span class="quote">copy-on-write</span>”</span> -technique guarantees that snapshotting has minimal impact on server -performance. - -<span class="strong"><strong>Tarantool is lock-free</strong></span>. -Instead of the operating system's concurrency primitives, such -as threads and mutexes, Tarantool uses a cooperative -multitasking environment to simultaneously operate on -thousands of connections. A fixed number of independent -execution threads within the server do not share state, but -exchange data using low overhead message queues. While this -approach limits server scalability to a few CPU cores, -it removes competition for the memory bus and sets -the scalability limit to the top of memory and network -throughput. CPU utilization of a typical highly-loaded -Tarantool server is under 10%. - -## Key features - -Unlike most of NoSQL databases, Tarantool supports primary, <span -class="strong"><strong> secondary keys, multi-part keys</strong></span>, -HASH, TREE and BITSET index types. - -Tarantool supports <span class="strong"><strong>Lua stored -procedures</strong></span>, which can access and modify data atomically. -Procedures can be created, modified and dropped at runtime. - -Use of Lua as an extension language does not end with stored -procedures: Lua programs can be used during startup, to define -triggers and background tasks, interact with networked peers. -Unlike popular application development frameworks implemented -around "reactor" pattern, networking in server-side Lua is -sequential, yet very efficient, as is built on top of the -cooperating multitasking environment used by the server -itself. - -Extended with Lua, Tarantool typically replaces -not one but a few existing components with a single -well-performing system, changing and simplifying complex -multi-tier Web application architectures. - -Tarantool supports replication. Replicas may run locally or on -a remote host. Tarantool replication is asynchronous and does -not block writes to the master. When or if the master becomes -unavailable, the replica can be switched to assume the role of -the master without server restart. - -## How stable is the software? - -<span class="strong"><strong>The software is -production-ready</strong></span>. Tarantool has been created and is -actively used at <em class="citetitle"><a class="citetitle" -href="http://api.mail.ru" target="_top">Mail.Ru</a></em>, one of the leading -Russian web content providers. At Mail.Ru, the software serves the <span -class="quote">“<span class="quote">hottest</span>”</span> data, -such as online users and their sessions, online application properties, -mapping between users and their serving shards, and so on. - -Outside Mail.Ru -the software is used by a growing number of projects in online gaming, -digital marketing, social media industries. While product development is -sponsored by Mail.Ru, the roadmap, bugs database and the development process -are fully open. The software incorporates patches from dozens of community -contributors, and most of the programming language drivers are written and -supported by the community. - diff --git a/doc/www-data.in/support b/doc/www-data.in/support deleted file mode 100644 index b2f0b67064..0000000000 --- a/doc/www-data.in/support +++ /dev/null @@ -1,20 +0,0 @@ -{% page support en %} - -# Getting support - -We are happy to provide help on [tarantool@groups.google.com](http://groups.google.com/group/tarantool). If you need immediate help, try to -ping maintainers on [#tarantool](http://webchat.freenode.net/?channels=#tarantool) channel at irc.freenode.net. - -Terms of commercial 24x7 support are available upon request, please send -an inquiry to [support@tarantool.org](mailto:support@tarantool.org). - -{% page support ru %} - -# Помощь и поддержа - -ТехничеÑкую поддержку можно получить в руÑÑкоÑзычном -ÑпиÑке раÑÑылки [tarantool-ru@groups.google.com](http://groups.google.com/group/tarantool-ru) -или на irc.freenode.net, канал [#tarantool](http://webchat.freenode.net/?channels=#tarantool). - -Ð”Ð»Ñ Ñ‚Ð¾Ð³Ð¾ чтобы узнать уÑÐ»Ð¾Ð²Ð¸Ñ ÐºÐ¾Ð¼Ð¼ÐµÑ€Ñ‡ÐµÑкой поддержки, -необходимо Ñделать Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ð¾ адреÑу [support@tarantool.org](mailto:support@tarantool.org). diff --git a/doc/www-data/global.css b/doc/www-data/global.css index e29c814c0a..ddf3052962 100644 --- a/doc/www-data/global.css +++ b/doc/www-data/global.css @@ -13,7 +13,7 @@ */ html { - font-size: 120%; /* 1 */ + font-size: 100%; /* 1 */ overflow-y: scroll; /* 2 */ -webkit-text-size-adjust: 100%; /* 3 */ -ms-text-size-adjust: 100%; /* 3 */ @@ -54,17 +54,17 @@ a:active { a:hover { outline: 0; background-color: rgba(0,0,0,0.1); - -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3); - -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3); - box-shadow: 0 1px 3px rgba(0,0,0,0.3); + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + box-shadow: 0 1px 3px rgba(0,0,0,0.3); } a.imglink:hover { border : 0; background-color: inherit; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } a:visited { @@ -87,7 +87,7 @@ h1 { * Addresses style set to 'bolder' in FF3+, S4/5, Chrome */ -b, strong { +b, strong { font-weight: bold; } @@ -118,9 +118,9 @@ pre { text-decoration: none; outline: 0; background-color: rgba(0,0,0,0.1); - -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3); - -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3); - box-shadow: 0 1px 3px rgba(0,0,0,0.3); + -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3); + box-shadow: 0 1px 3px rgba(0,0,0,0.3); } /* @@ -208,7 +208,7 @@ img { Tables ========================================================================== */ -/* +/* * Remove most spacing between table cells */ @@ -224,7 +224,7 @@ table { /* * Top-level page sections: - * body > #wrapper > #header #content #footer + * body > #wrapper > #header #content */ #wrapper { @@ -233,7 +233,7 @@ table { padding: 0; } -#header, #footer, #content { +#header, #content { margin: 0 auto; padding: 0; overflow: hidden; @@ -244,7 +244,7 @@ table { margin-bottom: 5px; } /* - * http://sonspring.com/journal/clearing-floats + * http://sonspring.com/journal/clearing-floats */ .clear { @@ -265,21 +265,12 @@ table { margin-left: auto; margin-right: auto; padding: 0 10px 0 0; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; clear: both; } -.lwrap { - float: left; -} - -.rwrap { - float: right; -} - .span_1, .span_2, .span_3, .span_4, .span_5, .span_6, .span_7, .span_8, .span_9, .span_10, .span_11, .span_12 { float: left; @@ -333,7 +324,7 @@ html, body, #wrapper { height: 100%; } -#wrapper, #header, #content, #footer { +#wrapper, #header, #content{ background-color: #fff; } @@ -341,34 +332,28 @@ html, body, #wrapper { padding-bottom: 5px; } -#footer img { - vertical-align: middle; -} - -#footer { - text-align: right; - padding-top: 16px -} - #blurb { - margin: 40px auto; + margin: 20px auto; } #blurb h1 { font-size: 2em; line-height: 1; text-align: center; + margin: 15px; } #blurb h2 { font-size: 1.2em; font-weight: normal; line-height: 1; - text-align: center + text-align: center; + margin: 5px; } #blurb h3 { - text-align: center + text-align: center; + margin: 5px; } /* ============================================================================= @@ -393,7 +378,7 @@ html, body, #wrapper { height: 100%; } .b-tabs__list{ - padding: 0px; + padding: 0px; list-style: none; border: 1px solid #b2b2b2; border-bottom: 0; @@ -433,7 +418,7 @@ html, body, #wrapper { margin: 0 auto; } .b-tabs__buttons{ - padding: 0; + padding: 0; right: 20px; border: 2px solid #b2b2b2; -webkit-border-radius: 5px; @@ -465,5 +450,6 @@ html, body, #wrapper { } h3 { - text-align:center; + text-align:center; } + diff --git a/extra/static.py b/extra/static.py index 866bc2716f..8cf094c139 100755 --- a/extra/static.py +++ b/extra/static.py @@ -1,329 +1,149 @@ #!/usr/bin/env python -# -# This script is used to build www.tarantool.org -# import os -import re import sys import yaml +import shlex import jinja2 -import markdown -import argparse -import fnmatch -import glob import shutil -import datetime - +import fnmatch +import subprocess -default_lang = { - 'source-encoding': 'utf-8', - 'output-encoding': 'utf-8', - 'suffix': '.html' } +from markdown import markdown +mdext = [ + 'codehilite', + 'fenced_code', + 'footnotes', + ] -class Config(object): +class MockConfig(object): def __init__(self): - self.source_path = '.' - self.config_file = '_config' - self.ignore_file = '_ignore' - self.corpus_dir = '.' - self.layout_dir = '_layout' - self.output_dir = 'www' - self.abs_output_path = None - self.config = {} - - def __getitem__(self, key): - return self.config[key] - - @property - def config_path(self): - return os.path.join(self.source_path, self.config_file) - @property - def corpus_path(self): - return os.path.join(self.source_path, self.corpus_dir) - @property - def layout_path(self): - return os.path.join(self.source_path, self.layout_dir) - @property - def output_path(self): - if self.abs_output_path: - return self.abs_output_path - return os.path.join(self.source_path, self.output_dir) - - @output_path.setter - def output_path(self, value): - self.abs_output_path = value - - def check(self, key, config): - if config and key in config: - value = config[key] - print 'set %s to %s' % (key, value) - setattr(self, key, value) - del config[key] - - def load(self): - f = open(self.config_path) - config = yaml.load(f) - f.close() - self.check('layout_dir', config) - self.check('output_dir', config) - self.config = config - #print config - - def check_ignore_dir(self, path, name, ignore_list): - if fnmatch.fnmatch(name, '_*'): - return True - pathname = os.path.normpath(os.path.join(path, name)) - if pathname in ignore_list: - return True - return False - - def check_ignore_file(self, path, name, ignore_list): - if fnmatch.fnmatch(name, '_*'): - return True - if fnmatch.fnmatch(name, '*~'): - return True - pathname = os.path.normpath(os.path.join(path, name)) - if pathname in ignore_list: - return True - return False - - def load_ignore_file(self, path, ignore_list): - try: - f = open(os.path.join(path, self.ignore_file)) - words = f.read().split() - f.close() - for word in words: - pattern = os.path.normpath(os.path.join(path, word)) - names = glob.glob(pattern) - ignore_list.extend(names) - except: - pass - - def get_corpus(self): - list = [] - ignore_list = [ os.path.normpath(self.output_path) ] - root = self.corpus_path - walker = os.walk(root) - for curdir, subdirs, files in walker: - self.load_ignore_file(curdir, ignore_list) - for s in subdirs[:]: - if self.check_ignore_dir(curdir, s, ignore_list): - subdirs.remove(s) - for f in files: - if not self.check_ignore_file(curdir, f, ignore_list): - dir = curdir.replace(root, '') - list.append(os.path.normpath(os.path.join(dir, f))) - #print list - return list - - -class Scanner(object): - - HEAD_OPEN = r'{%' - HEAD_CLOSE = r'%}' - - WS = re.compile(r'\s+') - WORD = re.compile(r'\w+') - BODY = re.compile(r'.*?(?=\s*^\s*%s)' % re.escape(HEAD_OPEN), re.M | re.S) - - def __init__(self, name, config): - f = open(os.path.join(config.source_path, name)) - self.data = f.read() - f.close() - self.name = name - self.pos = 0 - self.token = None - - def __iter__(self): - return self - - def match(self, cre): - m = cre.match(self.data, self.pos) - if m: - self.pos = m.end() - self.token = m.group() - return True - return False - - def match_str(self, str): - if self.data.startswith(str, self.pos): - self.pos += len(str) - self.token = str - return True - return False - - def read_tags(self): - tags = [] - if self.match_str(self.HEAD_OPEN): - self.match(self.WS) - while self.match(self.WORD): - tags.append(self.token) - self.match(self.WS) - if not self.match_str(self.HEAD_CLOSE): - print self.data[self.pos:] - raise RuntimeError() - return tags - - def read_text(self): - self.match(self.WS) - if self.match(self.BODY): - text = self.token - else: - text = self.data[self.pos:] - self.pos = len(self.data) - return text - - def next(self): - self.match(self.WS) - if self.pos == len(self.data): - raise StopIteration - return self.name, self.read_tags(), self.read_text() - - -@jinja2.contextfilter -def langselect(context, data): - if isinstance(data, dict): - lang = context['pagelang'] - if lang in data: - data = data[lang] - else: - data = data['en'] - return data - - -def make_environ(path): - env = jinja2.Environment(loader = jinja2.FileSystemLoader(path)) - env.filters['langselect'] = langselect - env.globals['date'] = datetime.datetime.today() - return env + self.output_path = '../www-data/' + self.layout_dir = '_layout/' + self.text_dir = '_text/' + self.doc = 'doc/{branch}' + self.doc_mpage = 'mpage/' + self.doc_opage = 'user_guide.html' + self.doc_css = '../user/tnt.css' -class BaseHandler(object): - +class Loader(object): def __init__(self, config): self.config = config - - def enter(self, entry): - pass - - def render(self, entry): - pass - - -class PageHandler(BaseHandler): - - def __init__(self, config): - super(PageHandler, self).__init__(config) - self.environ = make_environ(config.layout_path) + self.texts = {} + self.load_texts() + self.environ = self.make_environ(config.layout_dir, self.texts) + + def load_texts(self): + for i in os.listdir(self.config.text_dir): + i = os.path.join(self.config.text_dir, i) + with open(i, 'r') as f: + self.texts.update(yaml.load(f.read())) + for l, i in self.texts.iteritems(): + if isinstance(i, dict): + for j, k in i.iteritems(): + i[j] = markdown(k, extensions=mdext) + elif isinstance(i, basestring): + self.texts[l] = markdown(i, extensions=mdext) + else: + raise Exception("hi") + + def make_environ(self, path, texts): + env = jinja2.Environment(loader = jinja2.FileSystemLoader(path)) + env.globals.update(texts) + return env def write(self, name, data): print 'Writing %s' % name - f = open(os.path.join(self.config.output_path, name), 'w') - f.write(data) - f.close - - def render(self, entry): - name, tags, text = entry - if len(tags) < 2: - raise StandardError('missing template name for page entry') - layout = tags[1] - lang = tags[2] if tags and len(tags) > 2 else Nil - if lang and lang in self.config['languages']: - langdesc = self.config['languages'][lang] - else: - langdesc = default_lang - text = unicode(text, langdesc['source-encoding']) - text = markdown.markdown(text, ['tables']) - filename = name + langdesc['suffix'] - template = self.environ.get_template(layout, globals=self.config.config) - page = template.render( - content=text, - filename=filename, - pagename=name, - pagelang=lang) - self.write(filename, page.encode(langdesc['output-encoding'])) - - -class DataHandler(BaseHandler): - pass - - -class TextHandler(BaseHandler): - - def enter(self, entry): - name, tags, text = entry - if len(tags) < 2: - raise StandardError('missing item name for text entry') - item = tags[1] - lang = tags[2] if tags and len(tags) > 2 else 'en' - if lang and lang in self.config['languages']: - langdesc = self.config['languages'][lang] - else: - langdesc = default_lang - text = unicode(text, langdesc['source-encoding']) - text = markdown.markdown(text) - self.config.config.setdefault(item, {})[lang] = text; - - -class PostHandler(TextHandler): - pass - - -class Renderer(object): - - def __init__(self, config): - self.handlers = { 'page': PageHandler(config), - 'data': DataHandler(config), - 'text': TextHandler(config), - 'post': PostHandler(config) } - - def get_handler(self, tags): - entry_type = tags[0] if tags and len(tags) > 0 else 'page' - if entry_type not in self.handlers: - raise ValueError('bad entry type %s' % entry_type) - return self.handlers[entry_type] - - def enter_entry(self, entry): - handler = self.get_handler(entry[1]) - handler.enter(entry); - - def render_entry(self, entry): - handler = self.get_handler(entry[1]) - handler.render(entry); - - def render(self, entries): - for entry in entries: - self.enter_entry(entry) - for entry in entries: - self.render_entry(entry) - - -def parse_args(config): - parser = argparse.ArgumentParser() - parser.add_argument('--config-file') - parser.add_argument('--source-path') - parser.add_argument('--output-path') - parser.parse_args(namespace = config) - -def load_entries(config): - entries = [] - corpus = config.get_corpus() - for name in corpus: - scanner = Scanner(name, config) - for entry in iter(scanner): - entries.append(entry) - print 'Loaded content file "%s"' % name - return entries - -def main(): - config = Config() - parse_args(config) - config.load() - renderer = Renderer(config) - entries = load_entries(config) - renderer.render(entries) + with open(os.path.join(self.config.output_path, name), 'w') as f: + f.write(data) + + def render(self, name): + filename = name + '.html' + template = self.environ.get_template(name) + page = template.render() + self.write(filename, page) + + def render_pages(self): + for name in self.texts: + self.render(name) + + def gener_docs_header(self, branch, one_page): + assert(branch=='master' or branch=='stable') + header = """ +<div id="headwrap" class="columnlist"> + <div id="headl" class="column">{0}</div> + <div id="headr" class="column">{1}</div> +</div> + """ + lheader = """ +### [Home](/) -> [Documentation](/doc/) """ + rheader = """ +### [{bn}][{b}{o}] / [{bno}][{bo}{o}] + +[mpdf]: /doc/master/user_guide.pdf +[mtxt]: /doc/master/user_guide.txt +[mopa]: /doc/master/user_guide.html +[mmpa]: /doc/master/mpage/index.html + +[spdf]: /doc/stable/user_guide.pdf +[stxt]: /doc/stable/user_guide.txt +[sopa]: /doc/stable/user_guide.html +[smpa]: /doc/stable/mpage/index.html """ + + env = { + 'b' : branch[0], + 'bn' : branch.capitalize(), + 'bo' : 'm' if branch[0] == 's' else 's', + 'bno' : ('master' if branch == 'stable' else 'stable').capitalize(), + 'o' : 'mpa' if one_page else 'opa', + 'opage': 'Multiple pages' if one_page else 'One page', + } + + return header.format(markdown(lheader), markdown(rheader.format(**env), extensions=mdext)) + + def render_docs(self): + proc = subprocess.Popen(shlex.split('git rev-parse --abbrev-ref HEAD'), stdout=subprocess.PIPE) + branch = proc.communicate()[0].strip() + docs_template = self.environ.get_template('documentation') + # ========================================== + doc_mpath = os.path.join(self.config.doc, self.config.doc_mpage).format(branch=branch) + doc_mpath_out = os.path.join(self.config.output_path, doc_mpath) + header = self.gener_docs_header(branch, False) + if os.path.exists(doc_mpath): + if not os.path.exists(doc_mpath_out): + os.makedirs(doc_mpath_out) + for i in os.listdir(doc_mpath): + document = os.path.join(doc_mpath, i) + env = {'documentation': {'main' : open(document).read(), + 'header': header}, + 'docs': 'True'} + data = docs_template.render(env) + self.write(document, data) + shutil.copy(self.config.doc_css, doc_mpath_out) + # =========================================== + doc_opath = self.config.doc.format(branch=branch) + doc_opage = os.path.join(doc_opath, self.config.doc_opage) + doc_opath_out = os.path.join(self.config.output_path, doc_opath) + if os.path.exists(doc_opage) and os.path.isfile(doc_opage): + if not os.path.exists(doc_opath_out): + os.makedirs(doc_opath_out) + env = {'documentation': {'main' : open(doc_opage).read(), + 'header': header}, + 'docs': 'True'} + data = docs_template.render(env) + self.write(doc_opage, data) + shutil.copy(self.config.doc_css, doc_opath_out) + # =========================================== if __name__ == '__main__': - main() + loader = Loader(MockConfig()) + if len(sys.argv) == 1 or sys.argv[1] == 'site': + loader.render_pages() + exit(0) + elif sys.argv[1] == 'docs': + loader.render_docs() + exit(0) + else: + exit(1) -- GitLab