{"id":16124282,"url":"https://github.com/jongacnik/kirby-wrappers","last_synced_at":"2025-09-12T04:41:32.075Z","repository":{"id":56998656,"uuid":"83369602","full_name":"jongacnik/kirby-wrappers","owner":"jongacnik","description":"Simple wrapper tags for Kirbytext","archived":false,"fork":false,"pushed_at":"2020-07-08T06:25:17.000Z","size":12,"stargazers_count":19,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T09:21:02.597Z","etag":null,"topics":["kirby","kirby-plugin","kirby3-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jongacnik.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T00:00:16.000Z","updated_at":"2021-05-30T21:10:53.000Z","dependencies_parsed_at":"2022-08-21T14:50:26.181Z","dependency_job_id":null,"html_url":"https://github.com/jongacnik/kirby-wrappers","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fkirby-wrappers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fkirby-wrappers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fkirby-wrappers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongacnik%2Fkirby-wrappers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jongacnik","download_url":"https://codeload.github.com/jongacnik/kirby-wrappers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926063,"owners_count":20369911,"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":["kirby","kirby-plugin","kirby3-plugin"],"created_at":"2024-10-09T21:20:25.086Z","updated_at":"2025-03-18T12:31:37.655Z","avatar_url":"https://github.com/jongacnik.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kirby Wrappers\n\nSimple wrapper tags for Kirbytext.\n\n`(wrapper)(/wrapper)` → `\u003cdiv class=\"wrapper\"\u003e\u003c/div\u003e`\n\n## Installation\n\n```\ncomposer require jg/kirby-wrappers\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOther installation methods\u003c/summary\u003e\n\n### Download\n\nDownload and copy this repository to `/site/plugins/kirby-wrappers`.\n\n### Git submodule\n\n```\ngit submodule add https://github.com/jg/kirby-wrappers.git site/plugins/kirby-wrappers\n```\n\u003c/details\u003e\n\n## Example\n\nLet's create a `columns` wrapper. \n\n**config.php**\n\n```php\nreturn [\n  'jg.wrappers' =\u003e ['columns']\n];\n```\n\n**kirbytext**\n\n```md\n(columns)\n  - One\n  - Two\n  - Three\n(/columns)\n```\n\n**output**\n\n```html\n\u003cdiv class=\"columns\"\u003e\n  \u003cul\u003e\n    \u003cli\u003eOne\u003c/li\u003e\n    \u003cli\u003eTwo\u003c/li\u003e\n    \u003cli\u003eThree\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n```\n\n## Configuration\n\nYou can specify wrapper tags as `Strings` or `Arrays` with `wrapper`, `class`, `tag`, and `attributes` keys. Arrays are useful when you want the tag and the associated classname to be different, or you want to use a tag other than `div`.\n\n**config.php**\n\n```php\nreturn [\n  'jg.wrappers' =\u003e [\n    'center', // ← simplest\n    [\n      'wrapper' =\u003e 'gallery',\n      'class' =\u003e 'image-gallery',\n    ],\n    [\n      'wrapper' =\u003e 'card',\n      'tag' =\u003e 'article',\n    ],\n    [\n      'wrapper' =\u003e 'toggle',\n      'attributes' =\u003e [\n        'data-component' =\u003e 'toggle'\n      ]\n    ],\n    [\n      'wrapper' =\u003e 'modal',\n      'class' =\u003e false // ← pass false to disable class\n      'attributes' =\u003e [\n        'data-component' =\u003e 'modal'\n      ]\n    ]\n  ]\n];\n```\n\n**kirbytext**\n\n```md\n(center)(/center)\n(gallery)(/gallery)\n(card)(/card)\n(toggle)(/toggle)\n(modal)(/modal)\n```\n\n**output**\n\n```html\n\u003cdiv class=\"center\"\u003e\u003c/div\u003e\n\u003cdiv class=\"image-gallery\"\u003e\u003c/div\u003e\n\u003carticle class=\"card\"\u003e\u003c/article\u003e\n\u003cdiv class=\"toggle\" data-component=\"toggle\"\u003e\u003c/div\u003e\n\u003cdiv data-component=\"modal\"\u003e\u003c/div\u003e\n```\n\n## Passing Data\n\nYou can optionally pass additional data into data-attributes:\n\n**kirbytext**\n\n```md\n(gallery size: large)(/gallery)\n```\n\n**output**\n\n```html\n\u003cdiv class=\"gallery\" data-size=\"large\"\u003e\u003c/div\u003e\n```\n\n## Nesting\n\nDoes nesting work? Yep.\n\n**kirbytext**\n\n```md\n(outer)(inner)(/inner)(/outer)\n```\n\n**output**\n\n```html\n\u003cdiv class=\"outer\"\u003e\u003cdiv class=\"inner\"\u003e\u003c/div\u003e\u003c/div\u003e\n```\n\n## Why?\n\nThis is handy if you need to wrap content in Kirby to do fancy stuff with js and css.\n\n## Notes\n\n- Kirby 2 version found under the `k2` branch","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongacnik%2Fkirby-wrappers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjongacnik%2Fkirby-wrappers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongacnik%2Fkirby-wrappers/lists"}