Feature request: integration with Marked

Any thought of adding an option to preview markdown files using Marked?

I know Drafts for Mac has a preview option, but it’s feature set is limited compared to Marked, currently at least.

2 Likes

You might want to take a look at this thread:

https://forums.getdrafts.com/t/feature-suggestion-split-view-for-markdown-preview/

There’s also been a similar discussion on the Automators forum that may be worth a quick scan through?

1 Like

@sylumer Thank you for the links. I forgot about the Marked Bonus Pack, and the app’s ability to read the clipboard.

Also, I recognize your site as a TextExpander resource I’ve referenced over the years. Appreciate your help and spreading knowledge.

i see this is an old thread - and as I understand it Drafts and Marked now work very nicely together - except that I cant get them to do that …

I have this page and have done what it said.

  • Marked installed
  • Action added to Drafts

and then on this page it tells me to “use the following code (Objective-C)”

BUT …

  • where?
  • how?

any and all help welcome

All you should need to do is as per the instructions in the first link. Have the app installed, set the streaming preview option in Drafts, and then the action is just opening Marked with streaming preview enabled.

At this point Drafts should be streaming updates (to a special named clipboard if I recall correctly), and Marked should be polling that.

Nothing further is required. the Objective-C stuff is effectively programmed into Drafts’ code base and already taken care of t the app level as that second page describes.

You mention installing Drafts and the action to open Marked with streaming preview enabled, but you don’t mention that you have enabled streaming preview in Drafts. Have you done that?

thankyou for responding - first - good to know about the Objective-C stuff - wipes brow … still - I must be going nuts

In Drafts Preferences - General Tab I have checked the box at the bottom that says …

‘Enable Marked App Streaming Preview Support’

is there another place I need to be enabling aswell? If so - I cant find it.

That’s all you should need to do. With that enabled, whenever you make edits, Drafts will push updates to the Markdown Streaming Preview.

Have you opened Marked and opened its Streaming Preview window? Drafts will not open that window, you have to open it - or use the example action provide that opens it.

If you have it open and it’s not showing your Drafts content, load a different draft or make an edit to force an update to be pushed out.

Thank-you. Many thanks … and still no dice, initially - but now have it working.

Eventually I decided to just reboot the computer to ensure nothing was getting in the way. Once up … I again had the same issue - this time however - when I changed to a different Draft view the default window rendered the correct preview - so now all working …

Two thoughts … maybe in that preview window Brett should add something along the lines of pushing a change in the doc so that Marked picks it up … also can anything be done so it ‘just works’ - I notice that in (say) Mars Edit - it just shows the preview seamlessly … even if i preview and it works - in Drafts once I close that preview window - but leave Marked open - I still have to ‘push’ some kind of change the next time I preview.

As I understand it, Streaming Preview requires an update to occur to populate from the special clipboard Because Marked is watching for a change. If it displayed whatever was there last by default that may be useful for a case such as you are suggesting, but it could also be displaying something stale, something entirely different.

Marked has no way to prompt an app for an update with this integration. It is just listening.

Based on the Marked documentation, Mars Edit isn’t using Streaming Preview. It looks to be some sort of deeper and direct custom integration.

1 Like

got it - thankyou and much appreciated.

Yes, this is correct. It caught me out when first using it. Knocked up something on iPad, went to Mac Drafts to produce a fancy-formatted print out with Marked2 and then got the blue “Streaming Preview” screen in Marked2. As I am so used to an nvALT note rendering in Marked2 OK without an edit, this alternate behaviour had me scratching my head at first.