Giter Site home page Giter Site logo

grav-plugin-markdown-details's People

Contributors

bitstarr avatar itchychips avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grav-plugin-markdown-details's Issues

Error after installing

Grav version 1.6.19

E_NOTICE - Undefined property: Grav\Plugin\MarkdownDetailsPlugin::$a11y

More details in the log

Review

I've taken a brief look at the plugin and would like to share my findings. Hope you may find it useful.

  • Since the advent of Grav 1.7.0 things have change a bit. You might want to take a look at the upgrade docs and especially the section for developers.
    An easy upgrade approach could be to create a new plugin template using $ bin/plugin devtools new-plugin and copy your existing code into the right places.
  • The events onMarkdownInitialized and onTwigSiteVariables are being handled on each and every request, also when derived from Admin. Might be a good idea to move the event registrations into onPluginsInitialized and enable them only when request is not from Admin.
  • There is a dedicated event onAssetsInitialized where assets can be added.

    onAssetsInitialized
    The event indicates the assets manager has been initialized and is ready for assets to be added and managed.

  • Usually, assets like js and css are stored in their respective folders /js and /css.
  • Variables should be named using camelCase as commonly used in Grav.
  • The use of config variables for css classes seem a bit overkill. The chances the plugin will be used in a project that already contains existing classes for summary/details etc is probably nihil. Using fixed class names might just be enough.
  • Create an icon folder to store a default svg and load the svg from file. This allows users to use their own icon. Or, you could allow a config variable to contain an svg definition and load that definition.
  • Variable $matches is only used in one preg_match

Hope this helps...

How to make this?

i was trying, but that isn't working

!> top layer
!> 1st header
first content
!@
!> 2nd header
2nd content
!@
!@

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.