Permalink
Browse files

Updated documentation

  • Loading branch information...
1 parent 2982f57 commit 5e31d5577a27b77b6144a4835d759a20bdad05b2 @djungelvral committed Jun 8, 2011
Showing with 31 additions and 16 deletions.
  1. +1 −0 .yardopts
  2. +14 −0 ext/markdown.c
  3. +16 −16 lib/peg_multimarkdown.rb
View
@@ -0,0 +1 @@
+--markup markdown
View
@@ -80,8 +80,22 @@ rb_multimarkdown_extract_metadata(VALUE self, VALUE key)
void Init_peg_multimarkdown()
{
rb_cMultiMarkdown = rb_define_class("PEGMultiMarkdown", rb_cObject);
+ /*
+ * Document-method: PEGMultiMarkdown#to_html
+ * Return string containing HTML generated from `text`
+ */
rb_define_method(rb_cMultiMarkdown, "to_html", rb_multimarkdown_to_html, -1);
+ /*
+ * Document-method: PEGMultiMarkdown#to_latex
+ * Return string containing latex generated from `text`
+ */
rb_define_method(rb_cMultiMarkdown, "to_latex", rb_multimarkdown_to_latex, -1);
+ /*
+ * Document-method: PEGMultiMarkdown#extract_metadata
+ * call-seq:
+ * extract_metadata(key)
+ * Extract metadata specified by `key` from `text`
+ */
rb_define_method(rb_cMultiMarkdown, "extract_metadata", rb_multimarkdown_extract_metadata, 1);
}
@@ -3,25 +3,25 @@
# Front-end to fletcher penney's peg-multimarkdown implementation of MultiMarkdown
#
# A simple processor:
-# >>> puts MultiMarkdown.new("Hello, World.").to_html
-# <p>Hello, World.</p>
+# >> puts MultiMarkdown.new("Hello, World.").to_html
+# <p>Hello, World.</p>
#
# With other stuff:
-# >>> puts MultiMarkdown.new("_Hello -- World!_", :smart, :filter_html).to_html
-# <p><em>Hello World!</em></p>
+# >> puts MultiMarkdown.new("_Hello World!_", :smart, :filter_html).to_html
+# <p><em>Hello World!</em></p>
#
class PEGMultiMarkdown
# Original MultiMarkdown formatted text.
attr_reader :text
- # Set true to have smarty-like quote translation performed.
+ # Set `true` to have smarty-like quote translation performed.
attr_accessor :smart
- # Set true to have footnotes processed.
+ # Set `true` to have footnotes processed.
attr_accessor :notes
- # Do not output <style> tags included in the source text.
+ # Do not output `<style>` tags included in the source text.
attr_accessor :filter_styles
# Do not output any raw HTML included in the source text.
@@ -36,20 +36,20 @@ class PEGMultiMarkdown
# Included for compatibility with RedCloth's interface.
attr_accessor :fold_lines
- # Create a new MultiMarkdown processor. The +text+ argument is a string
+ # Create a new MultiMarkdown processor. The `text` argument is a string
# containing MultiMarkdown text. Variable other arguments may be supplied to
# set various processing options:
#
- # * <tt>:smart</tt> - Enable SmartyPants processing.
- # * <tt>:notes</tt> - Enable footnotes.
- # * <tt>:filter_styles</tt> - Do not output <style> tags included in the
+ # * `:smart` - Enable SmartyPants processing.
+ # * `:notes` - Enable footnotes.
+ # * `:filter_styles` - Do not output `<style>` tags included in the
# source text.
- # * <tt>:filter_html</tt> - Do not output raw HTML included in the
+ # * `:filter_html` - Do not output raw HTML included in the
# source text.
- # * <tt>:process_html</tt> - Process MultiMarkdown code inside HTML tags.
- # * <tt>:compatibility</tt> - Process MultiMarkdown code in Markdown
- # compatibility mode.
- # * <tt>:fold_lines</tt> - RedCloth compatible line folding (not used).
+ # * `:process_html` - Process MultiMarkdown code inside HTML tags.
+ # * `:compatibility` - Process MultiMarkdown code in Markdown
+ # compatibility mode (disables all other extensions)
+ # * `:fold_lines` - RedCloth compatible line folding (not used).
#
def initialize(text, *extensions)
@text = text

0 comments on commit 5e31d55

Please sign in to comment.