Giter VIP home page Giter VIP logo

plugin.tinymce's Introduction

Build Status

Quickstart | Documentation | Languages | Themes | Website

EnlighterJS3

EnlighterJS, an open source syntax highlighter written in pure javascript

Using it can be as simple as adding a single script and style to your website, choosing the elements you wish to highlight, and EnlighterJS takes care of the rest.

Appearance

Related

Features

KEY FEATURES

  • Designed to work in all modern browsers (not server-side)
  • Encapsulated, standalone library - zero dependencies (no MooTools, no jQuery!)
  • 40 supported languages/formats
  • 12 high quality themes
  • Inline Syntax highlighting
  • Codegroups to displays multiple code-blocks within a tab-pane
  • Point out special lines of code
  • Ultra small footprint: 45KB JS (all languages) + 10KB CSS (single theme; all themes 60KB)
  • Highlight all codeblocks on your page with a single command

TECHNICAL FEATURES

  • Ultrafast Tokenizer Engine based on priorized regular expressions
  • Second-Stage-Tokenizer for optimized performance
  • Full customizable themes written in less
  • Themes available as single css files to reduce footprint
  • Views based on JSX
  • Minimal, embedded DOM library
  • gulp based build system
  • ES6 code transpiled via babel and build with rollup.js

Languages

  • ABAP (abap)
  • Apache HTTPD (apache)
  • Assembly (assembly, asm)
  • AVR Assembly (avrassembly, avrasm)
  • Windows Batch/Bat (bat,batch,cmd)
  • C/C++ (c,cpp, c++)
  • C# (csharp)
  • CSS (css)
  • Cython (cython)
  • CordPro (cordpro)
  • diff (diff)
  • Dockerfile (docker, dockerfile)
  • Generic (generic, standard) - default highlighting scheme
  • Groovy (groovy)
  • Go (go, golang)
  • HTML (html)
  • Ini (ini, conf)
  • Java (java)
  • Javascript (js, javascript, jquery, mootools, ext.js)
  • JSON (json)
  • JSX (jsx)
  • Kotlin (kotlin)
  • LATEX (latex)
  • LESS (less)
  • lighttpd (lighttpd)
  • LUA (lua)
  • MariaDB (mariadb)
  • Markdown (gfm, md, markdown)
  • Matlab/Octave (octave, matlab)
  • MSSQL (mssql)
  • NGINX (nginx)
  • NSIS (nsis)
  • Oracle Database (oracledb)
  • PHP (php)
  • Powerhsell (powershell)
  • Prolog (prolog)
  • Python (py, python)
  • PureBasic (purebasic, pb)
  • QML (qml)
  • R (r)
  • RAW (raw) - raw code without highlighting with EnlighterJS container styles!
  • RouterOS/SwitchOS (routeros)
  • Ruby (ruby)
  • Rust (rust)
  • Scala (scala)
  • SCSS (scss, sass)
  • Shellscript (shell, bash)
  • Generic SQL (sql)
  • Squirrel (squirrel)
  • Swift (swift)
  • Typescript (typescript)
  • VHDL (vhdl)
  • VisualBasic (visualbasic, vb)
  • Verilog (verilog)
  • XML (xml, html)
  • YAML (yaml)

Themes

  • Enlighter (enlighter, standard) - Enlighter`s default Theme
  • Classic (classic) - SyntaxHighlighter inspired
  • Bootstrap (bootstrap4) - Bootstrap 4 inpired themes, high contrast
  • Beyond (beyond) - BeyondTechnology Theme
  • Godzilla (godzilla) - A MDN inspired Theme
  • Eclipse (eclipse) - Eclipse inspired
  • MooTwo (mootwo) - Inspired by the MooTools Website
  • Droide (droide) - Modern, minimalistic
  • Minimal (minimal) - Bright, High contrast
  • Atomic (atomic) - Dark, Colorful
  • Dracula (dracula) - Dark, using official draculatheme colorscheme
  • Rowhammer (rowhammer) - Light, Transparent, divided rows

Quickstart

  1. Download latest EnlighterJS release
  2. Copy the files from the dist/ directory to your public html location
  3. Include the CSS+JS files
  4. Tag the codeblocks on your page (e.g. pre tags with data-enlighter-language attribute)
  5. Initialize highlighting

Minimal Example

This is a minimalistic example how to highlight sourcecode with EnlighterJS. The working example (valid js+css paths) is available within the example directory.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>EnlighterJS Test</title>

    <!-- EnlighterJS Resources !-->
    <link rel="stylesheet" href="enlighterjs.min.css" />
</head>
<body>

    <main>
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore 
            et dolore <code>window.addEvent('domready', async (a,b) => {});</code> magna aliquyam erat.
        </p>

        <!-- Code to hghlight !-->
        <pre data-enlighter-language="less">
// buttons used in codegroups + toolbar
.enlighter-btn{
    display: inline-block;
    margin: 0px 5px 0px 5px;
    padding: 3px 5px 3px 5px;
    border: solid 1px #333333;
    background-color: #f0f0f0;
    cursor: pointer;
}

// buttons
.enlighter-btn-raw{
    background-image: data-uri('icons/enlighter_code.svg');
}

.enlighter-btn-window{
    background-image: data-uri('icons/enlighter_rawcode.svg');
}

.enlighter-btn-website{
    background-image: data-uri('icons/enlighter_icon_white.svg');
}
        </pre>

    </main>

    <script type="text/javascript" src="enlighterjs.min.js"></script>
    <script type="text/javascript">
        // INIT CODE - simple page-wide initialization based on css selectors
        // - highlight all pre + code tags (CSS3 selectors)
        // - use javascript as default language
        // - use theme "enlighter" as default theme
        // - replace tabs with 2 spaces
        EnlighterJS.init('pre', 'code', {
                language : 'javascript',
                theme: 'enlighter',
                indent : 2
        });
    </script>
</body>
</html>

Contribution

EnlighterJS is OpenSource and managed on GitHub - if you like, you're welcome to contribute! To simplify the release and quality control process, please follow these remarks:

  1. One Enhancement ==> One Commit (don't merge a bunch of changes in a single commit!)
  2. Only commit changes to the src/ or examples/ directory. Otherwise your request will be rejected
  3. Discuss larger project changes with the Maintainer before implementing
  4. Use GitHub for question, bugreports and discussions

License

EnlighterJS is OpenSource and licensed under the Terms of Mozilla Public License 2.0. You're welcome to contribute

plugin.tinymce's People

Contributors

andidittrich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

plugin.tinymce's Issues

Feedback โ€” bbPress replies and styling

This is just feedback for you. Today I was trying to use the TinyMCE approach to insert some XSL script into a reply to a topic. It did not like it. In the edit I had to set it as text editor mode and use a [xml] shortcode. It worked fine:

enlighter-styling

I am only providing this as feedback and not worried about it too much. Do you have a ETA for testing your next V4 BETA?

TinyMCE version / WordPress 6..1

Hi

Slightly confused. According to EnlightJS it says the TinyMCE is 5.0.1 in WordPress 6.1 but I thought it was still 4.9.11?

EnTiny

Displaying code in "Quotes" in bbPress Reply

Hi

I hope you are well.

I noticed yesterday that when a user quoted me and my code yesterday it rendered funny in bbPress:

code

What is likely to be the cause of this? Seems funny seeing two sets of "line numbers" ...

Andy

Typo - Line number offset

Have a look here:

linenumber-offset

Linennumber needs to be Linenumber. Technically speaking, in English it should really be Line number.

Feature Request โ€” Order of options on the window

Please see:

enlighter-options

It makes more sense to me to put the offset option before the list of highlighted lines. So:

  • Show line numbers
  • First line number
  • Lines to be highlighted

This way is logical because the values for the highlighted lines are related to the value of the offset number.

Feature Request: Easier way to remove a EnlighterJS "block" from TinyMCE

At the moment, if I decide that I want to remove an inserted EnlighterJS block of code I have to select all the code and the header banner etc. to delete it. This is not a hardship of course!

But could it be possible that when you click the "Edit Code" button that it offer to "Remove Block"?

I have no idea what is involved.

Feature request - Hide the Theme label and drop-down list

Please look:

enlighterjs-theme

I don't want any users selecting a different theme that the default. they won't know what the themes are anyway, and some of them don't render well due to issues with my WordPress theme. Also, I would like consistency across the site so that if I change my mind in what theme I use it will be applied everywhere.

So that this setting be visually removed?

TinyMCE plugin feedback

Please see:

Window

  1. Theme.
    Is it possible for me to omit the Theme option from the window? Not all themes are displaying good in my support forum and if possible I would like to lock down the theme that anyone uses to Atomic.

  2. Linennumber offset
    There are two issues here:

  • It has a typo error because it should be Line number offset or maybe Start with line number.
  • It makes sense that this control comes before the Point out Lines control.
  1. Show Linennumbers
    This has a typo. It should really be Show Line numbers.

  2. Point out Lines
    I wonder if it is better to phrase this option as "Lines to highlight".

To me, I reckon:

  • Display line numbers
  • Begin with line number
  • Lines to highlight

It is obviously entirely your decision but there are two typos and it makes sense to swap the two controls around I think.

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.