Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
= vidibus-textile
Basically, this is a wrapper for RedCloth with some extensions. It is inspired by the acts_as_textiled plugin and extends your Mongoid models.
This gem is part of the open source SOA framework Vidibus: http://vidibus.org
== Installation
Add the dependency to the Gemfile of your application:
gem "vidibus-textile"
Then call bundle install
on your console.
== Usage
The basic methods are:
Vidibus::Textile.new('Some say, "love":http://doit.xxx is a river.').to_html
Some say, love is a river.
'Vidibus::Textile.new('Some say, "love":http://doit.xxx is a river.').to_text
The method #to_text will return a plain text version of textile content but keep newlines intact. However, if you just want a stripped version without newlines, provide the option :plain => true
Vidibus::Textile.new("Super\nTrouper").to_text(:plain => true)
== Mongoid integration
Adding textile content to your Mongoid model is simple:
class Page include Mongoid::Document include Vidibus::Textile::Mongoid textile :body end
By setting textile :body on the page model above, it will be extended by two fields:
field :body
field :body_plain
Additionally, the method #body_html is available. As one could guess, it returns rendered html from the textile content.
== View helper
For your convenience, the view helper #stripped is available (as counterpart for Rails' #textilize).
stripped("Super\nTrouper", :plain => true)
== Copyright
Copyright (c) 2010 Andre Pankratz. See LICENSE for details.
FAQs
Unknown package
We found that vidibus-textile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.