-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
This’ll help with distribution, once this thing is on RubyGems
DRY this up
We’ll use rake-compiler for everything, which is pretty common
This looks great to me! You are obviously a much more accomplished One note: libcmark now provides its own iterator inference for walking |
@jgm That sounds good to me. Are you thinking to just transfer the repo? If so I might need to remove my fork first, to avoid a name clash. I did not know there was a function for walking the AST--thanks for the tip! |
+++ Garen Torikian [May 09 15 19:01 ]:
It is probably easiest just to make your fork the canonical repository I don't think I ever pushed this to a remote gem repository, so
There have been lots of changes to the C API since I wrote this ruby |
Cool. I've detached my repo from the network: https://github.com/gjtorikian/commonmarker/ Thanks very much! Closing this out as it's irrelevant now. |
Great! Let me know when you've finished the library, and we can publicize it on http://talk.commonmark.org and put it on the list of implementations. |
I'm very nearly finished with the initial wrapper. I have two questions that I can't seem to solve, I was hoping you might be able to shed some light on them. First, only four tests in the spec are failing. They seem to have to deal with emphasis next to punctuation. The Ruby lib is not providing proper emphasis:
I was wondering if you've seen this problem before? The test code is just straight calling the The second problem is with HTMLRenderer. Almost all of those tests are failing, but for trivial reasons mostly dealing with
Here, an extraneous newline is being inserted. This happens several times. I was wondering if there was an easier way to fetch the expected HTMLRenderer behavior, without having to dig into the C for forever. Thanks for any help! |
One more tremendously confusing thing I just noticed: according to my latest Travis run, all the spec tests pass, including the four I have issues with up above. I'm running OS X,Travis runs Ubuntu 12.04. So perhaps I'm compiling the lib incorrectly on my machine--I wonder if there is a CFLAG or something I am missing? I can run all of cmark's spec tests just fine. |
Are you sure you have the latest version of the C code? +++ Garen Torikian [May 11 15 10:31 ]:
|
Yep. My latest sha is bc5f16f146558a1faf9be6abe034755421f6ecce. gjtorikian/commonmarker@5a5be04 |
On the first problem: those four tests that fail were added fairly recently. All of them pass in 0.19 but fail in earlier versions. That's why I suspected you had an earlier version. Are you sure you're linking against the version of the library in your submodule, and not e.g. one you installed to the system earlier? (Note: libcmark exports cmark_version_string, so if you expose this through ruby you can see directly what version is being used.) If it's not that, I'm at a loss. My only other idea is to check your locale? But it shouldn't be sensitive to this. (Note: the README still says that you must have installed libcmark to the system to use commonmarker. I believe that isn't supposed to be true any more, the way you're doing things. The README could probably use a rewrite, for this and for other things. It would be worth doing new benchmarks, too, as cmark has gotten a bit faster.) |
HTMLRenderer is a ruby class, so it has nothing to do with the C library. But I assume you mean, how do we get its output aligned with the standard HTML output of the C lib? Why not just look at the spec tests themselves? |
Damn! Good call. I was erroneously linking to 0.18.3. The gem now passes the C suite fully.
Yeah, I need to update that and the benchmark results as part of the PR.
Heh, mostly because I was hoping for an easier way. 😀 Anyway, it shouldn't take me more than than the week to get that sorted out, now that the mystery of the failing spec is resolved. |
Closes #1.
Here's what's going on in this PR:
Right now, I'm working my way through the basic test suite. Walking the chain seems to be coming along just fine. I'm curious to know if you have any style/design concerns or whether I should continue down this path.
It would be great to add a Travis file to this repo so that I can get automated tests for this branch.