From 4ac107b5bd98b3df15318b1bc8dd29596b4a7eeb Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Sat, 12 Oct 2013 20:15:47 -0400 Subject: [PATCH] Initial library add --- LICENSE | 2 +- README.md | 227 +- build.properties | 10 + build.xml | 32 + composer.json | 31 + docs.json | 14 + docs/api.js | 30 + docs/assets/css/external-small.png | Bin 0 -> 491 bytes docs/assets/css/logo.png | Bin 0 -> 1798 bytes docs/assets/css/main.css | 849 +++++ docs/assets/favicon.png | Bin 0 -> 218 bytes docs/assets/img/spinner.gif | Bin 0 -> 2685 bytes docs/assets/index.html | 10 + docs/assets/js/api-filter.js | 52 + docs/assets/js/api-list.js | 251 ++ docs/assets/js/api-search.js | 98 + docs/assets/js/apidocs.js | 365 ++ docs/assets/js/yui-prettify.js | 17 + docs/assets/vendor/prettify/CHANGES.html | 130 + docs/assets/vendor/prettify/COPYING | 202 ++ docs/assets/vendor/prettify/README.html | 203 ++ docs/assets/vendor/prettify/prettify-min.css | 1 + docs/assets/vendor/prettify/prettify-min.js | 1 + docs/classes/Attribute.html | 1050 ++++++ docs/classes/Comment.html | 2917 +++++++++++++++ docs/classes/Document.html | 3321 ++++++++++++++++++ docs/classes/HTML5Error.html | 963 +++++ docs/classes/Node.html | 2069 +++++++++++ docs/classes/NodeContainer.html | 2997 ++++++++++++++++ docs/classes/SimpleList.html | 2974 ++++++++++++++++ docs/classes/Table.html | 2973 ++++++++++++++++ docs/classes/Text.html | 1956 +++++++++++ docs/classes/html.html | 339 ++ docs/data.json | 1531 ++++++++ docs/index.html | 138 + docs/modules/Canteen_HTML5.html | 207 ++ docs/modules/global.html | 159 + examples/document.php | 52 + src/Canteen/HTML5/Attribute.php | 170 + src/Canteen/HTML5/Comment.php | 38 + src/Canteen/HTML5/Document.php | 112 + src/Canteen/HTML5/HTML5Error.php | 144 + src/Canteen/HTML5/Node.php | 346 ++ src/Canteen/HTML5/NodeContainer.php | 238 ++ src/Canteen/HTML5/SimpleList.php | 73 + src/Canteen/HTML5/Table.php | 86 + src/Canteen/HTML5/Text.php | 39 + src/Canteen/HTML5/html.php | 237 ++ 48 files changed, 27650 insertions(+), 4 deletions(-) create mode 100644 build.properties create mode 100644 build.xml create mode 100644 composer.json create mode 100644 docs.json create mode 100644 docs/api.js create mode 100644 docs/assets/css/external-small.png create mode 100644 docs/assets/css/logo.png create mode 100644 docs/assets/css/main.css create mode 100644 docs/assets/favicon.png create mode 100644 docs/assets/img/spinner.gif create mode 100644 docs/assets/index.html create mode 100644 docs/assets/js/api-filter.js create mode 100644 docs/assets/js/api-list.js create mode 100644 docs/assets/js/api-search.js create mode 100644 docs/assets/js/apidocs.js create mode 100644 docs/assets/js/yui-prettify.js create mode 100644 docs/assets/vendor/prettify/CHANGES.html create mode 100644 docs/assets/vendor/prettify/COPYING create mode 100644 docs/assets/vendor/prettify/README.html create mode 100644 docs/assets/vendor/prettify/prettify-min.css create mode 100644 docs/assets/vendor/prettify/prettify-min.js create mode 100644 docs/classes/Attribute.html create mode 100644 docs/classes/Comment.html create mode 100644 docs/classes/Document.html create mode 100644 docs/classes/HTML5Error.html create mode 100644 docs/classes/Node.html create mode 100644 docs/classes/NodeContainer.html create mode 100644 docs/classes/SimpleList.html create mode 100644 docs/classes/Table.html create mode 100644 docs/classes/Text.html create mode 100644 docs/classes/html.html create mode 100644 docs/data.json create mode 100644 docs/index.html create mode 100644 docs/modules/Canteen_HTML5.html create mode 100644 docs/modules/global.html create mode 100644 examples/document.php create mode 100644 src/Canteen/HTML5/Attribute.php create mode 100644 src/Canteen/HTML5/Comment.php create mode 100644 src/Canteen/HTML5/Document.php create mode 100644 src/Canteen/HTML5/HTML5Error.php create mode 100644 src/Canteen/HTML5/Node.php create mode 100644 src/Canteen/HTML5/NodeContainer.php create mode 100644 src/Canteen/HTML5/SimpleList.php create mode 100644 src/Canteen/HTML5/Table.php create mode 100644 src/Canteen/HTML5/Text.php create mode 100644 src/Canteen/HTML5/html.php diff --git a/LICENSE b/LICENSE index 9d70b4d..cea2704 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Canteen +Copyright (c) 2013 Matt Karl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index af5b8ba..0ba4615 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,225 @@ -CanteenHTML5 -============ +#CanteenHTML5 -Create dynamic, valid HTML5 markup with a simple an intuitive PHP API +Create dynamic, well-formatted HTML5 markup with a simple an intuitive PHP API. This is a fork/rewrite of the [Gagawa](https://code.google.com/p/gagawa/) project. CanteenHTML5 is a concise, flexible and easy to remember API which makes it possible to create simple markup (such as a link) or more complex structures (such a table, document or nested list). All tags and attribute names are validated against the current HTML5 specification. + +##Requirements + + +This library requires a webserver running PHP 5.3+. Also, the root namespace for the library is `Canteen\HTML5`. + +##Installation + +Simply include the `html.php` file. + +```php +include 'lib/html.php'; +``` + +##Usage + +###Basic +To create an HTML node, simply call global `html` method, passing in the tag name and then any attributes. + +```php +echo html('img src=home.jpg'); +echo html('img', 'src=home.jpg'); +echo html('img', array('src'=>'home.jpg')); +``` + +All of these examples would output: + +```html + +``` + +###Adding Attributes + +There are dfferent ways to add attributes for HTML container nodes such as `

`, `

`, or in the example below, `