thomas11 / md-readme

Generate Markdown-formatted READMEs from your Emacs Lisp file headers.
15 stars 10 forks source link

Add bin/md-readme for Cask? #4

Closed NateEag closed 9 years ago

NateEag commented 9 years ago

The sample Makefile shows one way to render a targeted file.

Cask offers a mechanism for running commands defined by emacs packages - commands included in a package's bin/ directory can be run with cask exec <command-name>.

If we put the following in bin/md-readme:

#! /bin/sh

exec "$EMACS" -batch "$@" -l md-readme -f mdr-generate

then any project that lists md-readme as a dev dependency in its Caskfile can render its readme by just running

cask exec md-readme <target-file>

Would you accept a PR to add that command to the package?

thomas11 commented 9 years ago

Hi NateEag,

thanks for your suggestions! Cask sounds neat. I hadn't heard of it before.

How would Cask know of md-readme and how would other projects depend on it? Wouldn't we first have to package md-readme somehow? I must admit that although I use list-packages with Melpa I've never looked into it for my own projects.

NateEag commented 9 years ago

Cask sources dependencies via package.el - if you can install a package that way, you can declare it as a dependency in Cask.

I currently have a project using md-readme in development with the following Caskfile:

(source gnu)
(source melpa)

(development
 (depends-on "buttercup")
 (depends-on "markdown-mode")
 (depends-on "md-readme"))

so someone must have already submitted a recipe for md-readme to MELPA.

I've tested the script I posted in my project, and it works.

So, all Cask needs for this to work is that script in bin/md-readme.

thomas11 commented 9 years ago

Sounds good! Open a PR?

Thanks!

NateEag commented 9 years ago

yep, sorry - was going to do that when I added the comment, but then real life got in the way. It's here now.