marky-markdown icon indicating copy to clipboard operation
marky-markdown copied to clipboard

[WIP] Add more robust CLI that provides rendering options

Open knksmith57 opened this issue 9 years ago • 8 comments

Exposes parse options to the CLI utility giving users a bit more control about how HTML is rendered.

Made use of @bcoe's yargs package for the heavy lifting (figured this would make y'all more likely to accept the PR :wink:). This does add another dependency to the package, but IMHO it's worth the extra weight to make the CLI much more usable.

Cheers!

knksmith57 avatar Jan 28 '16 23:01 knksmith57

niiiice

zeke avatar Jan 29 '16 04:01 zeke

If you want to add tests to this, I have a few ideas: You could use sinon to spy on the marky function and ensure the right options are being passed, or you could use nixt to actually run CLI commands and verify their stdout output.

zeke avatar Jan 29 '16 04:01 zeke

Oooh I like this. At the very least it'll make my own testing easier 😉

revin avatar Jan 29 '16 17:01 revin

yarrrrgs \o/ If you decide to add some tests for the CLI behavior, here's the approach we use in the yargs codebase itself:

https://github.com/bcoe/yargs/blob/master/test/integration.js

we use this along with:

https://github.com/bcoe/nyc

Which gives good code coverage for subprocesses.

bcoe avatar Jan 29 '16 18:01 bcoe

hey @knksmith57 this is super awesome! would love to get some tests for this before merging tho, as well as some docs in the readme. lemme know if you want any help! thanks for doing this :)

ashleygwilliams avatar Jan 30 '16 19:01 ashleygwilliams

Hey All,

Thanks for the feedback! I'll jam on some test cases and docs and update the PR once I've got something worth looking at.

knksmith57 avatar Jan 30 '16 23:01 knksmith57

hey @knksmith57 just wanted to say that we are all still really excited about this. let us know if you want any help :space_invader:

ashleygwilliams avatar Feb 08 '16 15:02 ashleygwilliams

Hey @ashleygwilliams! Sorry for the radio silence :disappointed:

I pulled in all of the great work y'all have been doing since I opened the PR and then refactored a bit to make the CLI portion easier to test. I've never tested integration between a CLI wrapper & main module before so definitely looking for feedback on this (maybe it's totally wrong!)

Maybe @bcoe could chime in when he has a chance to see if this is a decent / terrible pattern for testing CLIs that use yargs?

Thanks team! Looking forward to jamming on this and getting it shipped :smiley:

knksmith57 avatar Mar 20 '16 03:03 knksmith57