A remark plugin that downloads source code of the effector repl sharing.
npm add -D remark-effector-share
# or
yarn add -D remark-effector-share
-
First of all create a new share at https://share.effector.dev.
-
Save it and get actual link to it. Example: https://share.effector.dev/FASHhHwG
-
Create code block and add link to block metadata. Like this:
```js https://share.effector.dev/FASHhHwG ```
Messages are added to the vFile's as they are processed and can be accessed using file.messages
.
Added when link correct and source code downloaded successfully:
example.md:1:1-1:2: Downloaded share https://share.effector.dev/FASHhHwG
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
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));
});