Command Line "Save As" Support, Search HTML Source
Marked 2 has become an indispensable tool in my everyday writing. There are a few additional features that I'd love to see:
- I regularly open 40 or so Markdown files and export as HTML. It would be fantastic if this were a command line option that I could automate.
- I use the Switch to HTML Source View often to identify HREF tags when linking to sections within a markdown document. If I press Cmd+F to search the HTML source, Marked 2 switched back to the preview mode instead of letting me search the HTML source. Is it possible to preserve the current view mode for search?
Thank you!
-Josh
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 28 Jun, 2018 01:08 PM
These are both nearly impossible at this point. To do anything beyond
what you can already do with command line tools (like multimarkdown,
kramdown, discount, pandoc, etc.) Marked has to load a web view. I could
have a headless browser, but at that point I'm still replicating
features that most of the existing command line tools can already pull
off.
Search in Marked is complex, and it's built around the web view (it runs
via JavaScript and HTML). It might be possible to offer a second search
for the source tab, but reworking that isn't in my current roadmap. I
can consider it for a future update, though.
-Brett
2 Posted by Joshua Wright on 29 Jun, 2018 01:42 PM
Thanks for the note Brett. If command line isn't an option, how about some other automation like AppleScript support?
I'm new to AppleScript, but this looks like it should open and save the file as HTML (my intended target):
However I get an error from Marked 2:
error "Marked 2 got an error: The document cannot be exported to the \"HTML\" format." number -50
Is that a better option for automation instead of command line services?
Thanks!
-Josh
Support Staff 3 Posted by Brett on 29 Jun, 2018 08:27 PM
Marked currently has no true AppleScript library, it only implements
"Open". I've focused mostly on the URL handler, but it only covers
preview features, not export. Export automation is something I do intend
to expand on, but at present it's not really there at all.
-Brett