All Projects → webuni → commonmark-attributes-extension

webuni / commonmark-attributes-extension

Licence: MIT license
The Attributes extension adds a syntax to define attributes on the various HTML elements in markdown’s output.

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to commonmark-attributes-extension

koino
CommonMark + GFM compatible Markdown parser and renderer
Stars: ✭ 81 (+153.13%)
Mutual labels:  commonmark
markdown-it-github-headings
Add anchors and links to headings just like Github does
Stars: ✭ 22 (-31.25%)
Mutual labels:  commonmark
swift-markdownkit
A framework for parsing and transforming text in Markdown format written in Swift 5 for macOS, iOS, and Linux. The supported syntax is based on the CommonMark specification. The framework defines an abstract syntax for Markdown, provides a parser for parsing strings into abstract syntax trees, and comes with generators for creating HTML and attr…
Stars: ✭ 64 (+100%)
Mutual labels:  commonmark
hyperscript-attribute-to-property
Convert hyperscript attributes to properties
Stars: ✭ 19 (-40.62%)
Mutual labels:  attributes
markdig.wpf
A WPF library for xoofx/markdig https://github.com/xoofx/markdig
Stars: ✭ 133 (+315.63%)
Mutual labels:  commonmark
clj-pdf-markdown
Library for rendering markdown to clj-pdf data-structure syntax.
Stars: ✭ 20 (-37.5%)
Mutual labels:  commonmark
attributes
PHP Attributes Reader. Subtree split of the Spiral Attributes component (see spiral/framework)
Stars: ✭ 22 (-31.25%)
Mutual labels:  attributes
front-matter
The most featured front matter (yaml, json, neon, toml) parser and dumper for PHP.
Stars: ✭ 23 (-28.12%)
Mutual labels:  commonmark
AdvancedHTMLParser
Fast Indexed python HTML parser which builds a DOM node tree, providing common getElementsBy* functions for scraping, testing, modification, and formatting. Also XPath.
Stars: ✭ 90 (+181.25%)
Mutual labels:  attributes
objection-authorize
isomorphic, "magical" authorization integration with Objection.js 🎉
Stars: ✭ 71 (+121.88%)
Mutual labels:  attributes
markdown
The first generation of Markdown rendering for R (born in 2012). Now R Markdown usually means the *r*markdown package instead of *markdown*. The repo for the former is at https://github.com/rstudio/rmarkdown
Stars: ✭ 64 (+100%)
Mutual labels:  commonmark
person-directory
A framework for resolving persons and attributes from a variety of underlying sources.
Stars: ✭ 26 (-18.75%)
Mutual labels:  attributes
lovelace-attribute-entity-row
Show attribute(s) on entity rows in Home Assistant's Lovelace UI
Stars: ✭ 21 (-34.37%)
Mutual labels:  attributes
magento-attribute-option-order-fix
A module to re-apply the relevance order for configurable attribute options in Magento CE 1.9.1 or EE 1.14.2
Stars: ✭ 27 (-15.62%)
Mutual labels:  attributes
markdom
A markdown parser for laravel for making beautiful html
Stars: ✭ 42 (+31.25%)
Mutual labels:  commonmark
score-zeroshot
Semantically consistent regularizer for zero-shot learning
Stars: ✭ 65 (+103.13%)
Mutual labels:  attributes
markdown-toolbar
A clone of GitHub's markdown toolbar
Stars: ✭ 19 (-40.62%)
Mutual labels:  commonmark
laravel-etched-blade
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.
Stars: ✭ 19 (-40.62%)
Mutual labels:  commonmark
import-cli-simple
This the meta package for Pacemaker Community, a Symfony based CLI application that provides import functionality for products, categories, attributes, and attribute-sets. The default format is CSV, adapters for XML are also available. The application can be declaratively extended by additional operations, which can be used to reassemble and exe…
Stars: ✭ 69 (+115.63%)
Mutual labels:  attributes
paka.cmark
Lightweight CFFI-based Python bindings to cmark library (CommonMark implementation in C).
Stars: ✭ 23 (-28.12%)
Mutual labels:  commonmark

CommonMark Attributes Extension

Packagist Build Status Scrutinizer Code Quality Code Coverage

The Attributes extension adds a syntax to define attributes on the various HTML elements in markdown’s output.

DEPRECATED

This extension has been deprecated. All of its functionality now exists in league/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.

Installation

This project can be installed via Composer:

composer require webuni/commonmark-attributes-extension

Usage

use League\CommonMark\Converter;
use League\CommonMark\DocParser;
use League\CommonMark\Environment;
use League\CommonMark\HtmlRenderer;
use Webuni\CommonMark\AttributesExtension\AttributesExtension;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new AttributesExtension());

$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

echo $converter->convertToHtml('# Hello World!');

Syntax

The basic syntax was inspired by Kramdown‘s Attribute Lists feature.

You can assign any attribute to a block-level element. Just directly prepend or follow the block with a block inline attribute list. That consists of a left curly brace, optionally followed by a colon, the attribute definitions and a right curly brace:

> A nice blockquote
{: title="Blockquote title"}

{#id .class}
## Header

As with a block-level element you can assign any attribute to a span-level elements using a span inline attribute list, that has the same syntax and must immediately follow the span-level element:

This is *red*{style="color: red"}.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].