Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vberlier/docutils-plugin-prismjs
Prism.js plugin for docutils.
https://github.com/vberlier/docutils-plugin-prismjs
docutils prismjs restructuredtext sphinx syntax-highlighting
Last synced: 5 days ago
JSON representation
Prism.js plugin for docutils.
- Host: GitHub
- URL: https://github.com/vberlier/docutils-plugin-prismjs
- Owner: vberlier
- License: mit
- Created: 2020-03-26T01:45:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T18:55:05.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T22:29:02.474Z (about 1 month ago)
- Topics: docutils, prismjs, restructuredtext, sphinx, syntax-highlighting
- Language: JavaScript
- Homepage:
- Size: 204 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docutils-plugin-prismjs
[![Build Status](https://travis-ci.com/vberlier/docutils-plugin-prismjs.svg?branch=master)](https://travis-ci.com/vberlier/docutils-plugin-prismjs)
[![npm](https://img.shields.io/npm/v/docutils-plugin-prismjs.svg)](https://www.npmjs.com/package/docutils-plugin-prismjs)> Prism.js plugin for docutils.
This [docutils](https://github.com/vberlier/docutils) plugin highlights the content of `literal_block` elements with [Prism.js](https://prismjs.com).
```js
const docutils = require('docutils')
const highlight = require('docutils-plugin-prismjs')const document = docutils.parse(string, [highlight])
```The plugin removes the children of every `literal_block` elements and stores the highlighted code in the `html` attribute of the element. The plugin retrieves the name of the language form the `language` attribute. The `html` attribute will be set to the original code if the language is not supported by [Prism.js](https://prismjs.com).
## Installation
You can install `docutils-plugin-prismjs` with your `npm` client of choice.
```bash
$ npm install docutils-plugin-prismjs
```## Contributing
Contributions are welcome. The code follows the [javascript standard](https://standardjs.com/) style guide.
```bash
$ npm run lint
```---
License - [MIT](https://github.com/vberlier/docutils-plugin-prismjs/blob/master/LICENSE)