Git Product home page Git Product logo

shiny-code's Introduction

Shiny Code

A Gutenberg block for editing and displaying code with syntax highlighting.

Requires: PHP 7.0 (or later)
License: GPLv2 (or later)

Animation showing how to convert a code block, set the code language, and change the syntax highlight theme.

Features

  • Choose a language for each code block
  • Toggle whether or not line numbers should display
  • Multiple syntax highlighting themes available
  • Highlight specific lines to draw attention to them
  • Choose a custom highlight color
  • Easily transform to/from core Code blocks
  • Code is saved as plain text, allowing it to be displayed in feeds and other contexts

Languages

Support for the following languages is included by default:

  • CSS
  • HTML
  • JavaScript
  • JSON
  • PHP

Additional languages can be registered using the shiny_code_languages filter.

Themes

Atom One Light and Atom One Dark themes are included and additional themes can be registered using the shiny_code_themes filter.

CodeMirror and Prism.js don't tokenize code exactly the same, so there will likely be slight differences between the colors in the editor and on the frontend.

Installation

To install Shiny Code:

  1. Download the latest release from GitHub (the saved file should be named shiny-code-{version}.zip).
  2. Go to the Plugins → Add New screen in your WordPress admin panel.
  3. Click the Upload button at the top next to the “Add Plugins” title.
  4. Upload the zip file downloaded in the first step.
  5. Click the Activate Plugin link after installation completes.

From Source

To build Shiny Code from source, clone this repository in wp-content/plugins/, then run the build steps:

git clone https://github.com/cedaro/shiny-code.git
cd shiny-code
composer install
npm install
npm run build

After building the plugin, go to the Plugins → Installed Plugins screen in your WordPress admin panel to activate Shiny Code.

shiny-code's People

Contributors

bradyvercher 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.