Git Product home page Git Product logo

grav-plugin-prism-highlight's People

Contributors

growtopiajaw avatar nbusseneau avatar pboguslawski avatar rhukster avatar w00fz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grav-plugin-prism-highlight's Issues

Advanced usage with Shortcodes

The advanced usage functionality depends on the Shortcode Core plugin to function.
Maybe Shortcode Core should be made a dependency of Prism Highlight, or at least mentioned in the advanced usage section of the readme.

Line Numbers Missing

I added the class line-numbers to my shortcode and the line numbers do not appear.

[prism classes="language-php line-numbers" highlight="2,4"] 
        <?php
        namespace Grav\Plugin;
        
        use \Grav\Common\Plugin;
        use \Grav\Common\Grav;
        use \Grav\Common\Page\Page;
        
        class PrismHighlightPlugin extends Plugin
        {
            /**
            * @return array
            */
            public static function getSubscribedEvents()
            {
                return [
                    'onPageInitialized' => ['onPageInitialized', 0],
                    'onShortcodeHandlers' => ['onShortcodeHandlers', 0],
                    'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],
                ];
            }
        }
[/prism]

Screen Shot 2019-05-14 at 3 00 14 PM

enabled: true
theme: prism-base16-ocean.dark.css
all-pre-blocks: true
plugins:
    line-numbers: true
    command-line: false
    command-line-prompt: '$'

Allow to disable particular Prism.js plugin

Not sure if this is a right repo to fill this issue, but I think this Grav plugin should allow disabling bundled Prism.js plugins.

Why this is needed? Sometimes Grav themes bundle their own native features which overlaps with Prism.js functionality. For example learn2-git-sync theme have its own Copy to clipboard button, but it also uses prism-highlight for highlighting itself. This results in all <pre> and <code> tags having duplicate Copy to clipboard buttons on top of each other.

I know that there is a custom js option, but having ability to just disable Prism.js plugins would be much cleaner, without a need to keep a custom library version in sync with what this plugin provides.

not work for me

plugin installed,
I write

[prism classes="language-html line-numbers"]
<!DOCTYPE html>
<html>
    <head>
        <title>......................</title>
    </head>
    <body>
 .............................................................
    </body>
</html>
[/prism]

and see this:

 TypeError
Argument 1 passed to DOMNode::replaceChild() must be an instance of DOMNode, null given

where my error?

Adding support for more languages

First off, love this plugin. For me though, it would be pretty useful to have powershell support.

The highlight plugin doesn't have it either. Very much a bummer, because most markdown engines support it, including GitHub.

Prism.js supports it, and getting the code from their site, I managed to get some powershell highlighting going, but then the integration with your plugin is broken, because I'm basically using "vanilla" prism.js. (Or perhaps the integration breaks in a different way, I'm not sure).

I can't deal with minified js files. Is it possible that you share the non-minified js? (If you did in fact modify it).

Alternatively, just having a version that supports all languages that Prism.js supports would be nice. (Or just powershell ;) )

If adding extra languages is somehow very complex/time consuming, then I beg your pardon, I have no idea what you have to do to get it working in/with Grav.

Wrong GitHub links

Wrong links to GitHub in plugin blueprints. Missing -plugin leads to 404

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.