Preview broken for Scrivener: only see headlines, no text

Andreas's Avatar

Andreas

07 Jan, 2025 05:09 PM

Hi there!
After setting up a new Mac and installing scrivener and Marked 2 the preview does work properly anymore :slightly_frowning:

I only see the folder names from scrivener but none of the text which is a nuisance. I always loved to used the combo scrivener/Marled 2 to preview my md text from scrivener.

What did I wrong?

  1. Support Staff 1 Posted by Brett on 07 Jan, 2025 06:17 PM

    Brett's Avatar

    Did you change operating systems when you set up your new Mac? The
    Scrivener compiler relies on some scripting languages being available
    (Ruby, Python) that may take some extra setting on a new Mac as they're
    no longer included in the OS. Let me know if that's the case and I'll
    offer some guidance.

    -Brett

    On 7 Jan 2025, at 11:11, Andreas wrote:

  2. 2 Posted by Andreas on 08 Jan, 2025 12:21 AM

    Andreas's Avatar

    Thanks for the fast reply!
    Yes and no: I stayed within OSX but went from I think version 12 to 14.4
    Python is installed.
    And now Ruby is installed as well. 😉
    I closed the program and restarted both programs.
    But I am sorry: no change.

    The only thing I did not do is restart the computer. That I'll do tomorrow.

  3. Support Staff 3 Posted by Brett on 08 Jan, 2025 07:26 PM

    Brett's Avatar

    Are you familiar enough with Terminal to run a simple test for me? The Ruby script that does most of the compiling for Scrivener integration is located in the Marked bundle. You just need to pass the path to a Scrivener file to it in Terminal to see what the output is. The basic command would be (may differ slightly depending on which version of Marked you have):

    /Applications/Marked\ 2.app/Contents/Resources/ruby/scrivcompile.rb ~/path-to-scrivener-file.scriv
    

    You can easily get the path to the scrivener file by locating it in Finder, right clicking it, and holding down option. That will show the menu option "Copy X as path name." Selecting that will copy the path and you can paste it for the second half of that command. You can also just enter the path to scrivcompile.rb hit space, and then drag the file into the Terminal, which should just paste the path to the file.

    If you're able to run this command, let me know what the output you get looks like. It should be normal Markdown output, blank/just headlines, or an error message. Any of the three would help me start debugging. For the record this works fine for me, but there are very likely a lot of differences between our system.

    -Brett

  4. Support Staff 4 Posted by Brett on 08 Jan, 2025 07:39 PM

    Brett's Avatar

    Oh, if you add "true" after the scrivener path, it will output the titles, which may be needed if the response is blank.

    For reference, the script calls the built-in utility textutil to convert to HTML, then calls html2text in Python to convert the HTML to Markdown. The issue may be in the Python call, because it only searches certain locations. If that ends up being the problem, let me know what the Terminal commands which python and which python3 return.

  5. 5 Posted by Andreas on 10 Jan, 2025 01:49 PM

    Andreas's Avatar

    Hi Brett!

    Sorry for the time lag.

    Here we go.
    The output in iTerm2 vs the scrivener file. As you wrote, it is the Markdown output.

    Cheers
    Andreas

    Am 8. Januar 2025 um 13:26:38, Brett ([email blocked]) schrieb:

  6. 6 Posted by Andreas on 10 Jan, 2025 01:56 PM

    Andreas's Avatar

    I am sorry I am not if I understand the “true” argument. You like this
    /Applications/Marked\ 2.app/Contents/Resources/ruby/scrivcompile.rb ~/path-to-scrivener-file.scriv true  ?

    "which python" gets me 
    /opt/anaconda3/bin/python respective /opt/anaconda3/bin/python3

    Which is little weird as I installed packages with pip and not with condo :thinking:

     CheersAndreas
       
    Am 8. Januar 2025 um 13:39:44, Brett ([email blocked]) schrieb:

  7. Support Staff 7 Posted by Brett on 10 Jan, 2025 01:59 PM

    Brett's Avatar

    What about:

    which ruby

    - Brett
    On Jan 10, 2025 at 7:56 AM -0600, Andreas <[email blocked]>, wrote:

  8. 8 Posted by Andreas on 10 Jan, 2025 02:09 PM

    Andreas's Avatar

    /usr/bin/ruby

      
       
    Am 10. Januar 2025 um 08:00:10, Brett ([email blocked]) schrieb:

  9. Support Staff 9 Posted by Brett on 10 Jan, 2025 03:09 PM

    Brett's Avatar

    Ok, I'm guessing what's happening is that your copy of python is in your path when you're logged into your shell, but not visible to Marked when it runs the script in a non-login shell. This should be able to be fixed with a symbolic link.

    First, make sure there's no file at /usr/bin/pyhon3

    ls /usr/bin/python3
    

    If that gives you a file missing error, try running:

    ln -s /opt/anaconda3/bin/python3 /usr/bin/python3
    

    Then try opening a Scrivener file in Marked again.

  10. 10 Posted by Andreas on 10 Jan, 2025 08:10 PM

    Andreas's Avatar

    OK. 

    ls /usr/bin/python3 results in /usr/bin/python3

    And 

    ln -s /opt/anaconda3/bin/python3 /usr/bin/python3  results in:   ln: /usr/bin/python3: Operation not permitted

      
    Should I use the sudo command?
       
    Am 10. Januar 2025 um 09:09:19, Brett ([email blocked]) schrieb:

  11. Support Staff 11 Posted by Brett on 10 Jan, 2025 09:25 PM

    Brett's Avatar

    No, if there’s already a python3 executable in /usr/bin then that’s not the problem. Let me see if I can come up with a debug build for you. Other users have run into very similar issues and I’m not sure I’ve ever found a solution that fits everybody.

    It might take me a few days to put together the build, but bear with me.

    - Brett
    On Jan 10, 2025 at 2:10 PM -0600, Andreas <[email blocked]>, wrote:

  12. 12 Posted by Andreas on 11 Jan, 2025 07:44 PM

    Andreas's Avatar

    Thanks. 
      
       
    Von: Brett <[email blocked]>
    Antworten: Brett <[email blocked]>
    Datum: 10. Januar 2025 at 15:25:22
    An: [email blocked] <[email blocked]>
    Betreff:  Preview broken for Scrivener: only see headlines, no text [Problems]

Reply to this discussion

Internal reply

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

Attaching KB article:

»

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