Skip to content

Commit

Permalink
Change how docstring is formatted in ClojureDocs buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
katomuso authored and bbatsov committed Jun 4, 2024
1 parent 0916372 commit c8c4381
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cider-clojuredocs.el
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ opposite of what that option dictates."
(let ((arglists (nrepl-dict-get dict "arglists")))
(dolist (arglist arglists)
(insert (format " [%s]\n" arglist)))
(insert "\n")
(insert (nrepl-dict-get dict "doc"))
(insert "\n"))
(when-let* ((doc (nrepl-dict-get dict "doc"))
;; As this is a literal docstring from the source code and
;; there are two spaces at the beginning of lines in docstrings,
;; we remove them to make it align nicely in ClojureDocs buffer.
(doc (replace-regexp-in-string "\n " "\n" doc)))
(insert "\n" doc "\n")))
(insert "\n== See Also\n\n")
(if-let ((see-alsos (nrepl-dict-get dict "see-alsos")))
(dolist (see-also see-alsos)
Expand Down

0 comments on commit c8c4381

Please sign in to comment.