BlueStole - BlueCloth Wrapper
What's BlueStole ?
BlusStole is a personal extention for Ruby's Markdown library,
Points of extention are below. All fucntions other than 'HTML include'
are able to set enable/disable by using each accessors.
- HTML Include
- Blocks starts
/^<html>$/ and ends
/^</html>$/ are printed directly. This function is used mainly including html document parts in Markdown documents.
- Definition List dl/dt/dd (deflist)
- If a line ends with
':' and the next line starts to indent, those
are converted to a definition list. You can write many lines in
a part that converts to the dd element. But dd elements include
only one paragraph because it's returned to a other block by a
blank line. That's to say, a dd element can't include p elements.
- Inline elements in a definition list convert by Markdown.
- A definition list can't be included in block elements are
converted by BlueCloth, because the deflist implementation isn't
- Table (table)
- You can write the RT format tables. A table block starts line that starts with
'|', and ends line that doesn't start with
'|'. Strings after
'|' directly throw to RTtool, so if you think writing tables you must write RT format tables. Markdown elements are not converted why throwing way is direct.
- Footnote (fn)
- If '(*' exists, it and next ')' are converted for a footnote.
- Adding id and name to hx elements (hxid)
- Header lines that are converted to hx elements, are added a id and a name properties automatically. If the hx element includes a a element, properties add to the element.
- Disable converting from '_' to em element (sub_us)
- Original Markdown syntax converting from under score to em element, is disabled. Because it's obstruction when we write programming language's functions in Markdown documents.
- EmptyElementSuffix = ' />' (sub_ees)
- BlueCloth's empty element's suffix (
'/>' is original) are changed to
- Adding height and width to img elements (image_info)
- If a file is pointed by img element's src property exists, a height and a width properties add to the img element.
Download / Install
You can download from http://wids.net/archive/bluestole/,
cp bluestole.rb to somewhere under ruby's library path.
How to use
bs = BlueStole.new(strings)
bs.to_html #=> converted strings
bs.deflist = false
bs.to_html #=> converted strings without deflist
GNU General Public License 2
- 2007/11/10 - version 0.6.2 (deflist & pre's bug fix)
- 2007/10/13 - version 0.6.1 (bug fix)
- 2006/01/07 - version 0.6 (image_info swap & Ruby 1.8.4)
- 2005/12/17 - version 0.5