Package: tuhinga
TuhingaTuhinga is a minimalistic markup language that translates to XML/HTML.
It can help you reduce typing and quicken the editing process of HTML
pages. It may remind you a little of HAML since it shares a few common
concepts, but it has different goals. HAML is essentially a template
language, while tuhinga is a tiny markup language primarily aimed to be
just a precursor for XML/HTML documents.The only true goal of Tuhinga isconciseness. And this is also
where it stands out against other solutions. It is the prettiest.
This means it may never support XML and HTML for the full 100%, since
that would cause the need for a much more expansive syntax. Use it if
you think HAML is a good idea, but not beatiful enough. Otherwise I’d
advise to just use HAML, since it is much more mature and has numerous
implementations.The implementation of Tuhinga is written in Python. Supported Python
versions are 2.7 and 3.2 and later.Github:http://github.com/babab/tuhingaBitbucket:http://bitbucket.org/babab/tuhingaA tuhinga example documentAn example of a HTML5 (*.tuh) document:; Comments start with ;

html5
  head
    meta-charset utf-8
    meta :name=viewport device-width, initial-scale=1.0
    title Page title
  body
    #main.container
      h1.page-header Page title
      .row
        .col-lg-12
          p Paragraph line 1
            :: line 2
            :: line 3
            small line 4
          p
            :: line 1
            :: line 2
    #footer.container
      p.muted Copyright &amp; 2015 MeAfter converting to HTML:<!doctype html><html><head><metacharset="utf-8"><metaname="viewport"content="device-width, initial-scale=1.0"><title>Page title</title></head><body><divid="main"class="container"><h1class="page-header">Page title</h1><divclass="row"><divclass="col-lg-12"><p>Paragraph line 1
            line 2
            line 3<small>line 4</small></p><p>line 1
            line 2</p></div></div></div><divid="footer"class="container"><pclass="muted">Copyright&amp;2015 Me</p></div></body></html>The tuhinga equivalent of any HTML output uses roughly 33% less
characters, and not a single angle bracket.Using Tuhinga to write XML / HTML5The handling of certain symbols likejs,meta,inputand other
void elements and the$contentthat follows is done by applying a
set of rules, called a mapping. All other elements are treated with
the default handling of the Lexer (currently there is only a XML/HTML
Lexer).What follows are the rules that are applied with the default mapping.
You can alter how these mappings work though. This means you can easily
add your own symbols.Special symbolshtml5: sets doctype; is expanded to <!doctype html><html> … </html>css: expanded to <link rel=”stylesheet” {href=”$content”}>input: expanded to <input {value=”$content”}>input-*: expanded to <input type=”*” {value=”$content”}>js: an alternative for writingscript-srclink: expanded to <link {href=”$content”}>meta: expanded to <meta {content=”$content”}>meta-charset: expanded to <meta charset=”$content”>script-src: expanded to <script {src=”$content”}></script>Recognised as void elements (elements that do not close)area, base, br, col, embed, hr, img, keygen, param, source, track,
input (mapped content), link (mapped content), meta (mapped content),
wbrConvert tuhinga templates with the python moduleTuhinga is distributed as a single module and can be downloaded and
used directly. If you install Tuhinga into your system or
virtualenv, you can use the more convenienttuhexecutable script.
If you use the module, simply replacetuhwith./tuhinga.pyin
the instructions below.Converting a document is simple:$tuhsomedocument.tuh>somedocument.htmlYou can also read from stdinput:$catsomedocument.tuh|tuh>somedocument.html# passing a file$tuh>somedocument.html# typing a doc directly in the terminalThe Tuhinga module itself has no external dependencies. The Tuhinga
webREPL is distributed independently and requires bottle.Download and installTuhinga itself has no external dependencies. If you have pip installed,
you can just:#pipinstalltuhingaTo work with the current development version, do something like this:$gitclonegit://bitbucket.org/babab/tuhinga.git#cdtuhinga#pythonsetup.pyinstallConvert tuhinga templates with the instant webREPLUse the webREPL as an easy way to fiddle around with writing tuhinga
documents or use it as a serious tool to quickly write up your pages. It
will give instant feedback of the output after each keystroke.The webREPL is written using the bottle Python micro-framework, which is
not a dependency of tuhinga itself. Therefore, you must be sure to have
bottle installed if you wish to use it.Install bottle (in a virtualenv)$pipinstallbottleRun the webREPL$./tuhinga_webrepl.pyNow you can visithttp://localhost:8080/and play around.Syntax file for VimIf you use Vim for your editing, you can install the syntax file to have
pretty syntax highlighting for Tuturu (*.tuh) documents. It’s my first
go at writing a syntax.vim file and it currently has some small bugs,
which should probably be resolved soon.Install the tuh.vim syntax file into your .vim folder:$mkdir-p~/.vim/syntax$cptuh.vim~/.vim/syntaxAnd use it in your Vim buffer with:set filetype=tuhLicenseCopyright (c) 2014-2015 Benjamin Althues <benjamin@babab.nl>Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.Change LogAll notable changes to tuhinga will be documented here. The project
adheres toSemantic Versioning.0.1.1 - 2013-05-28AddedPackage as (source and) wheel distribution to speed up installationsThis CHANGELOG0.1.0 - 2013-05-21AddedInitial release