This repository has been archived by the owner. It is now read-only.
Kanna makes html components easier to display. like table, panel, etc..
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
kanna
.gitignore
LICENSE
README.rst
kanna.png
setup.py

README.rst

Kanna

kanna

license

Kanna makes html components easier to display. like table, panel, etc..

Getting Started

Installation

python setup.py install to install

Simple Example with twbs/Bootstrap

Python

from kanna import Kanna, KannaMap, KannaComponent

kanna = Kanna(path="./templates/components")

print kanna.render("panel", KannaMap(
    type="default",
    title="This is panel's title",
    content=KannaComponent(
        tag="p",
        attr={"class": "text-primary"},
        content="panel's content!"
    ),
    footer="foooooter"
))

Kanna Template

<!-- ./templates/components/panel.kanna -->
<div class="panel panel-{@ type @}">
    <div class="panel-heading">
        <h3 class="panel-title">
            {@ title @}
        </h3>
    </div>
    <div class="panel-body">
        {@ content @}
    </div>
    <div class="panel-footer">
        {@ footer @}
    </div>
</div>

result

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">
            This is panel's title
        </h3>
    </div>
    <div class="panel-body">
        <p class='text-primary'>panel's content!</p>
    </div>
    <div class="panel-footer">
        foooooter
    </div>
</div>

Doc

Soon

FEATURE

0.1.beta

  • Simple component generator (KannaComponent)
  • Render templates (Kanna.render())

License

Copyright (c) 2017, Hawl Kim
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
  • Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.