An open API service indexing awesome lists of open source software.

https://github.com/unlight/remark-sources

Inserts source code to markdown files
https://github.com/unlight/remark-sources

remark remark-plugin

Last synced: 4 months ago
JSON representation

Inserts source code to markdown files

Awesome Lists containing this project

README

          

# remark-sources

Inject source code to markdown files.

## Install

```sh
npm install --save-dev remark-sources
```

## Usage

````js
const remark = require('remark');
const sources = require('remark-sources');
const input = '```js (index.js)\n```'; // (path to file in round brackets)
const options = {};
const output = remark().use(sources, options).processSync(input).toString();
````

Output:

```ts
// this is index.js content
```

## Options

```js
const defaultOptions = {};
```