Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajasegar/remark-ember-abc
A remark plugin to transform Handlebars codeblocks to Angle brackets syntax
https://github.com/rajasegar/remark-ember-abc
codemod codemods documentation ember markdown readme remark remark-plugin
Last synced: 10 days ago
JSON representation
A remark plugin to transform Handlebars codeblocks to Angle brackets syntax
- Host: GitHub
- URL: https://github.com/rajasegar/remark-ember-abc
- Owner: rajasegar
- License: mit
- Created: 2020-04-17T05:46:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T06:26:12.000Z (over 1 year ago)
- Last Synced: 2024-10-07T03:23:03.919Z (30 days ago)
- Topics: codemod, codemods, documentation, ember, markdown, readme, remark, remark-plugin
- Language: JavaScript
- Size: 240 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# remark-ember-abc
[remark](https://github.com/remarkjs/remark) plugin to transform the code blocks
in Handlebars syntax to Angle brackets syntax for Ember apps/addon documentation written in Markdown.
It will only transform codeblocks of `hbs` type and leave the rest intact.## Install
Install `remark-cli` and this plugin globally and use it:
```
npm install -g remark-cli remark-ember-abc
```## Usage
```
remark README.md --use ember-abc
```
This will print the changed content in the console.If you want to overwrite then use the output option `-o`
```
remark README.md --use ember-abc -o
```To apply the transform to all Markdown files in the folder tree (even in nested sub-directories):
```
remark . --use ember-abc -o
```## Example
This will be converted to:
```
One sentence. Two sentences.One sentence. Two sentences.
\```hbs
{{#ally-landmark tagName="header"}}
This is my header content
{{/ally-landmark}}
\```\```html
Hello world
\```\```js
const hello = "world";
\```
```to this:
```
One sentence. Two sentences.One sentence. Two sentences.
\```hbs
This is my header content
\```
\```html
Hello world
\```\```js
const hello = "world";
\```
```For more options using the `remark-cli` visit the official [guides](https://github.com/remarkjs/remark/tree/master/packages/remark-cli)
## Info
The transformation is based on the [ember-angle-brackets-codemod](https://github.com/ember-codemods/ember-angle-brackets-codemod)
and tweaked specifically for this plugin. You can take a look at the `src` folder `transform.js`.