Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkwill87/remark-obj-loader
A markdown loader for WebPack using remark
https://github.com/jkwill87/remark-obj-loader
hacktoberfest loader webpack
Last synced: about 1 month ago
JSON representation
A markdown loader for WebPack using remark
- Host: GitHub
- URL: https://github.com/jkwill87/remark-obj-loader
- Owner: jkwill87
- Created: 2020-09-30T19:53:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-03T07:57:38.000Z (over 4 years ago)
- Last Synced: 2024-10-31T17:48:04.526Z (2 months ago)
- Topics: hacktoberfest, loader, webpack
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# remark-obj-loader
A markdown loader for WebPack using [remark](https://github.com/remarkjs/remark). It exports an object contain two entries:
- **`html`**: containing the HTML representation of markdown
- **`attrs`**: containing frontmatter attributes## Installation instructions
- **npm**: `npm install -D remark remark-obj-loader`
- **yarn**: `yarn add -D remark remark-obj-loader`## Options
remark-obj-loader has a single option: **`plugins`**. Any passed [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) will be applied to the markdown body before being converted into html.
## Configuration Examples
### `webpack.config.js`
``` javascript
const RemarkFencedDivs = require('remark-fenced-divs')
const RemarkUnwrapImages = require('remark-unwrap-images')module.exports = {
//...
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: 'remark-obj-loader',
options: {
plugins: [RemarkFencedDivs, RemarkUnwrapImages]
}
}
]
}
]
}
// ...
}
```### `vue.config.js`
``` javascript
const RemarkFencedDivs = require('remark-fenced-divs')
const RemarkUnwrapImages = require('remark-unwrap-images')module.exports = {
// ...
chainWebpack: config => {
config.module
.rule('markdown')
.test(/\.md$/)
.use('remark-obj-loader')
.loader('remark-obj-loader')
.options({
plugins: [
RemarkFencedDivs,
RemarkUnwrapImages
]
})
},
// ...
}
```