redcloth

Apply StyleSheet to Textile with Redcloth?

How do you apply an external stylesheet to a textile document with Ruby's Redcloth, so that I can convert it to HTML and it will apply the styles? I understand how to apply styles individually to parts of text, but how to I define a whole style (say text with font-size 20, color red, alignment x, font-family y, etc.), and apply it to al...

What does this construction mean, in Ruby?

The method below exists in the Redcloth gem. My question is: what does the construction "to(RedCloth::Formatters::HTML)" mean? "to" isn't a method in the class, nor in the superclass (wich is String class). Cheers. Christian. def to_html( *rules ) apply_rules(rules) to(RedCloth::Formatters::HTML) end ...

Error installing RedCloth

I'm getting this erron when trying to install RedCloth on openSuse: sudo gem install RedCloth Building native extensions. This could take a while... ERROR: Error installing RedCloth: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb creating Makefile make sh: make: nie znaleziono polecenia Gem files wil...

RedCloth :sanitize_html rules

the RedCloth documentation states "if +:sanitize_html+ is set, HTML can pass through the Textile processor but unauthorized tags and attributes will be removed." Is there a way to specify the 'unauthorized tags?' ...

How can I get Textile to create links out of plain URL's?

Many of my users are typing in plain URL's and not using the Textile format for creating links. I would like Textile to just make the URL's linkable to the URL's. I don't really need to worry about XSS or anything malicious because it is an internal network with a very small group of users. What would be the best way to go about achievin...

How do I create a RedCloth live preview using jQuery?

I've had problems with many of the WYSIWYG gems/plugins for Rails, so I'm building one myself using the RedCloth gem. I want users to see a live preview of their HTML-formatted text as they're filling out a form, but don't know how to do that using jQuery and RedCloth. Here's what I tried in application.js: $('#comment').keyup(function(...

Textile question: redcloth anchor links

How do I write this in textile (i'm using the redcloth gem) <a href="#tips">Visit the Useful Tips Section</a> <a name="tips">Useful Tips Section</a> I know the first part, "Visit the Useful Tips Section":#tips but how do I make the named anchor? Thanks! Deb ...

How to use rails3 with RedCloth. require 'RedCloth' not working

I have installed RedCloth, by using the devkit. Using gem install RedCloth. If I use plain irb, then require 'RedCloth' works fine. But if I use rails console and do require 'RedCloth', it says it can't find file to load. Please help. Rails 3.0.0 RedCloth 4.2.3 ...

CodeRay and RedCloth in a Rails 3 application

I'm trying to add CodeRay and RedCloth to a Rails 3 application and am getting some strange behaviors. I followed this RailsCast, but since Rails 3 escapes the HTML by default, my HTML is being escaped a couple of times. What do I need to change? module ApplicationHelper def coderay(text) text.gsub(/\<code( lang="(.+?)")?\>(.+?)\<...