{"id":20976922,"url":"https://github.com/pixelbrackets/html5-mini-template","last_synced_at":"2026-05-22T10:16:08.735Z","repository":{"id":145819659,"uuid":"200648888","full_name":"pixelbrackets/html5-mini-template","owner":"pixelbrackets","description":"HTML5 Mini Template for quick rendering of status pages, TOC pages, or any other minimal single-serving site","archived":false,"fork":false,"pushed_at":"2022-11-10T11:16:00.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T18:29:38.204Z","etag":null,"topics":["html5","microservice","minimal","php","stylesheet","template"],"latest_commit_sha":null,"homepage":"https://gitlab.com/pixelbrackets/html5-mini-template/","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/pixelbrackets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-05T12:12:39.000Z","updated_at":"2022-11-09T21:21:58.000Z","dependencies_parsed_at":"2023-05-26T21:30:38.238Z","dependency_job_id":null,"html_url":"https://github.com/pixelbrackets/html5-mini-template","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Fhtml5-mini-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Fhtml5-mini-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Fhtml5-mini-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelbrackets%2Fhtml5-mini-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelbrackets","download_url":"https://codeload.github.com/pixelbrackets/html5-mini-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243381265,"owners_count":20281921,"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":["html5","microservice","minimal","php","stylesheet","template"],"created_at":"2024-11-19T04:56:20.229Z","updated_at":"2025-12-28T10:57:58.292Z","avatar_url":"https://github.com/pixelbrackets.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML5 Mini Template\n\n[![Version](https://img.shields.io/packagist/v/pixelbrackets/html5-mini-template.svg?style=flat-square)](https://packagist.org/packages/pixelbrackets/html5-mini-template/)\n[![Build Status](https://img.shields.io/gitlab/pipeline/pixelbrackets/html5-mini-template?style=flat-square)](https://gitlab.com/pixelbrackets/html5-mini-template/pipelines)\n[![Made With](https://img.shields.io/badge/made_with-php-blue?style=flat-square)](https://gitlab.com/pixelbrackets/html5-mini-template#requirements)\n[![License](https://img.shields.io/badge/license-gpl--2.0--or--later-blue.svg?style=flat-square)](https://spdx.org/licenses/GPL-2.0-or-later.html)\n[![Contribution](https://img.shields.io/badge/contributions_welcome-%F0%9F%94%B0-brightgreen.svg?labelColor=brightgreen\u0026style=flat-square)](https://gitlab.com/pixelbrackets/html5-mini-template/-/blob/master/CONTRIBUTING.md)\n\nHTML5 Mini Template for quick rendering of status pages, TOC pages,\nor any other minimal single-serving site.\n\n![Screenshot](./docs/screenshot.png)\n\n_⭐ You like this package? Please star it or send a tweet. ⭐_\n\n## Vision\n\nThis package provides a single class to turn a message or HTML-snippet into\na valid HTML5 document.\n\nThis way it is possible to let an app return an HTML response without the need\nto store a template file beforehand or initialize a full-blown template engine.\n\nThe package therefore does not have template variables or modifiers.\nTwo lines of code should be sufficient to wrap a given text into a valid\nHTML document. One more to add a link to fancy stylesheet.\n\nSee [»Usage«](#usage) for some examples.\n\nThe package follows the KISS principle.\n\n## Webapp\n\nThis package is used on [html5example.com](https://html5example.com/).\n\nIf you are in need of a boilerplate HTML document once only, then you may use a\ncommandline tool like cURL or HTTPie and run\n`http https://html5example.com \u003e index.html` to save a template file.\n\nThe webapp supports some [options](#options) of this package as well,\nfor example\n`http POST https://html5example.com title=Minimal-Template \u003e index.html`\nto pass a custom title.\n\n## Requirements\n\n- PHP\n\n## Installation\n\nPackagist Entry https://packagist.org/packages/pixelbrackets/html5-mini-template/\n\n## Source\n\nhttps://gitlab.com/pixelbrackets/html5-mini-template/\n\nMirror https://github.com/pixelbrackets/html5-mini-template/ (Issues \u0026 Pull Requests\nmirrored to GitLab)\n\n## Demo\n\n⌨️ [`php tests/demo.php`](./tests/demo.php).\n\n## Usage\n\n1. Wrap a message into a HTML5 document, return to a PSR-7 implementation\n   ```php\n   $template = new \\Pixelbrackets\\Html5MiniTemplate\\Html5MiniTemplate();\n   $template-\u003esetContent('\u003ch1\u003eStatus\u003c/h1\u003e\u003cp\u003eAll Systems Operational\u003c/p\u003e');\n   return $template-\u003egetMarkup();\n   ```\n\n1. Wrap a message, use a preconfigured CSS framework CDN\n   (see [»options«](#options) for a list of supported frameworks),\n   and save the document into a file\n   ```php\n   $template = new \\Pixelbrackets\\Html5MiniTemplate\\Html5MiniTemplate();\n   $template-\u003esetStylesheet('barbone');\n   $template-\u003esetContent('\u003ch1\u003eIndex\u003c/h1\u003e\u003cp\u003eNothing to see here\u003c/p\u003e');\n   file_put_contents('/var/www/example/index.html', $template-\u003egetMarkup());\n   ```\n\n1. Wrap a message, set your own stylesheet URL, set a title,\n   output the document\n   ```php\n   $template = (new \\Pixelbrackets\\Html5MiniTemplate\\Html5MiniTemplate())\n       -\u003esetStylesheet('/assets/styles.css')\n       -\u003esetTitle('Index')\n       -\u003esetContent('\u003ch1\u003eTOC\u003c/h1\u003e\u003cul\u003e\u003cli\u003ea\u003c/li\u003e\u003cli\u003eb\u003c/li\u003e\u003c/ul\u003e');\n   echo $template-\u003egetMarkup();\n   ```\n\n1. Get the boilerplate example template only (👉 or use the [Webapp](#webapp))\n   ```php\n   echo \\Pixelbrackets\\Html5MiniTemplate\\Html5MiniTemplate::getTemplate();\n   ```\n\n### Options\n\n- `setContent()` (*string*) the message to show, any HTML string to set\n  the main content of the document – if empty, then a\n  [boilerplate](https://html5example.com/) example content is used instead\n  - 💭 You work with Markdown content? Use the drop-in replacement package\n    [pixelbrackets/markdown-mini-page](https://packagist.org/packages/pixelbrackets/markdown-mini-page/)\n    to convert Markdown into HTML straightaway\n- `setStylesheet()` (*string*) may be a URL to any existing stylesheet *or*\n  one of following reserved keywords – each keyword creates a link to a CDN\n  of the associated CSS framework\n  - `barebone` ([Barebone Stylesheet](https://github.com/pixelbrackets/barebone-stylesheet/)) – *super lightweight*\n  - `bootstrap` ([Bootstrap](https://github.com/twbs/bootstrap/))\n  - `gfm` ([GitHub Flavored Markdown Stylesheet](https://github.com/pixelbrackets/gfm-stylesheet/))\n  - `milligram` ([Milligram](https://github.com/milligram/milligram/))\n  - `minicss` ([mini.css](https://github.com/Chalarangelo/mini.css/))\n  - `mui` ([MUI - Material Design CSS Framework](https://github.com/muicss/mui/))\n  - `mvp` ([MVP.css](https://github.com/andybrewer/mvp/))\n  - `picnic` ([Picnic CSS](https://github.com/franciscop/picnic/))\n  - `skeleton` ([Skeleton](https://github.com/dhg/Skeleton/))\n- `setStylesheetMode()` (*string*) switch between a link to the given stylesheet\n  (using the constant `Html5MiniTemplate::STYLE_LINK`, this is the default mode)\n  or fetch the stylesheet file content and print it inline\n  (using the constant `Html5MiniTemplate::STYLE_INLINE`)\n- `setTitle()` (*string*) the document title – if empty, then the first H1\n  headline found in the main content is used as title instead\n- `setAdditionalMetadata()` (*string*) any additional metadata like metatags,\n  custom styles or link references like a canonical link\n  - ⚠️ Usage of this option is an indicator that the given use case is too\n    specific and switching to a template engine like the minimal\n    [slim/php-view](https://packagist.org/packages/slim/php-view) or the\n    powerfull [twig/twig](https://packagist.org/packages/twig/twig)\n    should be considered\n\n## License\n\nGNU General Public License version 2 or later\n\nThe GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html.\n\n## Author\n\nDan Untenzu (\u003cmail@pixelbrackets.de\u003e / [@pixelbrackets](https://pixelbrackets.de))\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md)\n\n## Contribution\n\nThis script is Open Source, so please use, share, patch, extend or fork it.\n\n[Contributions](./CONTRIBUTING.md) are welcome!\n\n## Feedback\n\nPlease send some [feedback](https://pixelbrackets.de/) and share how this\npackage has proven useful to you or how you may help to improve it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelbrackets%2Fhtml5-mini-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelbrackets%2Fhtml5-mini-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelbrackets%2Fhtml5-mini-template/lists"}