https://github.com/imcuttle/remark-preset-gfm
Remark preset for gfm
https://github.com/imcuttle/remark-preset-gfm
Last synced: over 1 year ago
JSON representation
Remark preset for gfm
- Host: GitHub
- URL: https://github.com/imcuttle/remark-preset-gfm
- Owner: imcuttle
- License: mit
- Created: 2018-10-27T12:47:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T14:32:12.000Z (over 4 years ago)
- Last Synced: 2025-04-03T20:39:00.841Z (over 1 year ago)
- Language: HTML
- Homepage:
- Size: 85 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
# remark-preset-gfm
[](https://travis-ci.org/imcuttle/remark-preset-gfm)
[](https://codecov.io/github/imcuttle/remark-preset-gfm?branch=master)
[](https://www.npmjs.com/package/remark-preset-gfm)
[](https://www.npmjs.com/package/remark-preset-gfm)
[](https://prettier.io/)
[](https://conventionalcommits.org)
[Remark](https://github.com/remarkjs/remark) preset for gfm (GitHub Favorite Markdown)
## Features
- Github break line
- Gemoji
- Svg head link anchor
- Code highlight
## Installation
```bash
npm install remark-preset-gfm
# or use yarn
yarn add remark-preset-gfm
```
## Usage
```javascript
const remark = require('remark')
const html = require('remark-html')
const gfm = require('remark-preset-gfm')
const markdownHtml = remark()
.use(gfm)
.use(html)
.processSync('markdown text')
.toString()
const htmlOutput = `
.markdown-body {
max-width: 65%;
margin: 40px auto 30px;
}
@media screen and (max-width: 1200px) {
.markdown-body {
max-width: 78%;
}
}
@media screen and (max-width: 700px) {
.markdown-body {
max-width: 90%;
margin: 20px auto 10px;
}
}
@media screen and (max-width: 400px) {
.markdown-body {
max-width: 98%;
margin: 20px auto 10px;
}
}
${markdownHtml}
`
```
## Related
- [github-markdown-css](https://github.com/sindresorhus/github-markdown-css) - The minimal amount of CSS to replicate the GitHub Markdown style
- [Highlight.js github style](https://github.com/highlightjs/highlight.js/blob/master/src/styles/github.css)
## Contributing
- Fork it!
- Create your new branch:
`git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
`git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)
## Authors
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
## License
MIT - [imcuttle](https://github.com/imcuttle) 🐟