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).
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()?
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?
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 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:
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.
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!
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.
But I’m already delivering them from the convenience of OSX!
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.
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.
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.
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.
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
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.
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?