diff --git a/.ci.gemfile b/.ci.gemfile
index af06ddf..2298a49 100644
--- a/.ci.gemfile
+++ b/.ci.gemfile
@@ -6,7 +6,6 @@ gem 'minitest'
gem 'babel-transpiler'
gem 'creole'
gem 'erubi'
-gem 'erubis'
gem 'liquid'
gem 'livescript'
gem 'nokogiri'
@@ -51,10 +50,6 @@ unless RUBY_VERSION < '2.4' && RUBY_ENGINE == 'jruby'
gem 'pandoc-ruby'
end
-unless RUBY_VERSION < '2.6' && RUBY_ENGINE == 'jruby'
- gem 'maruku'
-end
-
if RUBY_ENGINE == 'jruby'
gem 'haml', '< 6'
else
@@ -78,9 +73,6 @@ if RUBY_VERSION >= '3.1'
end
platform :ruby do
- gem 'wikicloth'
- gem 'rinku' # dependency for wikicloth for handling links
-
gem 'RedCloth'
gem 'commonmarker'
@@ -93,9 +85,5 @@ platform :ruby do
# a dependency on ruby-enum, which requires Ruby 2.3
# without specifying required_ruby_version
gem 'ruby-enum', '< 0.6'
-
- # i18n is pulled in by wikicloth. This avoids errors
- # on Ruby 2.0.
- gem 'i18n', '<1.3'
end
end
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fcaa7e0..51f9c6c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,9 +23,8 @@ jobs:
COFFEE_SCRIPT: use
steps:
- uses: actions/checkout@v4
- # WikiCloth needs IDN
# Pandoc needs Pandoc
- - run: sudo apt-get install -y libidn11-dev pandoc
+ - run: sudo apt-get install -y pandoc
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed2e892..3071a43 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## master
+* Remove deprecated erubis, wikicloth, and maruku templates (jeremyevans)
* Avoid spurious frozen string literal deprecation warning on Ruby 3.4.0-preview2+ (jeremyevans)
## 2.4.0 (2024-06-27)
diff --git a/README.md b/README.md
index d24a408..3d0831f 100644
--- a/README.md
+++ b/README.md
@@ -33,14 +33,12 @@ Support for these template engines is included with Tilt:
| CSV | .rcsv | csv (ruby stdlib) |
| ERB | .erb, .rhtml | erb (ruby stdlib) |
| Erubi | .erb, .rhtml, .erubi | erubi |
-| Erubis | .erb, .rhtml, .erubis | erubis |
| Etanni | .ern, .etanni | none |
| Haml | .haml | haml |
| Kramdown | .markdown, .mkd, .md | kramdown |
| Liquid | .liquid | liquid |
| LiveScript | .ls | livescript (+ javascript) |
| Markaby | .mab | markaby |
-| Maruku | .markdown, .mkd, .md | maruku |
| Nokogiri | .nokogiri | nokogiri |
| Pandoc | .markdown, .mkd, .md | pandoc |
| Plain | .html | none |
@@ -56,7 +54,6 @@ Support for these template engines is included with Tilt:
| Scss | .scss | sass-embedded, sassc, or sass |
| String | .str | none |
| TypeScript | .ts | typescript (+ javascript) |
-| WikiCloth | .wiki, .mediawiki, .mw | wikicloth |
| Yajl | .yajl | yajl-ruby |
See [TEMPLATES.md][t] for detailed information on template engine
@@ -277,7 +274,7 @@ it on subsequent template invocations. Benchmarks show this yields a 5x-10x
performance increase over evaluating the Ruby source on each invocation.
Template compilation is currently supported for these template engines:
-StringTemplate, ERB, Erubis, Erubi, Etanni, Haml, Nokogiri, Builder, CSV,
+StringTemplate, ERB, Erubi, Etanni, Haml, Nokogiri, Builder, CSV,
Prawn, and Yajl.
LICENSE
diff --git a/docs/TEMPLATES.md b/docs/TEMPLATES.md
index 0c67e1c..64805a1 100644
--- a/docs/TEMPLATES.md
+++ b/docs/TEMPLATES.md
@@ -11,9 +11,8 @@ which are guaranteed to work across all the implementations. If you wish to be
compatible with all of these template classes, you should only depend on the
cross-implementation features.
- * [ERB](#erb) - Generic ERB implementation (backed by erb.rb, Erubis, or Erubi)
+ * [ERB](#erb) - Generic ERB implementation (backed by erb.rb or Erubi)
* [erb.rb](#erbrb) - `Tilt::ERBTemplate`
- * [Erubis](#erubis) - `Tilt::ErubisTemplate`
* [Erubi](#erubi) - `Tilt::ErubiTemplate`
* [Haml](#haml) - `Tilt::HamlTemplate`
* [Liquid](#liquid) - `Tilt::LiquidTemplate`
@@ -44,7 +43,6 @@ implementations (depending on which are available on your system):
* Kramdown - `Tilt::KramdownTemplate`
* Pandoc - `Tilt::PandocTemplate`
* CommonMarker - `Tilt::CommonMarkerTemplate`
- * Maruku - `Tilt::MarukuTemplate`
ERB (`erb`, `rhtml`)
@@ -52,7 +50,7 @@ ERB (`erb`, `rhtml`)
ERB is a simple but powerful template languge for Ruby. In Tilt it's backed by
[Erubi](#erubi) (if installed on your system) or by
-[Erubis](#erubis) (if installed on your system) or by [erb.rb](#erbrb) (which
+[erb.rb](#erbrb) (which
is included in Ruby's standard library). This documentation applies to all three
implementations.
@@ -81,7 +79,7 @@ Or, use `Tilt['erb']` directly to process strings:
Omits newlines and spaces around certain lines (usually those that starts with
`<%` and ends with `%>`). There isn't a specification for how trimming in ERB
should work, so if you need more control over the whitespace, you should use
-[erb.rb](#erbrb), [Erubis](#erubis), or [Erubi](#erubi) directly.
+[erb.rb](#erbrb) or [Erubi](#erubi) directly.
#### `:outvar => '_erbout'`
@@ -106,8 +104,8 @@ All the documentation of [ERB](#erb) applies in addition to the following:
### Usage
The `Tilt::ERBTemplate` class is registered for all files ending in `.erb` or
-`.rhtml` by default, but with a *lower* priority than ErubiTemplate and
-ErubisTemplate. If you specifically want to use ERB, it's recommended to use
+`.rhtml` by default, but with a *lower* priority than ErubiTemplate.
+If you specifically want to use ERB, it's recommended to use
`#prefer`:
Tilt.prefer Tilt::ERBTemplate
@@ -132,53 +130,12 @@ following characters:
* [ERB documentation](https://docs.ruby-lang.org/en/master/ERB.html)
-
-Erubis (`erb`, `rhtml`, `erubis`)
----------------------------------
-
-[Erubis][erubis] is a fast, secure, and very extensible implementation of [ERB](#erb).
-
-All the documentation of [ERB](#erb) applies in addition to the following:
-
-### Usage
-
-The `Tilt::ErubisTemplate` class is registered for all files ending in `.erb` or
-`.rhtml` by default, but with a *lower* priority than `ErubiTemplate`. If you
-specifically want to use Erubis, it's recommended to use `#prefer`:
-
- Tilt.prefer Tilt::ErubisTemplate
-
-__NOTE:__ It's suggested that your program `require 'erubis'` at load time when
-using this template engine within a threaded environment.
-
-### Options
-
-#### `:engine_class => Erubis::Eruby`
-
-Allows you to specify a custom engine class to use instead of the
-default which is `Erubis::Eruby`.
-
-#### `:escape_html => false`
-
-When `true`, `Erubis::EscapedEruby` will be used as the engine class
-instead of the default. All content within `<%= %>` blocks will be
-automatically html escaped.
-
-#### Other
-
-Other options are passed to the constructor of the engine class.
-
-### See also
-
- * [Erubis Home][erubis]
-
-
Erubi (`erb`, `rhtml`, `erubi`)
---------------------------------
-[Erubi][erubi] is a ERB implementation that uses the same algorithm as
-[Erubis][erubis], but is maintained and offers numerous improvements..
+[Erubi][erubi] is an ERB implementation that uses the same algorithm as
+the erubis gem, but is maintained and offers numerous improvements.
All the documentation of [ERB](#erb) applies in addition to the following:
@@ -187,8 +144,6 @@ All the documentation of [ERB](#erb) applies in addition to the following:
The `Tilt::ErubiTemplate` class is registered for all files ending in `.erb` or
`.rhtml` by default, with the *highest* priority.
- Tilt.prefer Tilt::ErubisTemplate
-
__NOTE:__ It's suggested that your program `require 'erubi'` at load time when
using this template engine within a threaded environment.
@@ -477,7 +432,6 @@ Markdown formatted texts are converted to HTML with one of these libraries:
* Redcarpet - `Tilt::RedcarpetTemplate`
* Kramdown - `Tilt::KramdownTemplate`
* Pandoc - `Tilt::PandocTemplate`
- * Maruku - `Tilt::MarukuTemplate`
* CommonMarker - `Tilt::CommonMarkerTemplate`
### Example
@@ -501,7 +455,7 @@ To wrap a Markdown formatted document with a layout:
### Options
Every implementation of Markdown *should* support these options, but there are
-some known problems with the Kramdown and Maruku engines.
+some known problems with the Kramdown engine.
#### `:smartypants => true|false`
@@ -510,14 +464,12 @@ Set `true` to enable [Smarty Pants][smartypants] style punctuation replacement.
In Kramdown this option only applies to smart quotes. It will apply a
subset of Smarty Pants (e.g. `...` to `…`) regardless of any option.
-Maruku ignores this option and always applies smart quotes (and nothing else).
-
#### `:escape_html => true|false`
Set `true` disallow raw HTML in Markdown contents. HTML is converted to
literal text by escaping `<` characters.
-Kramdown and Maruku don't support this option.
+Kramdown doesn't support this option.
### See also
@@ -552,7 +504,6 @@ using this template engine within a threaded environment.
[sass]: http://sass-lang.com/ "Sass"
[coffee-script]: http://jashkenas.github.com/coffee-script/ "Coffee Script"
-[erubis]: https://github.com/kwatch/erubis "Erubis"
[erubi]: https://github.com/jeremyevans/erubi "Erubi"
[haml]: http://haml.info/ "Haml"
[liquid]: http://www.liquidmarkup.org/ "Liquid"
diff --git a/lib/tilt.rb b/lib/tilt.rb
index 1bc112b..c65cc4a 100644
--- a/lib/tilt.rb
+++ b/lib/tilt.rb
@@ -139,11 +139,9 @@ def clear
# ERB
register_lazy :ERBTemplate, 'tilt/erb', 'erb', 'rhtml'
- register_lazy :ErubisTemplate, 'tilt/erubis', 'erb', 'rhtml', 'erubis'
register_lazy :ErubiTemplate, 'tilt/erubi', 'erb', 'rhtml', 'erubi'
# Markdown
- register_lazy :MarukuTemplate, 'tilt/maruku', 'markdown', 'mkd', 'md'
register_lazy :KramdownTemplate, 'tilt/kramdown', 'markdown', 'mkd', 'md'
register_lazy :RDiscountTemplate, 'tilt/rdiscount', 'markdown', 'mkd', 'md'
register_lazy :RedcarpetTemplate, 'tilt/redcarpet', 'markdown', 'mkd', 'md'
@@ -175,7 +173,6 @@ def clear
register_lazy :SlimTemplate, 'tilt/slim', 'slim'
register_lazy :StringTemplate, 'tilt/string', 'str'
register_lazy :TypeScriptTemplate, 'tilt/typescript', 'ts', 'tsx'
- register_lazy :WikiClothTemplate, 'tilt/wikicloth', 'wiki', 'mediawiki', 'mw'
register_lazy :YajlTemplate, 'tilt/yajl', 'yajl'
# TILT3: Remove
diff --git a/lib/tilt/erubis.rb b/lib/tilt/erubis.rb
deleted file mode 100644
index f85cc25..0000000
--- a/lib/tilt/erubis.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-require_relative 'erb'
-require 'erubis'
-
-warn 'tilt/erubis is deprecated, as erubis requires modifying string literals', uplevel: 1
-
-module Tilt
- # Erubis template implementation. See:
- # http://www.kuwata-lab.com/erubis/
- #
- # ErubisTemplate supports the following additional options, which are not
- # passed down to the Erubis engine:
- #
- # :engine_class allows you to specify a custom engine class to use
- # instead of the default (which is ::Erubis::Eruby).
- #
- # :escape_html when true, ::Erubis::EscapedEruby will be used as
- # the engine class instead of the default. All content
- # within <%= %> blocks will be automatically html escaped.
- class ErubisTemplate < ERBTemplate
- def prepare
- @freeze_string_literals = !!@options.delete(:freeze)
- @outvar = @options.delete(:outvar) || '_erbout'
- @options[:preamble] = false
- @options[:postamble] = false
- @options[:bufvar] = @outvar
- engine_class = @options.delete(:engine_class)
- engine_class = ::Erubis::EscapedEruby if @options.delete(:escape_html)
- @engine = (engine_class || ::Erubis::Eruby).new(@data, @options)
- end
-
- def precompiled_preamble(locals)
- [super, "#{@outvar} = _buf = String.new"].join("\n")
- end
-
- def precompiled_postamble(locals)
- [@outvar, super].join("\n")
- end
-
- # Erubis doesn't have ERB's line-off-by-one under 1.9 problem.
- # Override and adjust back.
- def precompiled(locals)
- source, offset = super
- [source, offset - 1]
- end
-
- def freeze_string_literals?
- @freeze_string_literals
- end
- end
-end
diff --git a/lib/tilt/mapping.rb b/lib/tilt/mapping.rb
index 53c0cc5..a4cb3b3 100644
--- a/lib/tilt/mapping.rb
+++ b/lib/tilt/mapping.rb
@@ -113,14 +113,14 @@ def split(file)
# the exception of the first, since that was the most preferred one.
#
# mapping = Tilt::Mapping.new
- # mapping.register_lazy('Maruku::Template', 'maruku/template', 'md')
+ # mapping.register_lazy('Kramdown::Template', 'kramdown/template', 'md')
# mapping.register_lazy('RDiscount::Template', 'rdiscount/template', 'md')
# mapping['index.md']
# # => RDiscount::Template
#
# In the previous example we say that RDiscount has a *higher priority* than
- # Maruku. Tilt will first try to `require "rdiscount/template"`, falling
- # back to `require "maruku/template"`. If none of these are successful,
+ # Kramdown. Tilt will first try to `require "rdiscount/template"`, falling
+ # back to `require "kramdown/template"`. If none of these are successful,
# the first error will be raised.
class Mapping < BaseMapping
LOCK = Mutex.new
diff --git a/lib/tilt/maruku.rb b/lib/tilt/maruku.rb
deleted file mode 100644
index 7c42e64..0000000
--- a/lib/tilt/maruku.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-require_relative 'template'
-require 'maruku'
-
-warn 'tilt/maruku is deprecated, as maruku requires modifying string literals', uplevel: 1
-
-# Maruku markdown implementation. See: https://github.com/bhollis/maruku
-Tilt::MarukuTemplate = Tilt::StaticTemplate.subclass do
- Maruku.new(@data, @options).to_html
-end
diff --git a/lib/tilt/wikicloth.rb b/lib/tilt/wikicloth.rb
deleted file mode 100644
index c5c9988..0000000
--- a/lib/tilt/wikicloth.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-require_relative 'template'
-require 'wikicloth'
-
-warn 'tilt/wikicloth is deprecated, as wikicloth requires modifying string literals', uplevel: 1
-
-# WikiCloth implementation. See: https://github.com/nricciar/wikicloth
-Tilt::WikiClothTemplate = Tilt::StaticTemplate.subclass do
- parser = @options.delete(:parser) || WikiCloth::Parser
- @options[:data] = @data
- parser.new(@options).to_html
-end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c2f9210..3b062d8 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -13,7 +13,7 @@
require 'warning'
rescue LoadError
else
- Warning.ignore(%r{lib/wikicloth/extensions/|lib/pdf/reader/font.rb|lib/maruku/|lib/creole/parser.rb|lib/commonmarker})
+ Warning.ignore(%r{lib/pdf/reader/font.rb|lib/creole/parser.rb|lib/commonmarker})
end
end
diff --git a/test/tilt_erubistemplate_test.rb b/test/tilt_erubistemplate_test.rb
deleted file mode 100644
index b534074..0000000
--- a/test/tilt_erubistemplate_test.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-require_relative 'test_helper'
-
-checked_describe 'tilt/erubis' do
- include IgnoreVerboseWarnings
-
- data = (<
-
- Hey <%= name %>!
-
-
- <% fail %>
-
-