empress / empress/field-guide

Unable (or unclear how) to set showdown config

Open
#73 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
19
Forks
7
PR merge metrics
No merged PRs in 30d

Description

[Per the docs for ember-cli-showdown](https://github.com/empress/ember-cli-showdown#global-showdown-options) it should be possible to set global showdown config via an app's `environment.js`. However, these options [don't appear to be passed along to showdown as part of the way showdown is invoked in field-guide](https://github.com/empress/field-guide/blob/37ba2c2e116f5a83be1fe1b564bfd7474646466f/addon/controllers/show.js).

I was able to make this work by doing something like this, but it's unclear if this is the best solution of if there is something else I'm missing here.

```js
export default Controller.extend({
fieldGuideConfig: config['field-guide'],
showdownConfig: config['showdown'],
renderedContent: computed('model.content', function() {
const converter = new showdown.Converter(this.showdownConfig);
return converter.makeHtml(this.model.content);
})
})
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.