marginalia icon indicating copy to clipboard operation
marginalia copied to clipboard

Allow a header doc

Open fogus opened this issue 14 years ago • 2 comments

Marg currently processes each file in turn generating the docs in order. However, it would be nice to allow the specification of a documentation header that is always placed at the top of the documentation. This could be a license statement, logo, manifesto, etc. I'm not sure how this would look at the moment, so any suggestions are welcomed.

fogus avatar Jul 14 '11 12:07 fogus

I recently started looking at Marg, and this is one of the things I greatly miss.

Wouldn't it be possible to (re)use the :main ns in project.clj for this purpose? And instead of putting the file comments in the ns specified by :main into it's own block, it'd be moved to the top, just below "namespaces" ?

So one could have a project.clj like the following:

(defproject example "0.0.0-SNAPSHOT"
  :description "An example project"
  :dev-dependencies [[lein-marginalia "0.6.0"]]
  :main example.core
)

And in src/example/core.clj:

;; ## An Example project
;;
;; Blah blah blah....

(ns example.core)

(defn say-hello "Says 'Hello!'" [] (println "Hello!"))

And this would result in src/example/core.clj's file header being used as the header doc.

algernon avatar Aug 11 '11 12:08 algernon

I would include README.md at the top. In place of text "(this space intentionally left almost blank)"

tsulej avatar Jun 22 '16 08:06 tsulej