https://github.com/jerone/turndown-plugin-github-code-snippet
A Turndown plugin to convert GitHub code snippet in comments back into normal links.
https://github.com/jerone/turndown-plugin-github-code-snippet
turndown turndown-plugin
Last synced: 7 months ago
JSON representation
A Turndown plugin to convert GitHub code snippet in comments back into normal links.
- Host: GitHub
- URL: https://github.com/jerone/turndown-plugin-github-code-snippet
- Owner: jerone
- License: gpl-3.0
- Created: 2019-02-02T19:36:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T23:49:48.000Z (about 2 years ago)
- Last Synced: 2025-03-25T20:33:29.110Z (about 1 year ago)
- Topics: turndown, turndown-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/turndown-plugin-github-code-snippet
- Size: 550 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [turndown-plugin-github-code-snippet](https://github.com/jerone/turndown-plugin-github-code-snippet/)
[](https://sonarcloud.io/summary/new_code?id=jerone_turndown-plugin-github-code-snippet)
> A [Turndown](https://github.com/mixmark-io/turndown) plugin to convert [GitHub code snippet in comments](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/) back into normal links. Useful for UserScripts.
## Requirements
- [Turndown](https://github.com/mixmark-io/turndown) - version 4 or higher.
## Installation
As a NPM package:
```sh
npm install turndown-plugin-github-code-snippet
```
In an UserScript:
```js
// @require https://unpkg.com/turndown/dist/turndown.js
// @require https://unpkg.com/turndown-plugin-github-code-snippet/src/turndown-plugin-github-code-snippet.js
```
## Usage
```js
var turndownService = new TurndownService();
turndownService.use(turndownPluginGitHubCodeSnippet);
var markdown = turndownService.turndown(document.querySelector(".comment"));
console.log(markdown);
```
## License
turndown-plugin-github-code-snippet is copyright © 2019+ Jeroen van Warmerdam and released under the [GNU General Public License v3.0 license](https://github.com/jerone/turndown-plugin-github-code-snippet/blob/master/LICENSE).
[](https://stand-with-ukraine.pp.ua)