clj-commons / marginalia

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

Naive solution to #81 #171

Closed seancorfield closed 6 years ago

seancorfield commented 6 years ago

This works for docstrings that are flush left or indented two spaces, which should be the two common cases. The naivety is in assuming that a newline followed by a non-whitespace character indicates flush left, and also that it is safe to just strip the first two spaces off each line of the docstring. It's as safe as some of the other text manipulation Marginalia does :)

Caveat: If a docstring is indented three spaces (per example 2 in my comment on #81) then they'll be unaffected by this change (and they'll still get the weird formatting they got before!).