Command line interface

's Avatar

manuel

12 Sep, 2011 07:45 PM

A shell command like 'marked' which will read html or markdown from a pipe or a file and output it.

  1. Support Staff 1 Posted by Brett on 12 Sep, 2011 07:52 PM

    Brett's Avatar

    Output to Marked, or just output HTML? For the latter, you can just use the command-line version of MultiMarkdown…

  2. Support Staff 2 Posted by Brett on 13 Sep, 2011 12:39 AM

    Brett's Avatar

    I think that a marked command that took piped input or a file parameter and opened the result in Marked could actually be really cool, now that I think about it. I'll look into it this week.

  3. 3 Posted by Kris on 13 Sep, 2011 12:48 AM

    Kris's Avatar

    I'd be happy with a simple command line interface to opening a markdown file in Marked, a la the effect of running Marked, hitting ⌘O, and finding that file.

    What I'd ultimately like to achieve is a simple way to "watch" a markdown file with Marked from the command line. That would make it super easy to bind a key combo from within Sublime Text, Textmate, Emacs, Vim, etc. to watch the file you've just created and are hacking on.

  4. Support Staff 4 Posted by Brett on 13 Sep, 2011 12:58 AM

    Brett's Avatar

    That's pretty much what I'm thinking, with the additional ability to accept piped output so it can be chained with commands in other workflows. By the way, open -a Marked filename.md will work right now, too. I've used it in TextMate commands, Vim bindings and Sublime Build Systems. I'll be making all of those available soon (hopefully this week).

  5. 5 Posted by ioa on 13 Sep, 2011 06:01 AM

    ioa's Avatar

    Indeed, and further there is no need to type all of that in every time. Most UNIX shells allow you to alias longer commands to shortcuts. Try typing in $ alias marked="open -a Marked" as a command, then $ marked some_file.md to test.

    If you want to keep an alias around between sessions, add it to your .profile (create if it doesn't exist; each line should be seen as a command you type in which will be executed automatically whenever you start a Terminal session).

  6. 6 Posted by Kris on 13 Sep, 2011 11:24 AM

    Kris's Avatar

    Well, then this marks the 1,000,000th time that I've forgotten about open -a. It's a tough pill to swallow because I must use open 10x/day. Thanks!

  7. Support Staff 7 Posted by Brett on 13 Sep, 2011 12:14 PM

    Brett's Avatar

    I think we'll leave it at that for now, then :).

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