Permalink
Browse files

remove smarty_pants filter

  • Loading branch information...
1 parent a8c4395 commit 9b108c1c2d656f59a279251af3f71910eede3faf @johnmuhl johnmuhl committed Jun 17, 2010
@@ -1 +1 @@
-Adds support for Markdown and SmartyPants!
+Adds support for Markdown!
@@ -15,19 +15,4 @@ module MarkdownTags
tag 'markdown' do |tag|
MarkdownFilter.filter(tag.expand)
end
-
- desc %{
- Filters its contents with the SmartyPants filter.
-
- *Usage:*
-
- <pre><code><r:smarty_pants>"A revolutionary quotation."</r:smarty_pants></code></pre>
-
- produces
-
- <pre><code>&#8220;A revolutionary quotation.&#8221;</code></pre>
- }
- tag 'smarty_pants' do |tag|
- SmartyPantsFilter.filter(tag.expand)
- end
end
@@ -1,7 +0,0 @@
-class SmartyPantsFilter < TextFilter
- filter_name "SmartyPants"
- description_file File.dirname(__FILE__) + "/../smartypants.html"
- def filter(text)
- RubyPants.new(text).to_html
- end
-end
@@ -6,22 +6,13 @@
require 'kramdown'
end
-begin
- require 'rubypants'
-rescue LoadError
- # If rubypants gem is not available, use packaged version
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/vendor/rubypants"
- retry
-end
-
class MarkdownFilterExtension < Radiant::Extension
version "1.0"
- description "Allows you to compose page parts or snippets using the Markdown or SmartyPants text filters."
+ description "Allows you to compose page parts or snippets using the Markdown text filter."
url "http://daringfireball.net/projects/markdown/"
def activate
MarkdownFilter
- SmartyPantsFilter
Page.send :include, MarkdownTags
end
end
@@ -1,47 +0,0 @@
-<p><a href="http://daringfireball.net/projects/smartypants/" target="_blank">SmartyPants</a>
- is a simple text filter that will curl quotes and insert &#8220;smart&#8221;
- punctuation. This is extremely useful if you prefer to compose documents using
- standard HTML, but don&#8217;t want to worry about quotes and punctuation.</p>
-
-<table id="filter-reference-table">
- <thead>
- <tr>
- <th>To see this:</th>
- <th>Type this:</th>
- <tr>
- </thead>
- <tbody>
- <tr>
- <td>&#8216;single quotes&#8217;</td>
- <td><pre>'single quotes'</pre></td>
- </tr>
- <tr>
- <td>&#8220;double quotes&#8221;</td>
- <td><pre>"double quotes"</pre></td>
- </tr>
- <tr>
- <td>&#8220;backtick quotes&#8221;</td>
- <td><pre>``backtick quotes''</pre></td>
- </tr>
- <tr>
- <td>John&#8217;s apostrophe</td>
- <td><pre>John's apostrophe</pre></td>
- </tr>
- <tr>
- <td>just an &#8211; en-dash</td>
- <td><pre>just an -- en-dash</pre></td>
- </tr>
- <tr>
- <td>just an&#8212;em-dash</td>
- <td><pre>just an---em-dash</pre></td>
- </tr>
- <tr>
- <td>ellipsis&#8230;</td>
- <td><pre>ellipsis...</pre></td>
- </tr>
- </tbody>
-</table>
-
-<p>SmartyPants ignores characters within <code>&lt;pre&gt;</code>,
- <code>&lt;code&gt;</code>, <code>&lt;kbd&gt;</code>, or
- <code>&lt;script&gt;</code> tag blocks.</p>
@@ -1,19 +0,0 @@
-require File.dirname(__FILE__) + '/../spec_helper'
-
-describe SmartyPantsFilter do
- it "should be named SmartyPants" do
- SmartyPantsFilter.filter_name.should == "SmartyPants"
- end
-
- it "should filter text with quotes into smart quotes" do
- SmartyPantsFilter.filter("<h1 class=\"headline\">Radiant's \"filters\" rock!</h1>").should ==
- "<h1 class=\"headline\">Radiant&#8217;s &#8220;filters&#8221; rock!</h1>"
- end
-end
-
-describe "<r:smarty_pants>" do
- dataset :pages
- it "should filter its contents with SmartyPants" do
- pages(:home).should render('<r:smarty_pants>"A revolutionary quotation."</r:smarty_pants>').as("&#8220;A revolutionary quotation.&#8221;")
- end
-end
@@ -1,14 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-
-class SmartyPantsFilterTest < Test::Unit::TestCase
-
- def test_filter_name
- assert_equal 'SmartyPants', SmartyPantsFilter.filter_name
- end
-
- def test_filter
- assert_equal "<h1 class=\"headline\">Radiant&#8217;s &#8220;filters&#8221; rock!</h1>",
- SmartyPantsFilter.filter("<h1 class=\"headline\">Radiant's \"filters\" rock!</h1>")
- end
-
-end
@@ -1,114 +0,0 @@
-= RubyPants -- SmartyPants ported to Ruby
-
-Ported by Christian Neukirchen <mailto:chneukirchen@gmail.com>
- Copyright (C) 2004 Christian Neukirchen
-
-Incooporates ideas, comments and documentation by Chad Miller
- Copyright (C) 2004 Chad Miller
-
-Original SmartyPants by John Gruber
- Copyright (C) 2003 John Gruber
-
-
-== RubyPants
-
-RubyPants is a Ruby port of the smart-quotes library SmartyPants.
-
-The original "SmartyPants" is a free web publishing plug-in for
-Movable Type, Blosxom, and BBEdit that easily translates plain ASCII
-punctuation characters into "smart" typographic punctuation HTML
-entities.
-
-See rubypants.rb for more information.
-
-
-== Incompatibilities
-
-RubyPants uses a different API than SmartyPants; it is compatible to
-Red- and BlueCloth. Usually, you call RubyPants like this:
-
- nicehtml = RubyPants.new(uglyhtml, options).to_html
-
-where +options+ is an Array of Integers and/or Symbols (if you don't
-pass any options, RubyPants will use <tt>[2]</tt> as default.)
-
-*Note*:: This is incompatible to SmartyPants, which uses <tt>[1]</tt>
- for default.
-
-The exact meaning of numbers and symbols is documented at RubyPants#new.
-
-
-== SmartyPants license:
-
-Copyright (c) 2003 John Gruber
-(http://daringfireball.net)
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-* Neither the name "SmartyPants" nor the names of its contributors
- may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness
-for a particular purpose are disclaimed. In no event shall the
-copyright owner or contributors be liable for any direct, indirect,
-incidental, special, exemplary, or consequential damages (including,
-but not limited to, procurement of substitute goods or services;
-loss of use, data, or profits; or business interruption) however
-caused and on any theory of liability, whether in contract, strict
-liability, or tort (including negligence or otherwise) arising in
-any way out of the use of this software, even if advised of the
-possibility of such damage.
-
-
-== RubyPants license
-
-Copyright (C) 2004 Christian Neukirchen
-
-RubyPants is a derivative work of SmartyPants and smartypants.py.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-This software is provided by the copyright holders and contributors
-"as is" and any express or implied warranties, including, but not
-limited to, the implied warranties of merchantability and fitness
-for a particular purpose are disclaimed. In no event shall the
-copyright owner or contributors be liable for any direct, indirect,
-incidental, special, exemplary, or consequential damages (including,
-but not limited to, procurement of substitute goods or services;
-loss of use, data, or profits; or business interruption) however
-caused and on any theory of liability, whether in contract, strict
-liability, or tort (including negligence or otherwise) arising in
-any way out of the use of this software, even if advised of the
-possibility of such damage.
-
-
-== Links
-
-John Gruber:: http://daringfireball.net
-SmartyPants:: http://daringfireball.net/projects/smartypants
-Chad Miller:: http://web.chad.org
-Christian Neukirchen:: http://kronavita.de/chris
@@ -1,84 +0,0 @@
-# Rakefile for rubypants -*-ruby-*-
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
-
-
-desc "Run all the tests"
-task :default => [:test]
-
-desc "Do predistribution stuff"
-task :predist => [:doc]
-
-
-desc "Run all the tests"
-task :test do
- ruby 'test_rubypants.rb'
-end
-
-desc "Make an archive as .tar.gz"
-task :dist => :test do
- system "darcs dist -d rubypants#{get_darcs_tree_version}"
-end
-
-
-desc "Generate RDoc documentation"
-Rake::RDocTask.new(:doc) do |rdoc|
- rdoc.options << '--line-numbers --inline-source --all'
- rdoc.rdoc_files.include 'README'
- rdoc.rdoc_files.include 'rubypants.rb'
-end
-
-
-spec = Gem::Specification.new do |s|
- s.name = 'rubypants'
- s.version = '0.2.0'
- s.summary = "RubyPants is a Ruby port of the smart-quotes library SmartyPants."
- s.description = <<-EOF
-RubyPants is a Ruby port of the smart-quotes library SmartyPants.
-
-The original "SmartyPants" is a free web publishing plug-in for
-Movable Type, Blosxom, and BBEdit that easily translates plain ASCII
-punctuation characters into "smart" typographic punctuation HTML
-entities.
- EOF
- s.files = FileList['**/*rb', 'README', 'Rakefile'].to_a
- s.test_file = "test_rubypants.rb"
- s.extra_rdoc_files = ["README"]
- s.rdoc_options = ["--main", "README"]
- s.rdoc_options.concat ['--line-numbers', '--inline-source', '--all']
- s.rdoc_options.concat ['--exclude', 'test_rubypants.rb']
- s.require_path = '.'
- s.author = "Christian Neukirchen"
- s.email = "chneukirchen@gmail.com"
- s.homepage = "http://www.kronavita.de/chris/blog/projects/rubypants.html"
-end
-
-Rake::GemPackageTask.new(spec) do |pkg|
-end
-
-
-# Helper to retrieve the "revision number" of the darcs tree.
-def get_darcs_tree_version
- return "" unless File.directory? "_darcs"
-
- changes = `darcs changes`
- count = 0
- tag = "0.0"
-
- changes.each("\n\n") { |change|
- head, title, desc = change.split("\n", 3)
-
- if title =~ /^ \*/
- # Normal change.
- count += 1
- elsif title =~ /tagged (.*)/
- # Tag. We look for these.
- tag = $1
- break
- else
- warn "Unparsable change: #{change}"
- end
- }
-
- "-" + tag + "." + count.to_s
-end
@@ -1,9 +0,0 @@
-# Install RubyPants.
-
-require "rbconfig"
-require "fileutils"
-
-source = "rubypants.rb"
-dest = File.join(Config::CONFIG["sitelibdir"], source)
-
-FileUtils.install(source, dest, :mode => 0644, :verbose => true)
Oops, something went wrong.

0 comments on commit 9b108c1

Please sign in to comment.