Can't get kramdown working
Total rookie here, I'm sure I'm doing something dumb.
Here's what I've done.
* Installed Kramdown using - sudo gem install kramdown
* Opened marked preferences (2.4.4 non MAS version)
* Entered '/usr/bin/kramdown' in custom processor path
* Updated permissions
* When I try to enable to the custom processor I get "Error running custom processor".
24 second screencast: https://v.usetapes.com/BhzzVuR6RE
Any ideas?
- David
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on Sep 19, 2014 @ 04:10 PM
The error you're receiving is "The encoding of the source text is not
valid." What happens if you run (adjusting the path to the text file as
necessary):
cat "kramdown test.txt" | /usr/bin/kramdown
-Brett
2 Posted by David EIffert on Sep 19, 2014 @ 04:21 PM
Thanks for the help Brett! You're basically my hero.
3 Posted by David EIffert on Sep 19, 2014 @ 04:25 PM
Oh, here's the text file if that's helpful.
Support Staff 4 Posted by Brett on Sep 19, 2014 @ 04:30 PM
If you can attach the actual text file itself, I'll give it a test.
5 Posted by David EIffert on Sep 19, 2014 @ 04:34 PM
:)
Support Staff 6 Posted by Brett on Sep 19, 2014 @ 04:52 PM
I get the same error with your text file, but not with others. Not sure why. However, if I use kramdown as a library in an executable script as the custom processor, it seems to work:
I'm noting that the {: #id} isn't doing anything, though, even when I put it in the correct places. That's baffling me at the moment.
Support Staff 7 Posted by Brett on Sep 19, 2014 @ 04:55 PM
I take it back, it appears to be defaulting to the standard processor, indicating that the script is failing silently. Hrm.
I'll do some more testing.
Support Staff 8 Posted by Brett on Sep 19, 2014 @ 05:02 PM
Ah, found it. If you have "Enable Leanpub support" turned on under Apps prefs, it will bork those {:.id} tags. Turn that off and that script seems to work fine.
9 Posted by David EIffert on Sep 19, 2014 @ 05:26 PM
Using the executable script as the custom processor is working! Thanks so much.
Upon further inspection of my original file, it looks like there's strange character after 'Series' that was messing it up. It was a copy/paste from scrivener. Wonder how that happened.
I wonder if force encoding to utf-8 in the executable script as custom processor might have fixed that.
Support Staff 10 Posted by Brett on Sep 19, 2014 @ 05:31 PM
Yes, without the force_encoding it still breaks.
-Brett