Sha256: 0cb716ab80f6d0ec44adccaf04fa1da82b005f688324e79cb698bd3baf032857

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

# frozen_string_literal: true
module Katex
  # Registers KaTeX fonts, stylesheets, and javascripts with Rails.
  class Engine < ::Rails::Engine
    initializer 'katex.assets' do |app|
      # We deliberately do not place the assets in vendor/assets but in
      # vendor/katex instead, as vendor/assets is added to asset paths
      # by default but have to avoid including the non-sprockets stylesheet.
      %w(fonts javascripts).each do |sub|
        app.config.assets.paths << root.join('vendor', 'katex', sub).to_s
      end
      # Use sprockets versions of katex CSS that use asset-path for
      # referencing fonts.
      # One file is a Sass partial and the other one is .css.erb.
      app.config.assets.paths << root.join(
          'vendor', 'katex', 'sprockets', 'stylesheets'
      ).to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
katex-0.1.1 lib/katex/engine.rb