Blank preview with custom processor

Tyson Tate's Avatar

Tyson Tate

06 May, 2012 04:43 AM

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 :)

  1. Support Staff 1 Posted by Brett on 06 May, 2012 02:29 PM

    Brett's Avatar

    Right click on the preview and choose the Inspect Element option. Inside of the `<div id="wrapper">`, is there content present?

    Thanks,
    Brett

  2. 2 Posted by Tyson Tate on 08 May, 2012 04:16 AM

    Tyson Tate's Avatar

    There is no content in that element.

  3. Support Staff 3 Posted by Brett on 08 May, 2012 10:31 AM

    Brett's Avatar

    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. 4 Posted by Tyson Tate on 08 May, 2012 07:22 PM

    Tyson Tate's Avatar

    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!

  5. Support Staff 5 Posted by Brett on 08 May, 2012 07:36 PM

    Brett's Avatar

    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. 6 Posted by Tyson Tate on 08 May, 2012 07:54 PM

    Tyson Tate's Avatar

    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!

  7. Support Staff 7 Posted by Brett on 09 May, 2012 04:52 AM

    Brett's Avatar

    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. 8 Posted by Tyson Tate on 09 May, 2012 05:04 AM

    Tyson Tate's Avatar

    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

  9. Support Staff 9 Posted by Brett on 09 May, 2012 05:16 AM

    Brett's Avatar

    Email sent, let me know if you don't receive it for any reason.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Screen_Shot_2012-05-05_at_9.35.25_PM.png 382 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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