diff --git a/.gitignore b/.gitignore index 1927572f6fd52ef19b6c45bdc610d3ecb7c42f64..cfa16a9aaea15116855b4915598aa214975f40ea 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ third_party/luajit/src/lj_vm.s test/connector_c/tt test/connector_c/update *.reject +doc/www-data/*.html +doc/www-data/*.ru.html +doc/www-data.in/download diff --git a/CMakeLists.txt b/CMakeLists.txt index 8510e3fcf33c5d1b6b34c55fb66ec421f7816880..a15301f1fb109571bbc8b3fbce5260ba90153e40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,10 @@ configure_file( "${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 8773e58b4d49fe14e08a8a1a4b4d6904ecbfe33d..d38b79a0364bc032489b0ab86f99f2894d0422b5 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(user) add_subdirectory(developer) +add_subdirectory(www-data.in) diff --git a/doc/developer/CMakeLists.txt b/doc/developer/CMakeLists.txt index d4cd5d356bea6d223fb13811f1965042579a862d..4181c4786710383a32c56d20fc9ae0e32eb4c8f0 100644 --- a/doc/developer/CMakeLists.txt +++ b/doc/developer/CMakeLists.txt @@ -1,7 +1,7 @@ add_custom_target(dev-html ALL COMMAND ${XSLTPROC} --nonet --stringparam collect.xref.targets "all" - --xinclude -o tarantool_developer_guide.html + --xinclude -o ${PROJECT_BINARY_DIR}/doc/www-data/tarantool_developer_guide.html ${CMAKE_SOURCE_DIR}/doc/user/tnt-html.xsl developer.xml) diff --git a/doc/user/CMakeLists.txt b/doc/user/CMakeLists.txt index 1750c45970e16b55eefaa03388d8764543f1cc79..c1cf498f8cb4a87fb818c129c53c90f10b29366a 100644 --- a/doc/user/CMakeLists.txt +++ b/doc/user/CMakeLists.txt @@ -1,7 +1,7 @@ add_custom_target(html ALL COMMAND ${XSLTPROC} --nonet --stringparam collect.xref.targets "all" - --xinclude -o tarantool_user_guide.html + --xinclude -o ${PROJECT_BINARY_DIR}/doc/www-data/tarantool_user_guide.html tnt-html.xsl user.xml) @@ -16,7 +16,7 @@ add_custom_target(pdf add_custom_target(relink COMMAND ${XSLTPROC} --nonet --stringparam collect.xref.targets "only" - --xinclude -o tarantool_user_guide.html + --xinclude -o ${PROJECT_BINARY_DIR}/doc/www-data/tarantool_user_guide.html tnt-html.xsl user.xml) @@ -29,7 +29,7 @@ add_custom_target(html-saxon -x org.apache.xml.resolver.tools.ResolvingXMLReader -y org.apache.xml.resolver.tools.ResolvingXMLReader -r org.apache.xml.resolver.tools.CatalogResolver - -u -o tarantool_user_guide.html user.xml tnt-html.xsl) + -u -o ${PROJECT_BINARY_DIR}/doc/www-data/tarantool_user_guide.html user.xml tnt-html.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" diff --git a/doc/www-data.in/CMakeLists.txt b/doc/www-data.in/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb092d3d9bf63e7b3d59a12367965ac4b2c8bb65 --- /dev/null +++ b/doc/www-data.in/CMakeLists.txt @@ -0,0 +1,4 @@ +add_custom_target(www-data ALL + COMMAND ${PROJECT_SOURCE_DIR}/scripts/static.py + --source-path ${PROJECT_SOURCE_DIR}/doc/www-data.in + --output-path ${PROJECT_BINARY_DIR}/doc/www-data) diff --git a/doc/www-data.in/_config b/doc/www-data.in/_config new file mode 100644 index 0000000000000000000000000000000000000000..97b70bf13dcbf56d422f97cad8938913c943da1b --- /dev/null +++ b/doc/www-data.in/_config @@ -0,0 +1,11 @@ + +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/Box - Front page', ru: 'Tarantool/Box - ГлавнаÑ' } + +# 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 new file mode 100644 index 0000000000000000000000000000000000000000..c56389fbc08cf699bf2c728c36fede7782f38d9e --- /dev/null +++ b/doc/www-data.in/_ignore @@ -0,0 +1,7 @@ +README +*.py *.pyc +CMakeLists.txt +CMakeFiles +cmake_install.cmake +download.cmake +Makefile diff --git a/doc/www-data.in/_layout/base b/doc/www-data.in/_layout/base new file mode 100644 index 0000000000000000000000000000000000000000..567481a9e07b593c60d3af759c9416e58c8b48c4 --- /dev/null +++ b/doc/www-data.in/_layout/base @@ -0,0 +1,44 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<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" /> +{% include "script" ignore missing %} +</head> +<body id="tarantool"> + +<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> + {% endblock header %} + </div> + + <div id="content"> + {% block content %} + <div class="grid"> + <div id="sidebar" class="span_3"> + <div class="clear"></div> + {{ sidebar | langselect }} + </div> + <div id="main" class="span_8"> + {% block prologue %}{% endblock %} + {{ content }} + {% block epilogue %}{% endblock %} + </div> + </div> + {% endblock content %} + </div> + + <div id="footer"> + {% block footer %} + <p>Sponsored by <a 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 new file mode 100644 index 0000000000000000000000000000000000000000..80cf7ac1510ffcb7b0c24f3d28117d0dcae98337 --- /dev/null +++ b/doc/www-data.in/_layout/benchmark @@ -0,0 +1,2 @@ +{% extends "base" %} +{% set title = "Tarantool/Box: a benchmark" %} diff --git a/doc/www-data.in/_layout/docs b/doc/www-data.in/_layout/docs new file mode 100644 index 0000000000000000000000000000000000000000..68623fc1de2b8fd493d94b8098cd1552f0012ae8 --- /dev/null +++ b/doc/www-data.in/_layout/docs @@ -0,0 +1,2 @@ +{% extends "base" %} +{% set title = "Tarantool/Box documentation" %} diff --git a/doc/www-data.in/_layout/download b/doc/www-data.in/_layout/download new file mode 100644 index 0000000000000000000000000000000000000000..af503d442bd460bf1585f3a531a474e5994a38e6 --- /dev/null +++ b/doc/www-data.in/_layout/download @@ -0,0 +1,2 @@ +{% extends "base" %} +{% set title = "Tarantool/Box: downloads" %} diff --git a/doc/www-data.in/_layout/faq b/doc/www-data.in/_layout/faq new file mode 100644 index 0000000000000000000000000000000000000000..7b42d7633d67e701b0f6d81bc844e2a8210f4a67 --- /dev/null +++ b/doc/www-data.in/_layout/faq @@ -0,0 +1,2 @@ +{% extends "base" %} +{% set title = "Tarantool/Box: Frequently Asked Questions" %} diff --git a/doc/www-data.in/_layout/home b/doc/www-data.in/_layout/home new file mode 100644 index 0000000000000000000000000000000000000000..57cee8c12ec5fe2ebd335c89de6ddcfa9f822a27 --- /dev/null +++ b/doc/www-data.in/_layout/home @@ -0,0 +1,53 @@ +{% extends "base" %} +{% set title = "Tarantool/Box -- an efficient in-memory data store" %} + + {% block content %} + <div id="blurb" class="span_12"> + + <img id="logo" src="logo.png" alt="Tarantool/Box Logo" /> + + {{ blurb | langselect }} + + <div class="clear"></div> + + </div> + + <div class="grid"> + + <div class="lwrap"> + + <div id="blocks"> + + <div id="docs" class="span_4"> + <div class='front_block'> + {{ home_page_learn | langselect }} + </div> + </div> + + <div id="use" class="span_4"> + <div class='front_block'> + {{ home_page_use | langselect }} + </div> + </div> + + <div id="join" class="span_4"> + <div class='front_block'> + {{ home_page_join | langselect }} + </div> + </div> + + <div class="clear"></div> + + </div> + <div class="span_9"> + <div id="news" class='news_block'> + {{ home_page_news | langselect }} + </div> + </div> + + </div> + + <div class="clear"></div> + + </div> <!-- grid --> + {% endblock content%} diff --git a/doc/www-data.in/_layout/intro b/doc/www-data.in/_layout/intro new file mode 100644 index 0000000000000000000000000000000000000000..c0323af768aaba8e361b99b40a8d29f38c663c7a --- /dev/null +++ b/doc/www-data.in/_layout/intro @@ -0,0 +1,2 @@ +{% extends "base" %} +{% set title = "Tarantool/Box: an introduction" %} diff --git a/doc/www-data.in/_layout/script b/doc/www-data.in/_layout/script new file mode 100644 index 0000000000000000000000000000000000000000..b52d26b30a89345552273f54bfff5875bee431e3 --- /dev/null +++ b/doc/www-data.in/_layout/script @@ -0,0 +1,13 @@ +<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> diff --git a/doc/www-data.in/benchmark b/doc/www-data.in/benchmark new file mode 100644 index 0000000000000000000000000000000000000000..5a1658e3775a1a7c0a8be07f619ff9874e60a870 --- /dev/null +++ b/doc/www-data.in/benchmark @@ -0,0 +1,6 @@ +{% page benchmark en %} + + +{% page benchmark ru %} + + diff --git a/doc/www-data.in/docs b/doc/www-data.in/docs new file mode 100644 index 0000000000000000000000000000000000000000..4b18b9a109beb34e04f72c693ed8100e863686a2 --- /dev/null +++ b/doc/www-data.in/docs @@ -0,0 +1,27 @@ +{% page docs en %} + +Documentation +============= + +- [Tarnatool/Box User Guide](http://tarantool.org/tarantool_user_guide.html) +- [Tarnatool/Box Developer guide](http://tarantool.org/tarantool_user_guide.html) + +## Where to get more help + +- [discussion list](http://groups.google.com/group/tarantool) +- [developer list](http://lists.launchpad.net/tarantool-developers) + +{% page docs ru %} + +Ð”Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ +============ + +ПользовательÑÐºÐ°Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ð½Ð° данный момент +доÑтупна только на английÑком Ñзыке. + +## Другие иÑточники: + +* руÑÑкоÑзычный ÑпиÑок раÑÑылки +* ÑÑ‚ÐµÐ½Ð¾Ð³Ñ€Ð°Ñ„Ð¸Ñ Ð´Ð¾ÐºÐ»Ð°Ð´Ð° на Форуме Технологий Mail.Ru +* Ñтатьи на habrahabr.ru + diff --git a/doc/www-data.in/download.cmake b/doc/www-data.in/download.cmake new file mode 100644 index 0000000000000000000000000000000000000000..6873671f03c045f1551edfa84f1d4e6f140ee54a --- /dev/null +++ b/doc/www-data.in/download.cmake @@ -0,0 +1,159 @@ +{% page download en %} + +### What's in the package + +Each binary package includes the server binary, *tarantool_box*, +the command line client, *tarantool*, instance management +script, *tarantool.sh*, a script to add more instances, +*tarantool_expand.sh*, and, last but not least, man pages and the user +guide. + +### How to choose the right version for download + +Tarantool/Box uses a 3-digit versioning scheme +<major>-<minor>-<patch>. +Major digits change rarely. A minor version increase +indicates an incompatibile change. Minor version change happens +when 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 **@TARANTOOL_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. + +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. + +The latest build can be found below. + +<table border=1 title="Download the latest build, @TARANTOOL_VERSION@" width=100%> + + <tr width=60%> + <td colspan=1>Source tarball</td> + <td colspan=3 align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@.src.tar.gz">tarantool-@TARANTOOL_VERSION@.src.tar.gz</a> + </td> + </tr> + + <th colspan=3>Linux</th> + +<!-- Debian --> + + <tr> + <td> + Debian software package (<b>.deb</b>) + </td> + + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686.deb">32-bit</a> + </td> + + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686.deb">64-bit</a> + </td> + </tr> + + <tr> + <td> + Debian software package (<b>.deb</b>), with debug info + </td> + <td align=center> + <a + href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686-debug.deb">32-bit</a> + </td> + + <td align=center> + <a + href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-x864_64-debug.deb">64-bit</a> + </td> + </tr> + +<!-- RPM --> + + <tr> + <td> + RedHat <b>.rpm</b> + </td> + + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686.rpm">32-bit</a> + </td> + + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686.rpm">64-bit</a> + </td> + </tr> + + <tr> + <td> + RedHat <b>.rpm</b>, with debug info + </td> + <td align=center> + <a + href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686-debug.rpm">32-bit</a> + </td> + + <td align=center> + <a + href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-x864_64-debug.rpm">64-bit</a> + </td> + </tr> + +<!-- .tar.gz --> + + <tr> + <td> + Binary tarball (<b>.tar.gz</b>) + </td> + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-i686.tar.gz">32-bit</a> + </td> + + <td align=center> + <a href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-linux-x86_64.tar.gz">64-bit</a> + </td> + </tr> + + <th colspan=3>FreeBSD</th> + +<!-- .tar.gz --> + + <tr> + <td> + Binary tarball (<b>.tar.gz</b>) + </td> + <td align=center> + <a + href="http://tarantool.org/dist/tarantool-@TARANTOOL_VERSION@-freebsd-i386.tar.gz">32-bit</a> + </td> + + <td align=center> + </td> + </tr> + <th colspan=4>Mac OS X</th> + <tr> + <td align=center colspan=4><i>Coming soon...</i></td> + <tr> + +</table> + +### All downloads + +An archive of old releases can be found at <a +href="http://tarantool.org/dist">here</a>. + +### Connectors + +- Perl driver, [CPAN home](http://search.cpan.org/~yuran/MR-Tarantool/) +- [Ruby driver](https://github.com/mailru/tarantool-ruby) +- Python driver, [hosted at pypi.python.org](http://pypi.python.org/pypi/tarantool) +{% page download ru %} + +<!-- vim: syntax=html +--> diff --git a/doc/www-data.in/faq b/doc/www-data.in/faq new file mode 100644 index 0000000000000000000000000000000000000000..41ba2e7b78c15ad82fe61ead9d692de09036df5f --- /dev/null +++ b/doc/www-data.in/faq @@ -0,0 +1,67 @@ +{% page faq en %} + +## Frequently Asked Questions + +**Q. Why Tarantool?** + +A. Tarantool is a result of long trial and error process within Mail.Ru. It's an 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. What's the key advantage of Tarantool?** + +A. Tarantool provides a fairly rich core feature set (HASH and TREE indexes, secondary indexes, composite indexes, +asynchronous replication, hot standby, data durability) along with support for Lua stored procedures. +These two properties allow 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 allows to serve +an order of magnitude more RPS on comparable hardware. The win over NoSQL alternatives is in flexibility: Lua allows to flexibly process data stored in compact, not normalized format. + +**Q. What are your development plans?** + +A. Performance. Better support for transactions. Advanced replication and clustering features. + +**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 Python and PHP drivers are written by Konstantin Cherkasoff and Alexander Kalendarev from community. + +**Q. How serious is Mail.Ru about Tarantool?** + +A. Tarantool is an open source project, distributed under BSD license, and as such does not depend on any one sponsor. However, it is currently and integral part of Mail.Ru backbone, and because of that, 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. A ratio of arena_used to items_used >> 1 indicates that there shore/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 %} + +**Q. Why Tarantool?** + +A. Tarantool is a result of long trial and error process within Mail.Ru. It's an 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. What's the key advantage of Tarantool?** + +A. Tarantool provides a fairly rich core feature set (HASH and TREE indexes, secondary indexes, composite indexes, +asynchronous replication, hot standby, data durability) along with support for Lua stored procedures. +These two properties allow 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 allows to serve +an order of magnitude more RPS on comparable hardware. The win over NoSQL alternatives is in flexibility: Lua allows to flexibly process data stored in compact, not normalized format. + +**Q. What are your development plans?** + +A. Performance. Better support for transactions. Advanced replication and clustering features. + +**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 Python and PHP drivers are written by Konstantin Cherkasoff and Alexander Kalendarev from community. + +**Q. How serious is Mail.Ru about Tarantool?** + +A. Tarantool is an open source project, distributed under BSD license, and as such does not depend on any one sponsor. However, it is currently and integral part of Mail.Ru backbone, and because of that, 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. A ratio of arena_used to items_used >> 1 indicates that there shore/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/index b/doc/www-data.in/index new file mode 100644 index 0000000000000000000000000000000000000000..17a6576177bffaa47e4f9b13b4cea082081ae644 --- /dev/null +++ b/doc/www-data.in/index @@ -0,0 +1,102 @@ +{% text blurb en %} + +# Tarantool/Box - an efficient in-memory data store +##Tarantool is an extensible, persistent, transactional database, designed to store the most volatile and highly accessible web data. + +{% text blurb ru %} + +# Tarantool/Box - NoSQL СУБД Ð´Ð»Ñ Ð²Ñ‹Ñокой нагрузки +## Tarantool - раÑширÑемаÑ, Ñ‚Ñ€Ð°Ð½Ð·Ð°ÐºÑ†Ð¸Ð¾Ð½Ð½Ð°Ñ Ð¡Ð£Ð‘Ð” Ð´Ð»Ñ Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ запрашиваемых и чаÑто менÑющихÑÑ Ð´Ð°Ð½Ð½Ñ‹Ñ…. + +{% text home_page_news en %} + +What's new +========== + +2012-02-18: <a href="http://tarantool.org">http://tarantool.org</a> gets a new look! + +2011-10-07: <a href="http://tarantool.org/dist/tarantool-1.4.3-3-g45804c6-src.tar.gz">Tarantool 1.4.3</a>, stable version of 1.4 branch. + +2011-08-25: Tarantool 1.4.2, featuring Lua stored prcoedures, is out. + +2011-06-05: <a href="http://tarantool.org/tarantool_user_guide.html">Tarantool User Guide</a> is published. + +2011-05-14: <a href="http://launchpad.net/tarantool/1.3/1.3.5/+download/tarantool-1.3.5-src.tar.gz">tarantool-1.3.5</a> (stable) is out. + +{% text home_page_news ru %} + +ÐовоÑти +======= + +2012-02-18: Ðовый дизайн <a href="http://tarantool.org">http://tarantool.org</a> + +2011-10-07: <a href="http://tarantool.org/dist/tarantool-1.4.3-3-g45804c6-src.tar.gz">Tarantool 1.4.3</a>, stable version of 1.4 branch. + +2011-08-25: Tarantool 1.4.2, featuring Lua stored prcoedures, is out. + +2011-06-05: <a href="http://tarantool.org/tarantool_user_guide.html">Tarantool User Guide</a> is published. + +2011-05-14: <a href="http://launchpad.net/tarantool/1.3/1.3.5/+download/tarantool-1.3.5-src.tar.gz">tarantool-1.3.5</a> (stable) is out. + +{% text home_page_learn en %} + +Learn more +===================== + +- [Introduction](intro.html) +- [Frequently Aasked Questions](faq.html) +- [A benchmark](benchmark.html) + +{% text home_page_learn ru %} + +Узнать больше +======================== + +- [Обзор](about.ru.html) +- ÑÑ‚Ð°Ñ‚ÑŒÑ Ð½Ð° habrahabr +- [Wiki](http://github.com/mailru/tarantool/wiki) + +{% text home_page_use en %} + +Use Tarantool +============ +- <p id="download"><a id="current_download" href="download.html">Download Tarantool</a></p> +- [Read the User Guide](tarantool_user_guide.html) +- [Browse a stored procedures archive](http://github.com/mailru/tntlua) +- [Join the mailing list](http://groups.google.com/group/tarantool/subscribe) +- [Report a bug](https://bugs.launchpad.net/tarantool/+filebug) +- [View features and milestones](https://launchpad.net/tarantool) + +{% text home_page_use ru %} + +ИÑпользовать Tarantool +====================== + +- [ИÑходный код](https://github.com/mailru/tarantool) +- [База дефектов](http://bugs.launchpad.net/tarantool) +- [ДокументациÑ](tarantool_user_guide.html) +- IRC: #tarantool on irc.freenode.net + +{% text home_page_join en %} + +Get Involved +============ + +- [Browse Git source](https://github.com/mailru/tarantool) +- [Read the developer guide](tarantool_developer_guide.html) +- [IRC chat with developers](http://webchat.freenode.net/?channels=tarantool) +- [Developer list archives](https://lists.launchpad.net/tarantool-developers/) +- [Help improve our Wiki](http://github.com/mailru/tarantool/wiki) + +{% text home_page_join ru %} + +УчаÑтие +======= + +- [Code Repo](https://github.com/mailru/tarantool) +- [Bugs](http://bugs.launchpad.net/tarantool) +- IRC: #tarantool on irc.freenode.net + +{% page home en %} + +{% page home ru %} diff --git a/doc/www-data.in/intro b/doc/www-data.in/intro new file mode 100644 index 0000000000000000000000000000000000000000..1840b3fd60a520ee7275197ca31fe39c87d336dc --- /dev/null +++ b/doc/www-data.in/intro @@ -0,0 +1,58 @@ +{% page intro en %} + +## What is Tarantool? + +Tarantool/Box, or simply Tarantool, is a high performance key/value storage server. The code is available for free under the terms of <em><a href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD">BSD license</a></em>. Supported platforms are GNU/Linux 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 can handle read requests blazingly fast. 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. + +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 underlying operating system's concurrency primitives, Tarantool uses cooperative multitasking environment to simultaneously operate on thousands of connections. While this approach limits server scalability to a single CPU core, in practice 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%. + +## Main features + +A key feature of Tarantool is support for stored procedures, which can +access and modify data atomically. Procedures can be created, modified, +dropped at runtime. With stored procedures, it's possible to +turn Tarantool into a highly flexible and extremely fast social web +application server. + +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. + +## How stable is the software? + +<span class="strong"><strong>The software is +production-ready</strong></span>. Tarantool has been developed and is +actively used at <em><a href="http://api.mail.ru">Mail.Ru</a></em> one of +the leading Russian web content providers, since 2008. At Mail.Ru, the sowtware serves the <span class="quote">“<span class="quote">hottest</span>”</span> data, such as online users and their sessions, online application properties, the map between users and their serving shards. + +To conclude, Tarantool/Box is ideal for highly volatile and/or highly accessed Web data. With Tarantool, performance overhead on serving data is minimal: a single server can easily deal with tens or even hundreds of thousands of requests per second. Snapshots can be made when Web user activity is at its lowest, for example at night, and thus add little or no restraint on the top throughput of the system. If the master becomes unavailable, a replica can assume the role of the master with minimal downtime. + +{% page intro ru %} + +<b>Tarantool</b> — однопоточный TCP Ñервер, реализующий кооперативную многозадачноÑÑ‚ÑŒ. РазрабатываетÑÑ Ñ ÑƒÑ‡ÐµÑ‚Ð¾Ð¼ работы под выÑокими нагрузками (деÑÑтки Ñ‚Ñ‹ÑÑч RPS). Можно выделить две логичеÑкие ÑоÑтавлÑющие: Ñдро и модули. Ð’ наÑтоÑщее Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ðµ модулей производитÑÑ Ð½Ð° Ñтапе компилÑции. Ðа уровне Ñдра реализуетÑÑ Ð±Ð°Ð·Ð¾Ð²Ñ‹Ð¹ функционал (общение по Ñети, работа Ñ Ð±Ð¸Ð½Ð°Ñ€Ð½Ñ‹Ð¼Ð¸ логами, Ñ€ÐµÐ¿Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ð¾ Ñети, быÑтрое переключение на резервный Ñервер и Ñ‚.п.). Ð’ модулÑÑ… реализуетÑÑ Ð±Ð¸Ð·Ð½ÐµÑ Ð»Ð¾Ð³Ð¸ÐºÐ° конкретного Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñ Ð¸Ñпользованием API Ñдра. + +<b>Tarantool/Box</b> — хранилище данных в памÑти, ключ-значение. + +Сервер разрабатывалÑÑ Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½Ð¸Ñ… целей в компании Mail.Ru. Ð’ процеÑÑе ÑкÑплуатации ÑиÑтема хорошо зарекомендовала ÑÐµÐ±Ñ Ð¸ была внедрена во многих проектах компании. Ð‘Ð»Ð°Ð³Ð¾Ð´Ð°Ñ€Ñ Ð²Ñ‹Ñокой производительноÑти и надежноÑти ÑиÑтемы в уÑловиÑÑ… больших нагрузок, удалоÑÑŒ повыÑить ÑтабильноÑÑ‚ÑŒ предоÑтавлÑемых ÑервиÑов. ÐŸÐµÑ€Ð²Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ñервера, Ñтавшего оÑновой Ð´Ð»Ñ Ñ†ÐµÐ»Ð¾Ð³Ð¾ ÑемейÑтва хранилищ, поÑвилаÑÑŒ в 2008 году. Tarantool – переработанный и уÑовершенÑтвованный Ñервер, предназначенный Ð´Ð»Ñ Ð¿Ð¾ÑÑ‚Ñ€Ð¾ÐµÐ½Ð¸Ñ Ñпециализированных хранилищ. Код напиÑан на Ñзыке С и иÑпользует раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ gcc. + +__ХарактериÑтики__ + +* отÑутÑтвие фрагментации оÑновной памÑти и деградации производительноÑти при работе Ñ Ð¼Ð½Ð¾Ð¶ÐµÑтвом маленьких объектов, Ð±Ð»Ð°Ð³Ð¾Ð´Ð°Ñ€Ñ Ð¸cпользованию ÑобÑтвенных аллокаторов; +* возможноÑÑ‚ÑŒ работы Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ð¼Ð¸ объемами данных; +* наличие файла snapshot, в котором ÑохранÑетÑÑ ÑоÑтоÑние вÑех данных базы на момент запиÑи на диÑк; +* ÑпоÑобноÑÑ‚ÑŒ ÑохранÑÑ‚ÑŒ вÑе Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ Ð±Ð°Ð·Ñ‹ данных (логирование транзакций в файлах бинарных логов) и автоматичеÑки воÑÑтанавливать информацию поÑле перезапуÑка ÑиÑтемы; +* выÑÐ¾ÐºÐ°Ñ Ð´Ð¾ÑтупноÑÑ‚ÑŒ ÑиÑтемы (в Ñлучае программных или аппаратных Ñбоев проиÑходит автоматичеÑкое переключение на доÑтупную реплику); +* ÑовмеÑтимоÑÑ‚ÑŒ Ñ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼ memcached; +* возможноÑÑ‚ÑŒ обновлÑÑ‚ÑŒ ÑиÑтему незаметно от клиентÑких ÑервиÑов Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ñ‹Ñ… реплик; +* Ñ€ÐµÐ¿Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð´Ð°Ð½Ð½Ñ‹Ñ… по Ñети; +* проÑтой бинарный протокол Ð´Ð»Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ð¸ дополнительной логики; +* СобираетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ под gcc; +* ТеÑтировалÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ под Linux. + + diff --git a/doc/www-data.in/sidebar b/doc/www-data.in/sidebar new file mode 100644 index 0000000000000000000000000000000000000000..41fc0ca284c7d3d6e4f82a7d3ad5343a1bfe9c03 --- /dev/null +++ b/doc/www-data.in/sidebar @@ -0,0 +1,43 @@ +{% text sidebar en %} + +* [Documentation](docs.html) + * [Introduction](intro.html) + * [Benchmark](benchmark.html) + * [User Guide](tarantool_user_guide.html) + * [FAQ](faq.html) + * [Developer guide](tarantool_developer_guide.html) +* [Github resources](http://github.com/mailru/tarantool) + * [Git source](https://github.com/mailru/tarantool) + * [Wiki](http://github.com/mailru/tarantool/wiki) + * [Lua code](http://github.com/mailru/tntlua) +* [Launchpad resources](http://launchpad.net/tarantool) + * [Bug Database](https://bugs.launchpad.net/tarantool) + * [Open tasks](https://blueprints.launchpad.net/tarantool) + * [Mailinng list](https://lists.launchpad.net/tarantool-developers/) +* Other + * [User group](http://groups.google.com/group/tarantool) + * [IRC chat](http://webchat.freenode.net/?channels=tarantool) + * [Latest build](download.html) + * [All downloads](http://tarantool.org/dist) + +{% text sidebar ru %} + +* [ДокументациÑ](docs.ru.html) + * [Введение](intro.ru.html) + * [Бенчмарк](benchmark.ru.html) + * [РуководÑтво пользователÑ](tarantool_user_guide.html) + * [ЧÐВО](faq.ru.html) + * [РуководÑтво разработчика](tarantool_developer_guide.html) +* [РеÑурÑÑ‹ Github](http://github.com/mailru/tarantool) + * [ИÑходный код](https://github.com/mailru/tarantool) + * [Вики](http://github.com/mailru/tarantool/wiki) + * [Lua примеры](http://github.com/mailru/tntlua) +* [РеÑурÑÑ‹ Launchpad](http://launchpad.net/tarantool) + * [База дефектов](https://bugs.launchpad.net/tarantool) + * [База задач](https://blueprints.launchpad.net/tarantool) + * [СпиÑок раÑÑылки](https://lists.launchpad.net/tarantool-developers/) +* Другое + * [Группа пользователей](http://groups.google.com/group/tarantool-ru) + * [IRC чат](http://webchat.freenode.net/?channels=tarantool) + * [ПоÑледний релиз](download.ru.html) + * [Ð’Ñе релизы](http://tarantool.org/dist) diff --git a/doc/www-data/bg_header.png b/doc/www-data/bg_header.png index b6a32c8fd7d13dbf5e33c4750a7edc281dd92f95..8d543cdec89de602df198f4dd527f5749f2636db 100644 Binary files a/doc/www-data/bg_header.png and b/doc/www-data/bg_header.png differ diff --git a/doc/www-data/favicon.ico b/doc/www-data/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1da1bef5bd055b88712b29afeed39afd67b3c6ca Binary files /dev/null and b/doc/www-data/favicon.ico differ diff --git a/doc/www-data/global.css b/doc/www-data/global.css index 10a880de1d7e9eff816cfec625cc89634986b18f..d7b10f77eaa766b45f6c443ddccb26667c3e9e10 100644 --- a/doc/www-data/global.css +++ b/doc/www-data/global.css @@ -1,72 +1,348 @@ +/* This stylesheet heavily borrows from http://necolas.github.com/normalize.css */ + +/* ============================================================================= + Base + ========================================================================== */ + +/* + * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units + * http://clagnut.com/blog/348/#c790 + * 2. Keeps page centred in all browsers regardless of content height + * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom + * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ + */ + +html { + font-size: 100%; /* 1 */ + overflow-y: scroll; /* 2 */ + -webkit-text-size-adjust: 100%; /* 3 */ + -ms-text-size-adjust: 100%; /* 3 */ +} + +/* + * Addresses margins handled incorrectly in IE6/7 + */ + body { - color: #333; - font-family: Helvetica, Arial, sans-serif; - font-size: 13px; - line-height: 1; - padding: 0; - margin: 0; + margin: 0; +} + +/* ============================================================================= + Links + ========================================================================== */ + +/* + * Addresses outline displayed oddly in Chrome + */ + +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers + * people.opera.com/patrickl/experiments/keyboard/test + */ + +a:hover, a:active { + outline: 0; +} + + +/* ============================================================================= + Typography + ========================================================================== */ + +/* + * Neutralise smaller font-size in 'section' and 'article' in FF4+, Chrome, S5 + */ + +h1 { + font-size: 1.5em; +} + +/* + * Addresses style set to 'bolder' in FF3+, S4/5, Chrome + */ + +b, strong { + font-weight: bold; +} + +blockquote { + margin: 1em 40px; +} + +/* + * Corrects font family set oddly in IE6, S4/5, Chrome + * en.wikipedia.org/wiki/User:Davidgothberg/Test59 + */ + +pre, code, kbd, samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} + +/* + * Improves readability of pre-formatted text in all browsers + */ + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* + * 1. Addresses CSS quotes not supported in IE6/7 + * 2. Addresses quote property not supported in S4 + */ + +/* 1 */ + +q { + quotes: none; +} + +/* 2 */ + +q:before, +q:after { + content: ''; + content: none; +} + +/* + * XXX + */ + +small { + font-size: 75%; +} + +/* + * Prevents sub and sup affecting line-height in all browsers + * gist.github.com/413930 + */ + +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + + +/* ============================================================================= + Lists + ========================================================================== */ + +ul, ol { + margin-left: 0; + padding: 0 0 0 40px; +} + +dd { + margin: 0 0 0 40px; +} + + +/* ============================================================================= + Embedded content + ========================================================================== */ + +/* + * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 + * 2. Improves image quality when scaled in IE7 + * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ + */ + +img { + border: 0; /* 1 */ + -ms-interpolation-mode: bicubic; /* 2 */ +} + + +/* ============================================================================= + Tables + ========================================================================== */ + +/* + * Remove most spacing between table cells + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + + +/* =========================================================================== + Layout + ======================================================================== */ + +/* + * Top-level page sections: + * body > #wrapper > #header #content #footer + */ + +#wrapper { + width: 970px; + margin: 0 auto; + padding: 0; } +#header, #footer, #content { + width: 970px; + margin: 0 auto; + padding: 0; + overflow: hidden; +} + + #header { - margin: 20px auto 10px auto; - width: 960px; - overflow: hidden; + margin-bottom: 5px; } + +#footer p, #header p { + margin: 0 10px; +} + +/* + * http://sonspring.com/journal/clearing-floats + */ + +.clear { + clear: both; + display: block; + visibility: hidden; + width: 0; + height: 0; +} + +/* ========================================================================== + Grid + ======================================================================== */ -#header #nav { - width: 740px; - float: right; +.grid { + width: 940px; + overflow: hidden; + margin-left: auto; + margin-right: auto; + padding: 0 10px 0 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; - background: url('bg_header.png') repeat-x scroll 50% 0 white; + + -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); + clear: both; } -#header #nav ul { - list-style: none outside none; - margin: 0 15px; - padding: 0; +.lwrap { + float: left; } -#header #nav ul li { - float: left; +.rwrap { + float: right; } -#header #nav ul li a { - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - border-radius: 10px; - color: #eee; - text-decoration: none; - text-shadow: 0 1px 1px rgba(0,0,0,0.5); - text-transform: uppercase; - font-size: 11px; - font-weight: bold; - line-height: 32px; - padding: 3px 12px; - margin: 0 15px; +.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; + dsiplay: inline; /* IE workaround */ + margin-left: 10px; } -#header #nav ul li.current a { - background-color: rgba(0,0,0,0.5) !important; +.span_1 { width: 70px; } +.span_2 { width: 150px; } +.span_3 { width: 230px; } +.span_4 { width: 303px; } +.span_5 { width: 390px; } +.span_6 { width: 470px; } +.span_7 { width: 550px; } +.span_8 { width: 630px; } +.span_9 { width: 710px; } +.span_10 { width: 790px; } +.span_11 { width: 870px; } +.span_12 { width: 950px; } + +.lpad_1 { padding-left: 80px; } +.lpad_2 { padding-left: 160px; } +.lpad_3 { padding-left: 240px; } +.lpad_4 { padding-left: 320px; } +.lpad_5 { padding-left: 400px; } +.lpad_6 { padding-left: 480px; } +.lpad_7 { padding-left: 560px; } +.lpad_8 { padding-left: 640px; } +.lpad_9 { padding-left: 720px; } +.lpad_10 { padding-left: 800px; } +.lpad_11 { padding-left: 880px; } + +.rpad_1 { padding-right: 80px; } +.rpad_2 { padding-right: 160px; } +.rpad_3 { padding-right: 240px; } +.rpad_4 { padding-right: 320px; } +.rpad_5 { padding-right: 400px; } +.rpad_6 { padding-right: 480px; } +.rpad_7 { padding-right: 560px; } +.rpad_8 { padding-right: 640px; } +.rpad_9 { padding-right: 720px; } +.rpad_10 { padding-right: 800px; } +.rpad_11 { padding-right: 880px; } + + +/* ============================================================================= + Custom styles + ========================================================================== */ + +html, body, #wrapper { + height: 100%; } -#header #nav ul li a:HOVER { - background-color: rgba(0,0,0,0.25) +body { + background-color: #eee; + font-size: 80%; + font-family: Verdana, Arial, Helvetica, sans-serif; + line-height: 1.5; } -#header #logo { - width: 150px; - height: 30px; - float: left; - display: block; - background: url(tarantool.png) no-repeat; - margin: 3px 30px 0 30px; - +#wrapper, #header, #content, #footer { + background-color: #fff; +} + +#content { + padding-bottom: 5px; +} + +a { color: #201e9e; } +a:visited { color: #3f3f3f; } + +#footer img { + vertical-align: middle; +} + +#logo { + width: 120px; + height: 120px; + float: left; } -#main { - overflow: hidden; +#blurb { + margin-bottom: 8px; + color: #ffffff; +/* background-color: #00468c; */ + background: url('bg_header.png') repeat-x scroll 50% 0 white; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; @@ -74,35 +350,112 @@ body { -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); +} + +#blurb h1 { + font-size: 1.5em; + line-height: 1; +} + +#blurb h2 { + font-size: 1.2em; + font-weight: normal; + font-style: italic; + line-height: 1; + width: 80%; +} + +.front_block { + /*border: 1px dotted black;*/ + margin-top: 10px; + margin-bottom: 10px; + padding: 0 10px; +} + +.news_block { + /*border: 1px dotted black;*/ + margin-top: 10px; + margin-bottom: 10px; + margin-left: 230px; + margin-right: auto; + padding: 0 10px; +} + +#download a { + color: #ffffff; + text-decoration: none; +} +#download a:visited { + color: #eee; + text-decoration: none; +} - width: 960px; +#current_download { + font-size: 110%; + font-weight: bold; + padding: 4px 5px; + background-color: #ffaa00; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + + -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); +} - margin: 0 auto; +#content_cap { + color: #ffffff; + background-color: #00468c; } -.mBox { margin: 0 20px 10px 20px; display: inline; float: left; } -.w600 { width: 600px; } -.w280 { width: 280px; } -#tarantool p { - margin: 10px 0; - line-height: 18px; +#content_cap #logo { + width: 65px; + height: 65px; } -#main li { - margin: 10px 0; - line-height: 14px; + +/* =========================================================================== + Navigation + ======================================================================= */ + +#nav { + width: 740px; + float: right; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: url('bg_header.png') repeat-x scroll 50% 0 white; } -#tarantool h1 { margin: 10px 0; font-size: 28px; font-family: HelveticaNeue-Light,"Helvetica Neue Light",Helvetica,Arial,sans-serif; color: #000; font-weight: normal; } -#tarantool h1 a { color: black; text-decoration: none; } +#nav ul, #nav ol { + list-style: none outside none; + margin: 0 15px; + padding: 0; +} -#tarantool h2 { margin: 10px 0; font-size: 24px; font-family: HelveticaNeue-Light,"Helvetica Neue Light",Helvetica,Arial,sans-serif; color: #000; font-weight: normal; } -#tarantool h2 a { color: black; text-decoration: none; } +#nav ul li { + display: inline-block; +} -#tarantool h3 { margin: 10px 0; font-size: 20px; font-family: HelveticaNeue-Light,"Helvetica Neue Light",Helvetica,Arial,sans-serif; color: #000; font-weight: normal; } -#tarantool h3 a { color: black; text-decoration: none; } +#nav ul li a { + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; + color: #eee; + text-decoration: none; + text-shadow: 0 1px 1px rgba(0,0,0,0.5); + text-transform: uppercase; + font-size: 11px; + font-weight: bold; + line-height: 32px; + padding: 3px 12px; + margin: 0 10px; +} -#tarantool h4 { margin: 10px 0; font-size: 16px; font-family: HelveticaNeue-Light,"Helvetica Neue Light",Helvetica,Arial,sans-serif; color: #000; font-weight: normal; } -#tarantool h4 a { color: black; text-decoration: none; } +#nav ul li.current_download a { + background-color: rgba(0,0,0,0.5) !important; +} -.mt20 { margin-top: 20px !important; } -#tarantool a { color: #369;} +#nav ul li a:HOVER { + background-color: rgba(0,0,0,0.25) +} diff --git a/doc/www-data/index.html b/doc/www-data/index.html deleted file mode 100644 index 91c52bc9a8cc6815a4691b4d4ef3360c7d837318..0000000000000000000000000000000000000000 --- a/doc/www-data/index.html +++ /dev/null @@ -1,121 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Tarantool</title> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="stylesheet" type="text/css" href="global.css" /> - -<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> - -</head> - -<body id="tarantool"> - - <div id="header"> - <a id="logo" href="index.html"></a> - <div id="nav"> - <ul> - <li class="current"><a href="index.html">Home</a></li> - <li><a href="tarantool_user_guide.html">Documentation</a></li> - <li><a href="http://bugs.launchpad.net/tarantool">Bugs</a></li> - <li><a href="http://github.com/mailru/tarantool/wiki">Wiki</a></li> - <li><a href="http://tarantool.org/dist/">Downloads</a></li> - <li><a href="index.ru.html">РуÑÑкий</a></li> - </ul> - </div> - </div> - <div id="main"> - <div class="mBox w600"> - <div class="item"> - <p> - Tarantool/Box, or simply Tarantool, is a high performance - key/value storage server. The code is available for free under - the terms of <em><a href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD">BSD license</a></em>. Supported platforms are GNU/Linux and - FreeBSD. - - </p><p> - The server <span class="strong"><strong>maintains all its data in - random-access memory</strong></span>, and therefore can handle read - requests blazingly fast. 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. - </p><p> - 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. - </p><p> - 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. - </p><p> - 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. - </p><p> - <span class="strong"><strong>Tarantool is lock-free</strong></span>. - Instead of the underlying operating system's concurrency - primitives, Tarantool uses cooperative multitasking environment - to simultaneously operate on thousands of connections. While - this approach limits server scalability to a single CPU core, in - practice 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%. - </p><p> - <span class="strong"><strong>The software is production-ready</strong></span>. - Tarantool has been developed and is actively used at - <em><a href="http://api.mail.ru">Mail.Ru</a></em> - one of the leading Russian web content providers. At Mail.Ru, - the sowtware serves the <span class="quote">“<span class="quote">hottest</span>”</span> - data, such as online users and their sessions, online application - properties, the map between users and their serving shards. - </p><p> - To conclude, Tarantool/Box is ideal for highly volatile and/or - highly accessed Web data. With Tarantool, performance overhead - on serving data is minimal: a single server can easily deal with - tens or even hundreds of thousands of requests per second. - Snapshots can be made when Web user activity is at its lowest, - for example at night, and thus add little or no restraint on the - top throughput of the system. If the master becomes - unavailable, a replica can assume the role of the master with - minimal downtime. -</p> - </div> - </div> - <div class="mBox w280"> - <h3>IRC chatroom</h3> - <b>#tarantool on <a href="http://webchat.freenode.net/">irc.freenode.net</a></b> - </div> - <div class="mBox w280"> - <br /><br /> - <h3>What's new</h3> - <p>2011-12-14: <a href="http://tarantool.org/dist/tarantool-1.4.4-2-g9b208cb-src.tar.gz">Tarantool 1.4.4</a>, a maintenace version of stable 1.4 branch.</p> - <p>2011-08-25: Tarantool 1.4.2, featuring Lua stored prcoedures, is out.</p> - <p>2011-06-05: <a href="http://tarantool.org/tarantool_user_guide.html">Tarantool User Guide</a> is published.</p> - <p>2011-05-14: <a href="http://launchpad.net/tarantool/1.3/1.3.5/+download/tarantool-1.3.5-src.tar.gz">tarantool-1.3.5</a> (stable) is out.</p> - </div> - </div> -</body> -</html> diff --git a/doc/www-data/index.ru.html b/doc/www-data/index.ru.html deleted file mode 100644 index a34379a4e379cca687c1136440030324c600ab15..0000000000000000000000000000000000000000 --- a/doc/www-data/index.ru.html +++ /dev/null @@ -1,110 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Tarantool</title> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="stylesheet" type="text/css" href="global.css" /> - -<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> - -</head> - -<body id="tarantool"> - - <div id="header"> - <a id="logo" href="index.ru.html"></a> - <div id="nav"> - <ul> - <li class="current"><a href="index.ru.html">ГлавнаÑ</a></li> - <li><a href="tarantool_user_guide.html">ДокументациÑ</a></li> - <li><a href="http://github.com/mailru/tarantool/wiki/Home">Wiki</a></li> - <li><a href="dist/">Скачать</a></li> - <li><a href="index.html">English</a></li> - </ul> - </div> - </div> - <div id="main"> - <div class="mBox w600"> - <div class="item"> - <p><b>Tarantool</b> — однопоточный TCP Ñервер, - реализующий кооперативную многозадачноÑÑ‚ÑŒ. РазрабатываетÑÑ - Ñ ÑƒÑ‡ÐµÑ‚Ð¾Ð¼ работы под выÑокими нагрузками (деÑÑтки Ñ‚Ñ‹ÑÑч - RPS). Можно выделить две логичеÑкие ÑоÑтавлÑющие: Ñдро и - модули. Ð’ наÑтоÑщее Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ðµ модулей производитÑÑ - на Ñтапе компилÑции. Ðа уровне Ñдра реализуетÑÑ Ð±Ð°Ð·Ð¾Ð²Ñ‹Ð¹ - функционал (общение по Ñети, работа Ñ Ð±Ð¸Ð½Ð°Ñ€Ð½Ñ‹Ð¼Ð¸ логами, - Ñ€ÐµÐ¿Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð¿Ð¾ Ñети, быÑтрое переключение на резервный - Ñервер и Ñ‚.п.). Ð’ модулÑÑ… реализуетÑÑ Ð±Ð¸Ð·Ð½ÐµÑ Ð»Ð¾Ð³Ð¸ÐºÐ° - конкретного Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñ Ð¸Ñпользованием API Ñдра.</p> - - <p><b>Tarantool/Box</b> — хранилище данных в - памÑти, ключ-значение.</p> - - <p>Сервер разрабатывалÑÑ Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½Ð¸Ñ… целей в компании - Mail.Ru. Ð’ процеÑÑе ÑкÑплуатации ÑиÑтема хорошо - зарекомендовала ÑÐµÐ±Ñ Ð¸ была внедрена во многих проектах - компании. Ð‘Ð»Ð°Ð³Ð¾Ð´Ð°Ñ€Ñ Ð²Ñ‹Ñокой производительноÑти и надежноÑти - ÑиÑтемы в уÑловиÑÑ… больших нагрузок, удалоÑÑŒ повыÑить - ÑтабильноÑÑ‚ÑŒ предоÑтавлÑемых ÑервиÑов. ÐŸÐµÑ€Ð²Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ - Ñервера, Ñтавшего оÑновой Ð´Ð»Ñ Ñ†ÐµÐ»Ð¾Ð³Ð¾ ÑемейÑтва хранилищ, - поÑвилаÑÑŒ в 2008 году. Tarantool – переработанный и - уÑовершенÑтвованный Ñервер, предназначенный Ð´Ð»Ñ Ð¿Ð¾ÑÑ‚Ñ€Ð¾ÐµÐ½Ð¸Ñ - Ñпециализированных хранилищ. Код напиÑан на Ñзыке С и - иÑпользует раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ gcc.</p> - - <p><b>ХарактериÑтики</b> - <ul> - <li>отÑутÑтвие фрагментации оÑновной памÑти и деградации - производительноÑти при работе Ñ Ð¼Ð½Ð¾Ð¶ÐµÑтвом маленьких - объектов, Ð±Ð»Ð°Ð³Ð¾Ð´Ð°Ñ€Ñ Ð¸cпользованию ÑобÑтвенных - аллокаторов;</li> - <li>возможноÑÑ‚ÑŒ работы Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ð¼Ð¸ объемами данных;</li> - <li>наличие файла snapshot, в котором ÑохранÑетÑÑ - ÑоÑтоÑние вÑех данных базы на момент запиÑи на - диÑк;</li> - <li>ÑпоÑобноÑÑ‚ÑŒ ÑохранÑÑ‚ÑŒ вÑе Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÑоÑтоÑÐ½Ð¸Ñ Ð±Ð°Ð·Ñ‹ - данных (логирование транзакций в файлах бинарных - логов) и автоматичеÑки воÑÑтанавливать информацию - поÑле перезапуÑка ÑиÑтемы;</li> - <li>выÑÐ¾ÐºÐ°Ñ Ð´Ð¾ÑтупноÑÑ‚ÑŒ ÑиÑтемы (в Ñлучае программных или - аппаратных Ñбоев проиÑходит автоматичеÑкое - переключение на доÑтупную реплику);</li> - <li>ÑовмеÑтимоÑÑ‚ÑŒ Ñ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼ memcached;</li> - <li>возможноÑÑ‚ÑŒ обновлÑÑ‚ÑŒ ÑиÑтему незаметно от клиентÑких - ÑервиÑов Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ñ‹Ñ… реплик;</li> - <li>Ñ€ÐµÐ¿Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð´Ð°Ð½Ð½Ñ‹Ñ… по Ñети;</li> - <li>проÑтой бинарный протокол Ð´Ð»Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ð¸ - дополнительной логики;</li> - <li>СобираетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ под gcc;</li> - <li>ТеÑтировалÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ под Linux.</li> - </ul> - </p> - </div> - </div> - <div class="mBox w280"> - <h3>IRC chatroom</h3> - <b>#tarantool on <a href="http://webchat.freenode.net/">irc.freenode.net</a></b> - </div> - <div class="mBox w280"> - <br /><br /> - <h3>ÐовоÑти</h3> - <p>2011-12-14: <a href="http://tarantool.org/dist/tarantool-1.4.4-2-g9b208cb-src.tar.gz">Tarantool 1.4.4</a>, ÑÑ‚Ð°Ð±Ð¸Ð»ÑŒÐ½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð²ÐµÑ‚ÐºÐ¸ 1.4.</p> - <p>2011-08-25: Tarantool 1.4.2, Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¾Ð¹ Lua.</p> - <p>2011-06-05: Опубликован <a href="http://tarantool.org/tarantool_user_guide.html">tarantool user guide</a>.</p> - <p>2011-05-14: <a href="http://launchpad.net/tarantool/1.3/1.3.5/+download/tarantool-1.3.5-src.tar.gz">tarantool-1.3.5</a>, ÑÑ‚Ð°Ð±Ð¸Ð»ÑŒÐ½Ð°Ñ Ð²ÐµÑ€ÑиÑ.</p> - </div> - </div> -</body> -</html> diff --git a/doc/www-data/logo.png b/doc/www-data/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a6e6af726a676b247cca798eb5a5b2913eaac79a Binary files /dev/null and b/doc/www-data/logo.png differ diff --git a/doc/www-data/mail-logo.png b/doc/www-data/mail-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba2089f1fcb0d6c31129ff83917b5ea11003b26 Binary files /dev/null and b/doc/www-data/mail-logo.png differ diff --git a/doc/www-data/tarantool.png b/doc/www-data/tarantool.png deleted file mode 100644 index 86dbf9dce9d4880fbe281f86e2f266675e08a685..0000000000000000000000000000000000000000 Binary files a/doc/www-data/tarantool.png and /dev/null differ diff --git a/doc/www-data/tnt.css b/doc/www-data/tnt.css deleted file mode 100644 index 28bf7088da3de85e408858bfb5956b048eccdfca..0000000000000000000000000000000000000000 --- a/doc/www-data/tnt.css +++ /dev/null @@ -1,16 +0,0 @@ -.tntadmin { - font-family: monospace; - font-weight: bold; - text-transform: uppercase; - color: green; -} - -.hl-keyword { - color: green; - font-weight: bold; -} - -.hl-comment{ - color: blue; - font-weight: bold; -} diff --git a/doc/www-data/yandex_5850d4f0ae375477.html b/doc/www-data/yandex_5850d4f0ae375477.html deleted file mode 100644 index 059340dbf29c248bd88328594b809dc08ba68b89..0000000000000000000000000000000000000000 --- a/doc/www-data/yandex_5850d4f0ae375477.html +++ /dev/null @@ -1,6 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - </head> - <body>Verification: 5850d4f0ae375477</body> -</html> diff --git a/scripts/static.py b/scripts/static.py new file mode 100755 index 0000000000000000000000000000000000000000..17651c1977eabb00fc48ee53d2aadbf2201b8b9d --- /dev/null +++ b/scripts/static.py @@ -0,0 +1,322 @@ +#!/usr/bin/env python + +import os +import re +import sys +import yaml +import jinja2 +import markdown +import argparse +import fnmatch +import glob +import shutil + + +default_lang = { + 'source-encoding': 'utf-8', + 'output-encoding': 'utf-8', + 'suffix': '.html' } + + +class Config(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'] + data = data[lang] + return data + + +def make_environ(path): + env = jinja2.Environment(loader = jinja2.FileSystemLoader(path)) + env.filters['langselect'] = langselect + return env + + +class BaseHandler(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) + + 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 None + 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 None + 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) + +if __name__ == '__main__': + main()