clj-commons / marginalia

Ultra-lightweight literate programming for clojure inspired by docco
https://clj-commons.org/marginalia/
824 stars 82 forks source link

ns parse fails if doc-able thing falls immediately after #6

Closed fogus closed 13 years ago

fogus commented 13 years ago

This will generate proper docs:

(ns foo.bar
  "This is a ns docstring"
  {:author "Fogus"})

(defprotocol Foo
  "This is a proto docstring"
  (foo [this]))

This will fail to gen proper docs:

(ns foo.bar
  "This is a ns docstring")

(defprotocol Foo
  "This is a proto docstring"
  (foo [this]))

The problem is that the parser assume that the doc-able thing has some sort of body after the doc, but that is not always the case for ns.

budu commented 13 years ago

This is fixed with the new parser. By the way, I didn't even knew protocols could take docstrings!

fogus commented 13 years ago

They can also take docstrings in the function sigs: (foo [this] "a docsstring goes here")

budu commented 13 years ago

Yes, I knew about that tough. These will be left in the code panel and I'm not sure there's a way to fix that. I've also found out a small problem with the new parser, multimethods will all have the defmulti docstring, I'm looking into how to fix that.