ANN: lein-midje-doc 0.0.9 released

230 views
Skip to first unread message

zcaudate

unread,
Sep 23, 2013, 12:22:08 AM9/23/13
to clo...@googlegroups.com
Hi Everyone.

I've just pushed a new documentation library for midje tests to clojars. Its very experimental and a bit of a hack but I'm finding it super useful. Hope to get some feedback on this library.


Generated Documentation - http://z.caudate.me/lein-midje-doc/


Chris

zcaudate

unread,
Sep 23, 2013, 3:05:24 AM9/23/13
to clo...@googlegroups.com
Ooops! Really sorry guys. the resource directory was not included in the v0.0.9 jar file... it is now fixed in v0.0.10.

lein-midje-doc

lein-midje-doc fixes the problem of incorrectly documented examples by bridging the gap between writing tests and writing documentation.

Features:

  1. To generate .html documentation from a .clj test file.
  2. To express documentation elements as clojure datastructures.
  3. To render clojure code and midje facts as code examples.
  4. To allow tagging of elements for numbering and linking.

Benefits:

  1. All documentation errors can be eliminated.
  2. Removes the need to cut and copy test examples into a readme file.
  3. Entire test suites can potentially be turned into nice looking documentation with relatively little work.

Timothy Washington

unread,
Oct 12, 2013, 10:16:40 AM10/12/13
to clo...@googlegroups.com
This library looks great, and I'm eager to try it out in one of my new projects, which uses [midje "1.5.1"] (and my profile.clj is below). But, in a new project, I just ran `lein midje-doc`, and I'm getting a RuntimeException in one of the 3rd party libraries. I've attached a log file with the stacktrace. Any ideas on overcoming this? 


java.lang.RuntimeException: No such var: seq/map-nth, compiling:(me/raynes/conch.clj:196:12)
    at clojure.lang.Compiler.analyze(Compiler.java:6380)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3573)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    ...
    at clojure.core$load_libs.doInvoke(core.clj:5413)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:619)
    at clojure.core$require.doInvoke(core.clj:5496)
    at clojure.lang.RestFn.invoke(RestFn.java:436)
    at leiningen.midje_doc.renderer$eval19$loading__4910__auto____20.invoke(renderer.clj:1)
    at leiningen.midje_doc.renderer$eval19.invoke(renderer.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6619)
    ...
fig.1 


~/.lein/profile.clj

{:user
 {:plugins [
            [lein-marginalia "0.7.1"]
            [lein-midje "3.1.1"]
            [lein-midje-doc "0.0.13"]]
  :dependencies []
  :repl-options {}}} 
fig.2 


Tim Washington 

midje-doc.out

zcaudate

unread,
Oct 13, 2013, 5:58:35 AM10/13/13
to clo...@googlegroups.com
Hi Tim.

That is a strange message. I am using conch to shell out to pygments which does the syntax highlighting. I'm not sure why that library is not compiling. What operating system are you using?

zcaudate

unread,
Oct 13, 2013, 6:01:05 AM10/13/13
to clo...@googlegroups.com
Also.. What version of clojure are you using? I'll try with that and see if I can reproduce the error.

Timothy Washington

unread,
Oct 13, 2013, 6:31:19 AM10/13/13
to clo...@googlegroups.com
Hi Chris, 


A) My dev environment is in a VMWare guest Ubuntu Linux Server 12.04.3 (on an OSX Host). B) My project's clojure version is 1.5.1. And C), I have the latest version of pygments installed via apt-get. But I don't think those are the causes. 

That top-level error with the seq/map-nth function is in the useful lib, used by conch, used by lein-mdije-doc. I presume that the version of useful doesn't have that particular function. Now, when using the lein-midje-doc plugin, the versions of useful that get pulled down, are 0.8.3-alpha8 and 0.8.5-alpha2. However, the latest version on Clojars is 0.8.8. Maybe using the latest version of conch will help. Your tool seems to use 0.5.0. But the latest version is 0.5.2.


Tim Washington 


On Sun, Oct 13, 2013 at 6:01 AM, zcaudate <z...@caudate.me> wrote:
Also.. What version of clojure are you using? I'll try with that and see if I can reproduce the error.

--
--

Chris Zheng

unread,
Oct 13, 2013, 5:03:59 PM10/13/13
to clo...@googlegroups.com
Hi Tim.

I think you've most likely identified the issue. Would you be able to give that a go and see if it is working? You can clone the lein midje doc repo, change the versions and run lein install. 

Please let me know how it goes.

Chris
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/hiX7QrTec3A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Timothy Washington

unread,
Oct 13, 2013, 5:43:26 PM10/13/13
to clo...@googlegroups.com
In a locally cloned lein-midje-doc project, I set the conch lib to the latest version, [me.raynes/conch "0.5.2"]. But the same error is happening for me. 

You'll probably have to dig into the dependency chain, and see where the broken link is. 


Tim Washington 


Chris Zheng

unread,
Oct 13, 2013, 6:05:50 PM10/13/13
to clo...@googlegroups.com
Hi Tim,

Its really difficult for me to figure out what is happening because I can't reproduce the error.

The only solution I can think of is to put in the newest useful library:

In project.clj:
1. add dependency [org.flatland/useful "0.10.4"]

2. change project version: [lein-midje-doc "0.0.13a"]

3. run lein install

4. change your profile to use "0.0.13a"

and see what happens. If that doesn't work… I'm actually out of ideas and all I can do is log an issue with raynes.

Timothy Washington

unread,
Oct 13, 2013, 6:54:27 PM10/13/13
to clo...@googlegroups.com
Hmm, 

Did all those things (except the latest useful version is [useful "0.8.8"]), and still getting the same "seq/map-nth" error. Dunno. Best thing I can think of is to i) try a clean install of the relevant lein tools in your syste, or ii) log an issue with Raynes. Maybe other people have come across this. 


Hth 

Tim Washington 

--

Chris Zheng

unread,
Oct 13, 2013, 7:55:19 PM10/13/13
to clo...@googlegroups.com
Hey Tim,

Try using [org.flatland/useful "0.10.4"] instead. I think they're starting to use the namespaced versions.


Timothy Washington

unread,
Oct 13, 2013, 11:04:47 PM10/13/13
to clo...@googlegroups.com
Same error. I dunno. I'll take deeper dig later on. 


Thanks 

Tim Washington 


zcaudate

unread,
Oct 15, 2013, 4:56:01 PM10/15/13
to clo...@googlegroups.com
Hi Tim.

I've lodged the issue with Raynes here:
https://github.com/Raynes/conch/issues/7

Chris.

zcaudate

unread,
Oct 15, 2013, 4:56:03 PM10/15/13
to clo...@googlegroups.com

Timothy Washington

unread,
Oct 16, 2013, 8:48:56 AM10/16/13
to clo...@googlegroups.com
Oh nice one. I saw where Raynes responded pretty quickly. That's awesome. Let me know when I can retry lein-midje-doc. It would very cool to have that functionality. 


Tim Washington 


zcaudate

unread,
Oct 16, 2013, 8:15:49 PM10/16/13
to clo...@googlegroups.com
okay... 0.0.15 is up

Timothy Washington

unread,
Oct 20, 2013, 1:50:53 PM10/20/13
to clo...@googlegroups.com
Sweet. Got this up and running. Just as a heads up, section 1.2 "Generating from Source", is where I'm still getting that "seq/map-nth" Exception. But I went a but further and tried section 1.4, "Usage". And after some config, I was able to get it working. I just bring it up as it might stymie other new users. But I can't wait to dig in. Thanks for all your hard work. 


Cheers 

Tim Washington 


Reply all
Reply to author
Forward
0 new messages