Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergeysova/remark-effector-publish
https://github.com/sergeysova/remark-effector-publish
effector
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sergeysova/remark-effector-publish
- Owner: sergeysova
- Created: 2020-07-24T13:44:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T11:34:02.000Z (over 1 year ago)
- Last Synced: 2023-08-03T12:41:49.306Z (over 1 year ago)
- Topics: effector
- Language: JavaScript
- Homepage: https://npmjs.com/remark-effector-share
- Size: 1.16 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# remark-effector-share
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](http://prettier.io)
A [remark](https://github.com/wooorm/remark) plugin that downloads source code of the [effector](https://effector.dev) [repl sharing](https://share.effector.dev).
## Installation
```sh
npm add -D remark-effector-share
# or
yarn add -D remark-effector-share
```## Usage
1. First of all create a new share at https://share.effector.dev.
2. Save it and get actual link to it. Example: https://share.effector.dev/FASHhHwG
3. Create code block and add link to block metadata. Like this:```js https://share.effector.dev/FASHhHwG
```## Messages
Messages are added to the vFile's as they are processed and can be accessed using `file.messages`.
### `info`
Added when link correct and source code downloaded successfully:
```
example.md:1:1-1:2: Downloaded share https://share.effector.dev/FASHhHwG
```### `error`
Added when something went wrong. Ex.: link is incorrect
```
example.md:1:1-1:2: Share https://share.effector.dev/FASHhHw1 not found
``````
example.md:1:1-1:2: Unexpected error
```## Example
```js
var vfile = require('to-vfile');
var remark = require('remark');
var effectorShare = require('remark-effector-share');var example = vfile.readSync('example.md');
remark()
.use(effectorShare)
.process(example, function (err, file) {
if (err) throw err;console.log(String(file));
});
```