Giter VIP home page Giter VIP logo

bananahtml's Introduction

BananaHTML - single class that makes HTML generating easier

This is class for HTML code rendering in accordance with the standards of HTML5, and with useful syntax extensions for simpler usage

Banana means nothing, I just recalled minions from "Despicable Me" when creating this project.

            ▀▄   █   ▄▀
           ▄▄▄█▄▄█▄▄█▄▄▄
        ▄▀▀═════════════▀▀▄
       █═══════════════════█
      █═════════════════════█
     █═══▄▄▄▄▄▄▄═══▄▄▄▄▄▄▄═══█
    █═══█████████═█████████═══█
    █══██▀    ▀█████▀    ▀██══█
   ██████   █▀█ ███   █▀█ ██████
   ██████   ▀▀▀ ███   ▀▀▀ ██████
    █══▀█▄    ▄██ ██▄    ▄█▀══█
    █════▀█████▀   ▀█████▀════█
    █═════════════════════════█
    █═════════════════════════█
    █═══════█▀█▀█▀█▀█▀█═══════█
    █═══════▀▄       ▄▀═══════█
   ▐▓▓▌═══════▀▄█▄█▄▀═══════▐▓▓▌
   ▐▐▓▓▌▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▐▓▓▌▌
   █══▐▓▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄▓▌══█
  █══▌═▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌═▐══█
  █══█═▐▓▓▓▓▓▓▄▄▄▄▄▄▄▓▓▓▓▓▓▌═█══█
  █══█═▐▓▓▓▓▓▓▐██▀██▌▓▓▓▓▓▓▌═█══█
  █══█═▐▓▓▓▓▓▓▓▀▀▀▀▀▓▓▓▓▓▓▓▌═█══█
  █══█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█══█
 ▄█══█▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌█══█▄
 █████▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ █████
 ██████▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ██████
  ▀█▀█  ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌   █▀█▀
         ▐▓▓▓▓▓▓▌▐▓▓▓▓▓▓▌
          ▐▓▓▓▓▌  ▐▓▓▓▓▌
         ▄████▀    ▀████▄
         ▀▀▀▀        ▀▀▀▀

Requirements:

  • PHP 5.4+

How to use?

Simply add dependency on nazar-pc/bananahtml to your project's composer.json:

{
    "require": {
        "nazar-pc/bananahtml": "*"
    }
}

Examples:

<?php
//Much easier to write:)
use	nazarpc\BananaHTML as h;

echo h::p('Paragraph content');
// <p>Paragraph content</p>

echo h::{'a#github.cool-link.two-classes[href=http://github.com]'}(
	'GitHub',
	[
		'data-is-supported'	=> 'yes'
	]
);
//<a id="github" class="cool-link two-classes" href="http://github.com" data-is-supported="yes">
//	GitHub
//</a>

echo h::{'ul.unordered-list li| span'}(
	'one',
	'two',
	'three'
);
//<ul class="unordered-list">
//	<li><span>one</span></li>
//	<li><span>two</span></li>
//	<li><span>three</span></li>
//</ul>

Examples are very trivial, just to explain the idea of generating HTML using basic CSS rules with some syntax extension - it is easy and natural.

For complete reference of possible features and syntax constructions look at documentation.md file.

Contribution

Feel free to create issues and send pull requests, they are highly appreciated!

License

MIT License, see license.txt

bananahtml's People

Contributors

nazar-pc avatar grahamcampbell avatar

Watchers

Nikolya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.