docs

About docs of Clojure & libs
martinklepsch 2018-01-11T10:23:58.000065Z

can someone think of a project that makes exemplary use of codox (i.e. usage of doc/) and also tags releases on github?

genmeblog 2018-01-11T11:35:09.000046Z

why tags are needed?

martinklepsch 2018-01-11T11:36:13.000374Z

@tsulej I’m working on a tool that may utilise tags — unfortunately tagging releases doesn’t seem to be a very common thing 😕

genmeblog 2018-01-11T11:36:25.000473Z

true

martinklepsch 2018-01-11T11:36:39.000014Z

(which I believe is unfortunate on it’s own, not just because I need it 🙂)

genmeblog 2018-01-11T19:25:21.000575Z

I don't tag releases too... still working on snapshots. However I started to enhance my documentation with examples in metatags. Examples can be run during doc generation. I can also generate images from examples. Since in codox I can't run my code snippets all process looks like: metadata -> alter :doc tag from info (examples) in tags -> image generation -> codox

genmeblog 2018-01-11T19:28:01.000207Z

whole examples part is generated from metadata

genmeblog 2018-01-11T19:30:31.000339Z

(defn point
  "Draw point at `x`,`y` or `^Vec2` position.
  It's implemented as very short line. Consider using `(rect x y 1 1)` for speed when `x` and `y` are integers."
  {:examples [(ex/example-gen-image "Sequence of points."
                (doseq [x (range 10 159 10)] (point canvas x x)))
              (ex/example-gen-image "Magnified point can look differently when different stroke settings are used."
                (-> canvas
                    (scale 80.0)
                    (set-stroke 0.5)
                    (point 0.5 0.5)
                    (set-stroke 0.5 BasicStroke/CAP_SQUARE BasicStroke/JOIN_MITER)
                    (point 1.5 1.5)))]}
  ([canvas ^double x ^double y]
   (line canvas x y (+ x 10.0e-6) (+ y 10.0e-6))
   canvas)
  ([canvas ^Vec2 vec]
   (point canvas (.x vec) (.y vec))))

genmeblog 2018-01-11T19:46:20.000371Z

it's just poc

genmeblog 2018-01-11T19:46:50.000744Z

quick and dirty code https://github.com/Clojure2D/clojure2d/blob/master/src/meta_doc/core.clj

martinklepsch 2018-01-11T20:03:30.000383Z

@tsulej that’s interesting to see, thanks for sharing!