{"id":13828314,"url":"https://github.com/webuni/commonmark-attributes-extension","last_synced_at":"2025-07-09T06:31:38.300Z","repository":{"id":34875308,"uuid":"38884603","full_name":"webuni/commonmark-attributes-extension","owner":"webuni","description":"The Attributes extension adds a syntax to define attributes on the various HTML elements in markdown’s output.","archived":true,"fork":false,"pushed_at":"2020-06-23T18:51:35.000Z","size":44,"stargazers_count":31,"open_issues_count":0,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-09T17:51:40.262Z","etag":null,"topics":["attributes","commonmark"],"latest_commit_sha":null,"homepage":null,"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/webuni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-10T14:29:57.000Z","updated_at":"2024-01-21T13:56:29.000Z","dependencies_parsed_at":"2022-09-13T02:51:52.525Z","dependency_job_id":null,"html_url":"https://github.com/webuni/commonmark-attributes-extension","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webuni%2Fcommonmark-attributes-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webuni%2Fcommonmark-attributes-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webuni%2Fcommonmark-attributes-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webuni%2Fcommonmark-attributes-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webuni","download_url":"https://codeload.github.com/webuni/commonmark-attributes-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"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":["attributes","commonmark"],"created_at":"2024-08-04T09:02:40.937Z","updated_at":"2024-11-20T08:30:25.539Z","avatar_url":"https://github.com/webuni.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"CommonMark Attributes Extension\n===============================\n\n[![Packagist](https://img.shields.io/packagist/v/webuni/commonmark-attributes-extension.svg?style=flat-square)](https://packagist.org/packages/webuni/commonmark-attributes-extension)\n[![Build Status](https://travis-ci.org/webuni/commonmark-attributes-extension.svg?branch=master)](https://travis-ci.org/webuni/commonmark-attributes-extension)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/webuni/commonmark-attributes-extension/?branch=master)\n\nThe Attributes extension adds a syntax to define attributes on the various HTML elements in markdown’s output.\n\n## DEPRECATED\n\n**This extension has been deprecated**.  All of its functionality now exists in [`league/commonmark`](https://github.com/thephpleague/commonmark) 1.5+ under the `League\\CommonMark\\Extension\\Attributes` namespace, so you should upgrade to that version and use that bundled extension instead of this one.\n\n\nInstallation\n------------\n\nThis project can be installed via Composer:\n\n    composer require webuni/commonmark-attributes-extension\n    \nUsage\n-----\n\n```php\nuse League\\CommonMark\\Converter;\nuse League\\CommonMark\\DocParser;\nuse League\\CommonMark\\Environment;\nuse League\\CommonMark\\HtmlRenderer;\nuse Webuni\\CommonMark\\AttributesExtension\\AttributesExtension;\n\n$environment = Environment::createCommonMarkEnvironment();\n$environment-\u003eaddExtension(new AttributesExtension());\n\n$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));\n\necho $converter-\u003econvertToHtml('# Hello World!');\n```\n\nSyntax\n------\n\nThe basic syntax was inspired by [Kramdown](http://kramdown.gettalong.org/syntax.html#attribute-list-definitions)‘s Attribute Lists feature.\n\nYou can assign any attribute to a block-level element. Just directly prepend or follow the block with a block inline attribute list.\nThat consists of a left curly brace, optionally followed by a colon, the attribute definitions and a right curly brace:\n\n```markdown\n\u003e A nice blockquote\n{: title=\"Blockquote title\"}\n\n{#id .class}\n## Header\n```\n\nAs with a block-level element you can assign any attribute to a span-level elements using a span inline attribute list,\nthat has the same syntax and must immediately follow the span-level element:\n\n```markdown\nThis is *red*{style=\"color: red\"}.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebuni%2Fcommonmark-attributes-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebuni%2Fcommonmark-attributes-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebuni%2Fcommonmark-attributes-extension/lists"}