Sha256: f9675d1f482586557fa865eebc035f5be13eea35612fdb6c3e1b9cf7e096fa78

Contents?: true

Size: 482 Bytes

Versions: 14

Compression:

Stored size: 482 Bytes

Contents

app.directive('highlight', function() {
  return {
    restrict: 'EA',
    link: function ($scope, element, attrs) {
      var prism = window.Prism;
      prism.plugins.autoloader.languages_path = 'https://cdn.jsdelivr.net/prism/1.3.0/components/';
      element.ready(function() {
        element.html('<code>' + element.text() + '</code>');
        element.addClass('language-' + attrs.highlight);
        prism.highlightElement(element.find('code')[0]);
      });
    }
  };
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
praxis-2.0.pre.9 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.8 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.7 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.6 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.5 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.4 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.3 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.2 lib/api_browser/app/js/directives/highlight.js
praxis-2.0.pre.1 lib/api_browser/app/js/directives/highlight.js
praxis-0.22.pre.2 lib/api_browser/app/js/directives/highlight.js
praxis-0.22.pre.1 lib/api_browser/app/js/directives/highlight.js
praxis-0.21 lib/api_browser/app/js/directives/highlight.js
praxis-0.20.1 lib/api_browser/app/js/directives/highlight.js
praxis-0.20.0 lib/api_browser/app/js/directives/highlight.js