Blank preview with custom processor
I'm trying to set up Docter (https://github.com/alampros/Docter) to allow me to preview GitHub-flavored markdown, but I'm having an issue whereby the preview for my document is completely blank. However, the word count is accurate (though I'm not sure if you're pulling that from the HTML or the Markdown).
There are no messages in the console, and I'm able to verify
that docter
works properly through the command-line
(see screenshot).
What else can I do to figure out why this isn't working?
(Also, consider this a feature request for official GitHub-flavored Markdown support :)
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 06 May, 2012 02:29 PM
Right click on the preview and choose the Inspect Element option. Inside of the `<div id="wrapper">`, is there content present?
Thanks,
Brett
2 Posted by Tyson Tate on 08 May, 2012 04:16 AM
There is no content in that element.
Support Staff 3 Posted by Brett on 08 May, 2012 10:31 AM
run
defaults write com.brettterpstra.marky debugMode 1
and then watch console as you load a document. Let me know what you see.For the record, Marked does now support Github line breaks, fenced code blocks and syntax highlighting. What does Docter add to that for you?
4 Posted by Tyson Tate on 08 May, 2012 07:22 PM
Here's the console output: https://gist.github.com/2638591
I'm trying to get Docter to work to support fenced code blocks with language specifiers. For example, this code is shown in the attached screenshot using the default styles.
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```
Thanks for your help!
Support Staff 5 Posted by Brett on 08 May, 2012 07:36 PM
I can save you some time and effort :)
Preferences->Behavior->Convert Fenced Code Blocks screenshot
Preferences->Style->Automatic syntax highlighting screenshot
Fenced code blocks with either "`" or "~" and language specifiers in Github or Markdown Extra formats will be added as classes to the
<pre>
element. The automatic syntax highlighting will usually figure out the language regardless of whether you use specifiers, but that way you can write exactly as you would on Github (and your html output will match what you see on Github, too).The included Github stylesheet has all of the necessary styles to match Github formatting exactly. Set Preferences-Style->Limit text width in Preview to: 900px and expand the preview past 900px for exact word wrapping.
Exporting HTML with Syntax highlighting enabled will include the Highlight.js library as well.
-Brett
6 Posted by Tyson Tate on 08 May, 2012 07:54 PM
Ah! I didn't know about those options (well, I didn't realize they did what I wanted). So, I made those changes and tried to open the file in question. Marked then hung, pegging my CPU. I force-quit the app. Here's some things that I hope help:
Hang report: https://gist.github.com/c82968abbd1bb431c5bb
Markdown: https://gist.github.com/2638807
Console output: https://gist.github.com/f5a7ce8fb96ee6f97afc
Thanks again for all your help on this!
Support Staff 7 Posted by Brett on 09 May, 2012 04:52 AM
I forgot the current public version chokes when there are too many code blocks. I have this entirely fixed for the next release; it can render 50+ code blocks in about 1 second. I'd be willing to send you a beta if you're interested in testing it out. If so, let me know and I'll email you privately.
Also, I'm betting you're running a Ruby version manager (rvm, rbenv, etc). Is that the case? If so, you can fix Docter by switching to system ruby,
sudo gem install redcarpet pygments.rb
and change the gfm hashbang to /usr/bin/ruby instead of using /usr/bin/env ruby. Just in case you want to go that route. I just tested and ran into the same issue, that's how I fixed it.8 Posted by Tyson Tate on 09 May, 2012 05:04 AM
I'd be happy to test it out. I'll see if I can't break it in interesting ways. :)
(Yeah, using rbenv with ruby-1.9.3p125 globally set.)
-Tyson
Support Staff 9 Posted by Brett on 09 May, 2012 05:16 AM
Email sent, let me know if you don't receive it for any reason.