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