diff --git a/.github/alto-commonmark.svg b/.github/alto-commonmark.svg new file mode 100644 index 0000000..782fe71 --- /dev/null +++ b/.github/alto-commonmark.svg @@ -0,0 +1,16 @@ + + + ALTO CommonMark + Install with composer require alto/commonmark. + + + diff --git a/README.md b/README.md index 6c48212..c1caaa5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,28 @@ -# Alto CommonMark +

+ + ALTO CommonMark + +

Reusable `league/commonmark` extensions in a monorepo, installable as either the umbrella package `alto/commonmark` or as standalone per-extension packages. +## Quick start + +```php +use Alto\CommonMark\Extension\HeadingLevel\HeadingLevelExtension; +use League\CommonMark\Environment\Environment; +use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; +use League\CommonMark\MarkdownConverter; + +$environment = new Environment(); +$environment->addExtension(new CommonMarkCoreExtension()); +$environment->addExtension(new HeadingLevelExtension(['down' => 1])); + +echo (new MarkdownConverter($environment))->convert('# Hello'); +``` + +This renders `

Hello

` so the document can sit beneath a page title. + ## Installation ```bash