Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI #2

Closed
neocotic opened this issue Dec 4, 2012 · 5 comments
Closed

CLI #2

neocotic opened this issue Dec 4, 2012 · 5 comments

Comments

@neocotic
Copy link
Owner

neocotic commented Dec 4, 2012

Add a new command line interface which works using stdin and stdout while supporting option flags.

For example;

$ md < index.html
# Example

Welcome to this example page. 
$ md "<strong>foo</strong>"
**strong**
$ echo "<em>bar</em>" | md
_bar_
@skopp
Copy link

skopp commented Dec 5, 2012

Ref: Twitter conversation - I'm the hairy, unshaven, musk smelling author of that tweet. I bring peanuts, malt drinks and an offer to help. So, where to cap'n?

Is there an existing CLI?

neocotic added a commit that referenced this issue Dec 6, 2012
@neocotic
Copy link
Owner Author

neocotic commented Dec 7, 2012

This issue is dependant on the completion of the following;

On top of that, a whole new CLI system needs to be added as this is entirely new functionality (1.0.0 only worked in the browser). I've added the initial infrastructure for the CLI and bin/md now contains the beginnings of a CLI (options already support, just need to add the logic and processing).

Here's the current usage design;

md [options] [ -e html | file.html ] [arguments]

Available options:
  -d, --debug          print additional debug information
  -e, --eval           pass a string from the command line as input
  -h, --help           display this help information
  -l, --long-ext       use long extension for Markdown files
  -o, --output [DIR]   set the output directory for converted Markdown
  -p, --print          print out the converted Markdown
  -v, --version        display the version number

Hopefully, it's pretty self-explanatory. If not, let me know so I can maybe add some examples to the usage output. No-args should print the usage descriptor (not yet implemented).

I may get this to a ready and working state quite soon, but I really would like to write a complete unit test suite (#3) before releasing 1.1.0 as there are currently no tests. I've already created the test infrastructure but I need to write the actual tests.

I'm hoping to complete this over the weekend if I can get a break from building shelves. I'm not sure if there's much to help with right now as I've got quite a clear picture of what needs doing in my head. However, if you have a good idea too, please feel free to fork and submit a pull request. Thanks for you keen interest and light-hearted musings.

Finally, I'll need to take some time to fill README.md with lots of useful content so that users can easily pick up and use this library.

neocotic added a commit that referenced this issue Dec 7, 2012
@skopp
Copy link

skopp commented Dec 7, 2012

I tl'dr'd because I've got to finish some work, so I saw coffeescript..by
weekend,, musings. You're welcome. I'm excited about this, you should be
too as if you search, you will not easily find an html2md parser (I was
referred to you after several bar fights, you know the ones where you break
a pool cue and hells angels dudes come at you one at a time. And the
bouncers egg the fight on. Etc. There are so many md2html parsers that you
could get sick/dizzy just looking at the list.

Reason I mentioned that (tldr thing) is I honestly have not yet dug into
this... but when I do, I will... properly. And you have your idea, no
problem - believe me we won't be doing double work as I've got extensions
to the broader idea which I am working towards. Think of this: how many
productivity apps are there out there? Exactly.

On Fri, Dec 7, 2012 at 11:13 AM, Alasdair Mercer
notifications@github.comwrote:

This issue is dependant on the completion of the following;

On top of that, a whole new CLI system needs to be added as this is
entirely new functionality (1.0.0 only worked in the browser). I've added
the initial infrastructure for the CLI and bin/md now contains the
beginnings of a CLI (options already support, just need to add the logic
and processing).

Here's the current usage design;

md [options] [ -e html | file.html ] [arguments]

Available options:
-d, --debug print additional debug information
-e, --eval pass a string from the command line as input
-h, --help display this help information
-l, --long-ext use long extension for Markdown files
-o, --output [DIR] set the output directory for converted Markdown
-p, --print print out the converted Markdown
-v, --version display the version number

Hopefully, it's pretty self-explanatory. If not, let me know so I can
maybe add some examples to the usage output. No-args should print the usage
descriptor (not yet implemented).

I may get this to a ready and working state quite soon, but I really would
like to write a complete unit test suite (#3#3)
before releasing 1.1.0 as there are currently no tests. I've already
created the test infrastructure but I need to write the actual tests.

I'm hoping to complete this over the weekend if I can get a break from
building shelves. I'm not sure if there's much to help with right now as
I've got quite a clear picture of what needs doing in my head. However, if
you have a good idea too, please feel free to fork and submit a pull
request. Thanks for you keen interest and light-hearted musings.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-11123448.

@neocotic
Copy link
Owner Author

I've updated the README so it's really just the unit testing holding everything up. I'm about half-way through the core tests and I'm hoping to reuse them for testing the CLI as much as possible, though I'm not entirely sure what's the best way to test CLI in node.js so I might look at how other projects have achieved this.

@skopp
Copy link

skopp commented Dec 10, 2012

I'll have a look (nodejs is fussy with cli's but python+bash are only limited by your imagination. And their limits)
Regards, MR Essop

-----Original Message-----
From: Alasdair Mercer notifications@github.com
Date: Mon, 10 Dec 2012 08:28:02
To: neocotic/html.mdhtml.md@noreply.github.com
Reply-To: "neocotic/html.md" reply@reply.github.com
Cc: skoppskopp888@gmail.com
Subject: Re: [html.md] CLI (#2)

I've updated the README so it's really just the unit testing holding everything up. I'm about half-way through the core tests and I'm hoping to reuse them for testing the CLI as much as possible, though I'm not entirely sure what's the best way to test CLI in node.js so I might look at how other projects have achieved this.


Reply to this email directly or view it on GitHub:
#2 (comment)

neocotic added a commit that referenced this issue Dec 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants