{"id":13518527,"url":"https://github.com/SamyPesse/draft-js-prism","last_synced_at":"2025-03-31T10:31:57.441Z","repository":{"id":53132615,"uuid":"59672823","full_name":"SamyPesse/draft-js-prism","owner":"SamyPesse","description":"Code highlighting for DraftJS using Prism","archived":false,"fork":false,"pushed_at":"2021-04-05T12:46:59.000Z","size":715,"stargazers_count":274,"open_issues_count":8,"forks_count":36,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T15:08:46.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://samypesse.github.io/draft-js-prism/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamyPesse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-25T15:01:12.000Z","updated_at":"2025-03-19T14:14:18.000Z","dependencies_parsed_at":"2022-09-26T21:10:28.840Z","dependency_job_id":null,"html_url":"https://github.com/SamyPesse/draft-js-prism","commit_stats":null,"previous_names":["samypesse/draftjs-prism"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Fdraft-js-prism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Fdraft-js-prism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Fdraft-js-prism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Fdraft-js-prism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamyPesse","download_url":"https://codeload.github.com/SamyPesse/draft-js-prism/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246453667,"owners_count":20779991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:45.872Z","updated_at":"2025-03-31T10:31:57.425Z","avatar_url":"https://github.com/SamyPesse.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Plugins and Decorators Built for Draft.js"],"sub_categories":[],"readme":"# draft-js-prism\n\n[![NPM version](https://badge.fury.io/js/draft-js-prism.svg)](http://badge.fury.io/js/draft-js-prism)\n[![Build Status](https://travis-ci.org/SamyPesse/draft-js-prism.svg?branch=master)](https://travis-ci.org/SamyPesse/draft-js-prism)\n\n`draft-js-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism).\n\n\u003e Note: It only decorates code blocks with syntax highlighting, if you're interested in providing a correct edition UX for code blocks, take a look at [draft-js-code](https://github.com/SamyPesse/draft-js-code).\n\n![Prism](./preview.gif)\n\n## Installation\n\n```\n$ npm install draft-js-prism prismjs\n```\n\n## Usage\n\n```js\nvar Draft = require('draft-js');\nvar PrismDecorator = require('draft-js-prism');\nvar Prism = require('prismjs')\n\nvar decorator = new PrismDecorator({\n  // Provide your own instance of PrismJS\n  prism: Prism,\n});\nvar editorState = Draft.EditorState.createEmpty(decorator)\n```\n\nYou'll also need to include the css for one of the [Prism themes](https://github.com/PrismJS/prism/tree/gh-pages/themes).\n\n### Usage with `draft-js-plugins`\n\nIf you're using `draft-js-plugins` simply use the [`draft-js-prism-plugin`](https://github.com/withspectrum/draft-js-prism-plugin), a wrapper around this decorator.\n\n### Usage with other decorators\n\nYou can use this decorator combined with others by using [draft-js-multidecorators](https://github.com/SamyPesse/draft-js-multidecorators)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamyPesse%2Fdraft-js-prism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamyPesse%2Fdraft-js-prism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamyPesse%2Fdraft-js-prism/lists"}