Sha256: ed2d32c36afc3df293bc34e74c1feca4b3fb41a930c2108cc86d81d6518b9053
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
class String def to_permalink str = ActiveSupport::Multibyte::Chars.new(self.dup) str = str.normalize(:kd).gsub(/[^\x00-\x7F]/,'').to_s str.gsub!(/[^-\w\d]+/xim, "-") str.gsub!(/-+/xm, "-") str.gsub!(/^-?(.*?)-?$/, '\1') str.downcase! str end def fix_scenebreaks str = ActiveSupport::Multibyte::Chars.new(self.dup) str .gsub(/\\begin{center}.*?\\rule{3in}{0.4pt}.*?\\end{center}/m,'\pfbreak') .gsub('\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}','\pfbreak') # For PandocRuby end def sectionize str = ActiveSupport::Multibyte::Chars.new(self.dup) "<div class='section'>#{str}</div>" end # Filter words: # See look hear know realize wonder decide notice feel remember think # That...Really & Verry # # def to_latex(headers=nil) # headers = %w{chapter section subsection subsubsection paragraph subparagraph} if headers.nil? # require 'kramdown' # s = Kramdown::Document.new(self.dup, :latex_headers => headers).to_latex # s << "\\pbreak{}" # end # def to_html # require 'kramdown' # Kramdown::Document.new(self.dup).to_html # end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
verku-0.16.10 | lib/verku/extensions/string.rb |
verku-0.16.9 | lib/verku/extensions/string.rb |