https://github.com/valor-software/prismjs-loader
prismjs-loader for webpack, http://prismjs.com/
https://github.com/valor-software/prismjs-loader
Last synced: 6 months ago
JSON representation
prismjs-loader for webpack, http://prismjs.com/
- Host: GitHub
- URL: https://github.com/valor-software/prismjs-loader
- Owner: valor-software
- License: mit
- Created: 2015-09-02T09:59:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T22:31:27.000Z (over 5 years ago)
- Last Synced: 2025-06-17T11:02:06.598Z (7 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# prismjs-loader for webpack
prismjs-loader for webpack, [http://prismjs.com/](http://prismjs.com/)
# Installation
```bash
npm install -D prismjs-loader
```
# Usage
Don't forget to provide file type via query, so loader can choose correct component to use.
List of components to use: [link](https://github.com/PrismJS/prism/tree/gh-pages/components)
If component called `prism-apacheconf.js` you need to provide `apacheconf` via query.
On ui you need to add ref to stylesheet with prism theme,
demo of themes [here](http://prismjs.com/),
list of stylesheets [here](https://github.com/PrismJS/prism/tree/gh-pages/themes)
*Note*: don't use this loader in configuration, most probably you don't need it there
*Important*: use `!!` in require, to disable all other file loaders from webpack configuration
```js
var fileContent = require('!!prismjs?lang=markdown!./template.html');
// => returns highlighted html content
var fileContent = require('!!prismjs?lang=javascript!./index.js');
// => returns highlighted javascript content
```
# Contribution and Feature requests
If you need support of plugins welcome to create an issue or pull request,
currently plugins are not supported
# License
[MIT](LICENSE)