Sha256: 86dbb56818e343c86be9246061e887ba79d86805552c149d0c222003d13952f9

Contents?: true

Size: 876 Bytes

Versions: 13

Compression:

Stored size: 876 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 we have to avoid including the non-sprockets stylesheet.
      %w[fonts javascripts images].each do |sub|
        path = root.join('vendor', 'katex', sub).to_s
        app.config.assets.paths << path if File.directory?(path)
      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

13 entries across 13 versions & 1 rubygems

Version Path
katex-0.10.0 lib/katex/engine.rb
katex-0.9.0 lib/katex/engine.rb
katex-0.8.0 lib/katex/engine.rb
katex-0.6.1 lib/katex/engine.rb
katex-0.6.0 lib/katex/engine.rb
katex-0.5.2 lib/katex/engine.rb
katex-0.5.1 lib/katex/engine.rb
katex-0.5.0 lib/katex/engine.rb
katex-0.4.3 lib/katex/engine.rb
katex-0.4.2.beta lib/katex/engine.rb
katex-0.4.1.beta lib/katex/engine.rb
katex-0.4.0.beta lib/katex/engine.rb
katex-0.3.0 lib/katex/engine.rb