Images not showing

's Avatar

dominics

Feb 02, 2017 @ 01:50 PM

Hi there,
I have downloaded the trial version of Marked2, but my images do not seem to work with Marked2. For example:

Sunni Shia Distribution

does not show anything.

I have a base path in the template file, and all the images do work in nvalt. I also checked the path that Marked2 is accessing, and to me this also seems correct, that is, when I do COPY URL it gives me the full path i.e.:

file:///Users/dsuser/Documents/Notes/media/20170201225905_sunni_shia_distribution.jpg

Any ideas?

  1. Support Staff 1 Posted by Brett on Feb 02, 2017 @ 02:56 PM

    Brett's Avatar

    Do you get a broken image icon in the preview?

  2. 2 Posted by dominics on Feb 02, 2017 @ 06:50 PM

    dominics's Avatar

    The nvalt preview renders correctly, in marked2 I get a small blue box with a white question mark instead of the actual image (if that's what you mean)

  3. Support Staff 3 Posted by Brett on Feb 02, 2017 @ 08:43 PM

    Brett's Avatar

    Is the base path defined in a custom nvALT template or in the note itself? Can you send me an example note from nvALT to test with?

  4. Support Staff 4 Posted by Brett on Feb 02, 2017 @ 08:45 PM

    Brett's Avatar

    Oh, sorry, just saw that you already answered that question. So if the base path is defined in the nvALT template, how are you translating that to Marked? Marked is going to use the notes location as the root folder, so if the image location's relative path differs, Marked wouldn't be picking that up…

  5. 5 Posted by dominics on Feb 03, 2017 @ 01:08 PM

    dominics's Avatar

    Thank you, you are right I just saw that indeed a folder is missing (between Notes & media), - I was under the impression the path was correct! I guess my question then is: How can I translate the base path to Marked2?

  6. 6 Posted by dominics on Feb 08, 2017 @ 05:07 AM

    dominics's Avatar

    Hey there again,
    Do you know how I could maybe integrate the base path into Marked2?

  7. Support Staff 7 Posted by Brett on Feb 08, 2017 @ 06:22 PM

    Brett's Avatar

    Well, you could include a transclude base at the top of every note, e.g.

    transclude base: /Users/dsuser/Documents/Notes/media/
    

    but that would get tedious. I took a minute to write a preprocessor script that will handle it more seamlessly, take a look at the comments and let me know if it works for you. (If you don't know how to use it at all, let me know and I'll offer more detailed instructions.)

    https://gist.github.com/ttscoff/fd7a8580fbc30cb07bb9cbf3e5b1629e

Reply to this discussion

Internal reply

        Formatting help / Preview (switch to plain text)

          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