Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/concordnow/ember-md-block
Insert markdown blocks in your hbs.
https://github.com/concordnow/ember-md-block
ember hacktoberfest markdown
Last synced: about 2 months ago
JSON representation
Insert markdown blocks in your hbs.
- Host: GitHub
- URL: https://github.com/concordnow/ember-md-block
- Owner: concordnow
- License: mit
- Created: 2021-04-02T13:58:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-05T16:42:43.000Z (about 3 years ago)
- Last Synced: 2024-11-04T10:47:37.912Z (about 2 months ago)
- Topics: ember, hacktoberfest, markdown
- Language: JavaScript
- Homepage:
- Size: 920 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-md-block
[![Build Status](https://github.com/concordnow/ember-md-block/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/concordnow/ember-md-block/actions/workflows/main.yml)
Insert markdown blocks in your template files.
They will be compiled into html at build time.## Compatibility
- Ember.js v3.16 or above
- Ember CLI v2.13 or above
- Node.js v10 or above## Installation
```
ember install ember-md-block
```## Usage
```handlebars
{{page-title "Dummy"}}{{! MD-BLOCK }}
# Hello| Header | Another header |
|---------|----------------|
| field 1 | something |
| field 2 | something else |{{! MD-BLOCK }}
```
will be compiled to
```handlebars
{{page-title "Dummy"}}
Hello
Header
Another header
field 1
something
field 2
something else
```
## Configuration
Configuration options can be placed in your `config/environment.js` under the `'ember-md-block'` key.
### Custom block delimiters
You can define your own regex to find markdown blocks. Just use the `blockRegexes` option:
```javascript
ENV['ember-md-block'] = {
blockRegexes: {
begin: /\CUSTOM-BLOCK\b/,
end: /\CUSTOM-BLOCK\b/,
},
};
```### Custom block wapper
You can also define your block wrapper own regex to find markdown blocks. Just use the `blockRegexes` option:
```javascript
ENV['ember-md-block'] = {
wrapper: {
begin: '\n',\n',
end: '
},
};
```## Contributing
See the [Contributing](CONTRIBUTING.md) guide for details.
## Thanks
- [markdown-wasm](https://github.com/rsms/markdown-wasm)
## License
This project is licensed under the [MIT License](LICENSE.md).