{"id":22695646,"url":"https://github.com/tina4stack/tina4php-shape","last_synced_at":"2025-10-08T05:19:51.109Z","repository":{"id":57070027,"uuid":"382618029","full_name":"tina4stack/tina4php-shape","owner":"tina4stack","description":"HTML Language called Shape where you write code to make HTML","archived":false,"fork":false,"pushed_at":"2023-12-11T13:12:01.000Z","size":359,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T20:21:41.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tina4stack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-07-03T13:07:11.000Z","updated_at":"2023-06-15T08:35:24.000Z","dependencies_parsed_at":"2023-12-11T14:51:30.324Z","dependency_job_id":null,"html_url":"https://github.com/tina4stack/tina4php-shape","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tina4stack%2Ftina4php-shape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tina4stack%2Ftina4php-shape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tina4stack%2Ftina4php-shape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tina4stack%2Ftina4php-shape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tina4stack","download_url":"https://codeload.github.com/tina4stack/tina4php-shape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248596870,"owners_count":21130779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T04:11:22.176Z","updated_at":"2025-10-08T05:19:46.037Z","avatar_url":"https://github.com/tina4stack.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tina4php-shape\nHTML Language called Shape where you write code to make HTML\n\n### Installation\n\n```bash\ncomposer require tina4stack/tina4php-shape\n```\n\n### Basic usage\n\nEach HTML tag has an underscore prefix, `\u003cp\u003e` tag would be `_p()`\n\n#### Normal Tag\n```php\necho _p(\"Hello\"); //\u003cp\u003eHello\u003c/p\u003e\n```\n\n#### Tag with Attributes\n```php\necho _div([\"class\" =\u003e \"form-group\"], \"Testing\"); //\u003cdiv class=\"form-group\"\u003eTesting\u003c/div\u003e\n```\n\n#### Nesting of tags\n\nSome things become easier to code due to nesting, think of un ordered lists or select tags.\n\n```php\n$lis = [];\n\n$lis[] = _li(\"One\");\n$lis[] = _li(\"Two\");\n\n$ul = _ul ($lis);\n\n$options = [];\n\n$options[] = _option(\"One\");\n$options[] = _option(\"Two\");\n\n$select = _select ([\"name\" =\u003e \"choose\"], $options);\n\n```\n\n#### Finding a tag by id\n\nSometimes you want to manipulate a tag's content, so we find it based on the id attribute.\n\n```php\n$tag = $html-\u003ebyId(\"someId\");\n```\n\n#### Set the html of a tag\n\n```php\n$tag-\u003ehtml(_p(\"Changed HTML\"));\n```\n\n\n\n### Example\n```php\n\u003c?php\nrequire_once \"vendor/autoload.php\";\n\n//Start some HTML\n\n$lis = [];\n\n$lis[] = _li(\"One\");\n$lis[] = _li(\"Two\");\n\n$ul = _ul ($lis);\n\n$html = _shape(\n    _doctype(\"html\"),\n    _html([\"lang\" =\u003e \"en\"],\n    _head(\n        _title(\"Testing\")\n    ),\n    _body(\n        _h1([\"id\" =\u003e \"someId\"],\"Hello World! H1\"),\n        _h2(\"Hello World! H2\"),\n        $a = _h3(\"Hello World! H3\"),\n        _h4(\"Hello World! H4\"),\n        _h5(\"Hello World! H5\"),\n        $ul\n    )\n));\n\n$a-\u003ehtml(_b([\"style\" =\u003e \"color: red\"],\"Hello\"));\n\n$html-\u003ebyId(\"someId\")-\u003ehtml(\"=====\");\n\necho $html;\n\n```\n\nYou should see something like this\n\n![](.README_images/d5d930a2.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftina4stack%2Ftina4php-shape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftina4stack%2Ftina4php-shape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftina4stack%2Ftina4php-shape/lists"}