Skip to content

Commit

Permalink
Merge pull request #138 from SanderKnauff/fix-documentation
Browse files Browse the repository at this point in the history
Update README.md to reflect the changes in 8.0.0
  • Loading branch information
mansona authored Feb 7, 2024
2 parents d3ee475 + c4f3079 commit c35f2cd
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This addon provides a component that transforms [Markdown](http://en.wikipedia.o
Passing a markdown string inline:

```handlebars
{{markdown-to-html "#Markdown is cool [link](http://emberjs.com)"}}
<MarkdownToHtml @markdown="#Markdown is cool [link](http://emberjs.com)" />
```

```html
Expand All @@ -32,19 +32,20 @@ Passing a markdown string inline:
You can also pass a bound value:

```handlebars
{{markdown-to-html postContent}}
<MarkdownToHtml @markdown={{postContent}} />
```

### Showdown Options

You can use [configuration settings from Showdown][showdown-config]:

```handlebars
{{markdown-to-html
markdown=postContent
strikethrough=true
literalMidWordUnderscores=true
simplifiedAutoLink=true}}
<MarkdownToHtml
@markdown={{postContent}}
@strikethrough={{true}}
@literalMidWordUnderscores={{true}}
@simplifiedAutoLink={{true}}
/>
```

[showdown-config]: https://github.com/showdownjs/showdown#valid-options
Expand Down Expand Up @@ -75,15 +76,17 @@ You can load [Showdown Extensions](https://github.com/showdownjs/showdown/wiki/e
"extensions" property when initializing your component:

```handlebars
{{markdown-to-html
markdown=postContent
extensions=myExtensionList}}
<MarkdownToHtml
@markdown={{postContent}}
@extensions={{myExtensionList}}
/>
```

```handlebars
{{markdown-to-html
markdown=postContent
extensions='foo bar baz'}}
<MarkdownToHtml
@markdown={{postContent}}
@extensions="foo bar baz"
/>
```

(`myExtensionList` can be an array of strings or a space separated string)
Expand Down Expand Up @@ -118,6 +121,10 @@ export default {
* Global `showdown` is no longer supported. Must be imported via `import showdown from 'showdown'`
* Remove any use of `FastBoot.require('require')` with `import showdown from 'showdown'`

## 7.x to 8.x migration

* Positional parameters are no longer supported. Use the `@markdown` argument to provide the markdown content to `<MarkdownToHtml />`.

## Dependencies
* [Showdown](https://github.com/showdownjs/showdown)

Expand Down

0 comments on commit c35f2cd

Please sign in to comment.