Bluecloth 2.0.5

Version 2.0.5 of bluecloth has been released.

BlueCloth is a Ruby implementation of [Markdown][1], a text-to-HTML
conversion tool for web writers. To quote from the project page:
Markdown allows you to write using an easy-to-read, easy-to-write plain
text format, then convert it to structurally valid XHTML (or HTML).

== Project Page

dev(E)iate

== Installation

Via gems:

$ sudo gem install bluecloth

or from source:

$ wget http://deveiate.org/code/bluecloth-2.0.5.tar.gz
$ tar -xzvf bluecloth-2.0.5.tar.gz
$ cd bluecloth-2.0.5
$ sudo rake install

== Changes

  • Sets the ::Markdown constant to ::BlueCloth if it hasn’t yet been
    defined by something else (rails-security).

[email protected] wrote:

Version 2.0.5 of bluecloth has been released.

[Asked before for the 2.0.4 release, but maybe you didn’t see it]

Any plans to support some of the extensions that maruku supports, like
tables and footnotes? Or does it already?

http://maruku.rubyforge.org/maruku.html#extra

On Jul 15, 2009, at 6:29 PM, Joel VanderWerf wrote:

Any plans to support some of the extensions that maruku supports,
like tables and footnotes? Or does it already?

I plan to support any of the extensions that the author of Discount
(on which BlueCloth 2 is based) supports
(Discount – a C implementation of the Markdown markup language
), which don’t (currently) include those two, but do include a few
other “Markdown Extra” features.

I personally agree with the author of Markdown that anything more than
basic Markdown is diverging from the whole point of it: that you
shouldn’t have to remember to do anything different than you’d do when
writing an email to generate HTML that looks okay and is valid. If I
want tables and element IDs and definition lists, I use Textile.

That said, if anyone is motivated enough to send me a patch that adds
any of the Markdown Extra stuff, provided it (a) isn’t enabled
if :strict_mode is true, (b) includes tests, and (c) doesn’t make
keeping up with Discount updates a pain in the ass, I’ll apply it.

There is a non-standard function bzero() in generate.c, line 671
it stops VC from compiling bluecloth.
why not replace bzero() with standard memset()?

On Jul 15, 2009, at 11:32 PM, Lui Core wrote:

There is a non-standard function bzero() in generate.c, line 671
it stops VC from compiling bluecloth.
why not replace bzero() with standard memset()?

Good question; generate.c is code from Discount, so I’m loathe to
change it directly, but I’ll add a test for bzero() to the extconf,
and substitute the equivalent memset() if it’s not defined. That fix
will be in the next release. I don’t (currently) have a Windows
license to test with, so would you mind testing it out before I release?

Michael G. wrote:

On Jul 15, 2009, at 11:32 PM, Lui Core wrote:

There is a non-standard function bzero() in generate.c, line 671
it stops VC from compiling bluecloth.
why not replace bzero() with standard memset()?

Good question; generate.c is code from Discount, so I’m loathe to
change it directly, but I’ll add a test for bzero() to the extconf,
and substitute the equivalent memset() if it’s not defined. That fix
will be in the next release. I don’t (currently) have a Windows
license to test with, so would you mind testing it out before I release?

I’d be glad to :slight_smile:

Hi,

I am trying to install bluecloth on Windows XP, but got the following
errors when I issue the “gem install bluecloth” command:

C:\jerry>gem install bluecloth
Building native extensions. This could take a while…
ERROR: Error installing bluecloth:
ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb
checking for srand()… no
checking for srandom()… no
checking for random()… no
checking for rand()… no
checking for strcasecmp()… no
checking for stricmp()… no
This extension requires either strcasecmp() or stricmp()
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

IF YOU ARE USING VC2005 or VC2008, there maybe a problem of strcasecmp()
and stricmp().
stricmp() is deprecated since VC 2005 (use _stricmp() instead), but
ruby’s header win32.h doesn’t know it.

a quick hack fix:
in include/ruby-1.x.x/ruby/win32.h, change definitions of strcasecmp and
strncasecmp as follows:

#define strcasecmp _stricmp
#define strncasecmp _strnicmp

For other compilers, maybe there is a similar issue ? i don’t know …

… you need a C compiler to build native extensions …

Li Cheng wrote:

Hi,

I am trying to install bluecloth on Windows XP, but got the following
errors when I issue the “gem install bluecloth” command:

C:\jerry>gem install bluecloth
Building native extensions. This could take a while…
ERROR: Error installing bluecloth:

On Jul 31, 8:23 am, Li Cheng [email protected] wrote:

Is there another way to get bluecloth on to Windows without gem or C
compiler?

Thank you.

Please ask the gem author to use rake-compiler to generate native
Windows gems during the release process:

There are several examples of other gem authors using rake-compiler to
release gems:

http://wiki.github.com/luislavena/rake-compiler/projects-using-rake-compiler

Using that tool they will be able to generate binaries for Windows
without you needed to fight and resolve the obsolete VC6/Compiling
extensions war.

On Aug 7, 9:37 am, Michael G. [email protected] wrote:

You can also fetch the binary gem from:

http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem

Michael.

If you switch to rake-compiler you can deliver Windows native gems
from the convenience of Linux or OSX.

Is there another way to get bluecloth on to Windows without gem or C
compiler?

Thank you.

On Jul 31, 2009, at 4:23 AM, Li Cheng wrote:

Is there another way to get bluecloth on to Windows without gem or C
compiler?

Sorry, I do actually have build targets for binary Windows-compatible
gems, but I’ve been neglecting to build them. I’ve built one for the
2.0.5 release and put it on RubyForge, and I’ll be hooking the win32
build into my release tasks so they’ll be distributed for future
releases, too.

You can also fetch the binary gem from:

http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem

On Aug 7, 2009, at 4:00 PM, Luis L. wrote:

On Aug 7, 9:37 am, Michael G. [email protected] wrote:

You can also fetch the binary gem from:

http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem

If you switch to rake-compiler you can deliver Windows native gems
from the convenience of Linux or OSX.

But I’m already delivering them from the convenience of OSX! :slight_smile:

I tested it using a friend’s Windows box, but the gem above was built
on my Mac Pro. I wrote Rake tasks to build a cross-compiling Ruby, and
then cross-compile gems before I’d even heard of rake-compiler. I
think rake-compiler is an awesome bit of software, don’t get me wrong,
but I’m loathe to convert 20+ projects to use it now when I already
have something that works pretty well.

On Aug 7, 9:04 pm, Michael G. [email protected] wrote:

But I’m already delivering them from the convenience of OSX! :slight_smile:
Glad to hear that!

I tested it using a friend’s Windows box, but the gem above was built
on my Mac Pro. I wrote Rake tasks to build a cross-compiling Ruby, and
then cross-compile gems before I’d even heard of rake-compiler. I
think rake-compiler is an awesome bit of software, don’t get me wrong,
but I’m loathe to convert 20+ projects to use it now when I already
have something that works pretty well.

Then perhaps I was looking at the wrong code, since couldn’t find over
the repository:

Any indication of cross compilation tasks.

I’m not wanting to force you use another tool or transform your
projects, just wanted to ease the burden on helping others.

Cheers,

On Aug 8, 2009, at 4:35 PM, Luis L. wrote:

dev(E)iate

Any indication of cross compilation tasks.

Check here:

http://repo.deveiate.org/rake-tasklibs/file/bc0c72d95663/win32.rb

I have a single directory of rake tasks for all my other projects that
gets checked out under the top-level directory.

I’d appreciate any suggestions you might have for me if you see
something glaringly wrong. I stitched the tasks together out of a
couple of blog posts on the subject I found, and I know very little
about Win32 or binary gems. They seem to work when I test them, but I
might be doing something horrible.

On Aug 7, 1:37 pm, Michael G. [email protected] wrote:

You can also fetch the binary gem from:

http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem


Michael G. [email protected]
Rubymage, Architect, Believer
The FaerieMUD Consortium http://www.FaerieMUD.org/

Hi Michael,

I’m trying to use the bluecloth-2.0.5-x86-mingw32.gem gem on Windows
XP, and the install went beautifully, but I get errors on use. Using
this test:


require ‘bluecloth’
BlueCloth.new(‘testing’).to_html


I get the following:


C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': no such file to load -- bluecloth_ext (LoadError) from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in require’
from C:/Ruby/lib/ruby/gems/1.8/gems/bluecloth-2.0.5-x86-
mingw32/lib/bluecloth.rb:156
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
36:in gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 36:in require’
from C:/Ruby/temp.rb:1


Am I missing a dependency somewhere? Apologies if this is an obvious
issue, I’m not a Ruby person, I’m just trying to help the Prototype
project with its documentation, and naturally they’re trying to use
BlueCloth2 for markdown stuff.

Thanks in advance,

On Sep 7, 7:07 pm, Luis L. [email protected] wrote:

Is there another way to getblueclothon to Windows without gem or C
http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem
this test:
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
Am I missing a dependency somewhere? Apologies if this is an obvious
Unless, of course, you’re requiring it inside Rails, which already
requires rubygems and you should be indicating the gem dependency
inside environment.rb

HTH,

Luis L.

Hi Luis,

Thanks for that. Unfortunately, that doesn’t seem to be it, adding
the rubygems require didn’t change anything. I’m not a Ruby person,
but I guess that means they must be enabled by default in (as you say)
the configuration; this is just a fairly basic One-Click Ruby Install.

Thanks anyway, though,

On Sep 10, 11:04 am, “T.J. Crowder” [email protected] wrote:

On Jul 31, 2009, at 4:23 AM, Li Cheng wrote:
You can also fetch the binary gem from:
I’m trying to use the bluecloth-2.0.5-x86-mingw32.gem gem on Windows
`gem_original_require’: no such file


BlueCloth.new(‘testing’).to_html

Thanks for that. Unfortunately, that doesn’t seem to be it, adding
the rubygems require didn’t change anything. I’m not a Ruby person,
but I guess that means they must be enabled by default in (as you say)
the configuration; this is just a fairly basic One-Click Ruby Install.

Thanks anyway, though,

Seems you using the old One-Click Installer.

Please follow some guides from our homepage:

I can tell you lot of these gems works on the new version of Ruby
Installer :slight_smile:

Hi,

I am using rubyinstaller-1.8.6-p383-rc1.exe .

When I install bluecloth (gem install bluecloth), I get:
Building native extensions. This could take a while…
ERROR: Error installing bluecloth:
ERROR: Failed to build gem native extension.

C:/Ruby1.8.6/bin/ruby.exe extconf.rb
checking for srand()… no
checking for srandom()… no
checking for random()… no
checking for rand()… no
checking for strcasecmp()… no
checking for stricmp()… no
This extension requires either strcasecmp() or stricmp()
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Using the binary gem from
http://deveiate.org/code/bluecloth-2.0.5-x86-mingw32.gem
leads to the same problem as the one described in
dev(E)iate .
In the binary gem the file bluecloth_ext.so is missing. Does someone
have it?

Basically the advice given by Lui K. looks really relevant. Indeed in
C:\Ruby1.8.6\lib\ruby\1.8\i386-mingw32\win32\win32.h the lines
#define strcasecmp(s1, s2) stricmp(s1, s2)
#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
seem at fault.
I’d like to change them to
#define strcasecmp(s1, s2) _stricmp(s1, s2)
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)

But then, how can these lines be taken into account. How can they be
compiled?

Thx
Happy Holidays
H