Git Product home page Git Product logo

redactor-codeblock-plugin's Introduction

๐Ÿ–น Redactor Codeblock Plugin

Imperavi Redactor Plugin for adding Code Blocks in your toolbar (multiple languages supported).

This plugin creates <pre><code></code></pre> tags that allows highlight.js to style your code depending on the language.

Usage

A new button is available in the Redactor toolbar, to insert a new code block, the dropdown will suggest you a pre-selected list of languages for syntax highlighting.

You can select text in your content to convert it to a code block.

You can also remove a codeblock by putting your cursor on it and select any language in the dropdown.

Supporting more languages

In the script, you can edit the this.languages to add more code languages to it, the ones you're likely to use.

The are around 196 languages supported, check them here.

How to install in Bolt CMS

Clone this repository (or copy js plugin file content) to the paht: /public/assets/redactor/_plugins/codeblock/codeblock.js.

Edit the config/bolt-redactor.yaml file with the following content:

plugins:
  codeblock: ['../_plugins/codeblock/codeblock.js']

Make sure to add codeblock in the pugins line too:

plugins: [ fullscreen, table, video, imagemanager, definedlinks, alphalist, codeblock]

Resources

Maintainer

twitter/mikescops
Corentin Mors

redactor-codeblock-plugin's People

Contributors

mikescops avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.