MaRuKu

RubyPants -- SmartyPants ported to Ruby

snip

Authors

John Gruber did all of the hard work of writing this software in Perl for Movable Type and almost all of this useful documentation. Chad Miller ported it to Python to use with Pyblosxom.

Christian Neukirchen provided the Ruby port, as a general-purpose library that follows the *Cloth API.

Copyright and License

SmartyPants license:

Copyright (c) 2003 John Gruber (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

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

daringfireball.net

SmartyPants

daringfireball.net/projects/smartypants

Chad Miller

web.chad.org

Christian Neukirchen

kronavita.de/chris


This code does the classification of lines for block-level parsing.


Extension: math Attribute: html_math_engine Scope: document, element Output: html Summary: Select the rendering engine for MathML. Default: <?mrk Globals.to_s ?>

Select the rendering engine for math.

If you want to use your custom engine `foo`, then set:

HTML math engine: foo

{:lang=markdown}

and then implement two functions:

def convert_to_mathml_foo(kind, tex)
        ...
end

Extension: math Attribute: html_png_engine Scope: document, element Output: html Summary: Select the rendering engine for math. Default: <?mrk Globals.to_s ?>

Same thing as `html_math_engine`, only for PNG output.

def convert_to_png_foo(kind, tex)
        # same thing
        ...
end

{:lang=ruby}


This module groups all functions related to HTML export.


This module groups all functions related to HTML export.


m Any method that detects formatting error calls the m maruku_error() method. m if @meta == m m - :warning write on the standard err (or @error_stream if defined), m then do your best. m - :ignore be shy and try to continue m - :raise raises a MarukuException m m default is :raise


Boring stuff with strings.


A series of helper functions for creating elements: they hide the particular internal representation.

Please, always use these instead of creating MDElement.

Public Class Methods

textile2(source, params) click to toggle source
# File lib/maruku/input_textile2/t2_parser.rb, line 88
def self.textile2(source, params)
        m = Maruku.new
        m.t2_parse(source, params)
end

Public Instance Methods

markdown_extra?() click to toggle source

If true, use also PHP Markdown extra syntax

Note: it is not guaranteed that if it's false then no special features will be used.

So please, ignore it for now.

# File lib/maruku/version.rb, line 32
def markdown_extra?
        true
end
new_meta_data?() click to toggle source
# File lib/maruku/version.rb, line 36
def new_meta_data?
        true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.