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
- Host: GitHub
- URL: https://github.com/unlight/remark-sources
- Owner: unlight
- License: mit
- Created: 2019-12-16T12:08:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T14:28:05.000Z (almost 4 years ago)
- Last Synced: 2025-09-28T09:43:24.220Z (8 months ago)
- Topics: remark, remark-plugin
- Language: JavaScript
- Size: 907 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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 = {};
```