Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClojureDocs formatting tweaks #3701

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions cider-clojuredocs.el
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,22 @@ 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)
(insert-text-button (format "* %s\n" see-also)
(insert "* ")
(insert-text-button see-also
'sym see-also
'action (lambda (btn)
(cider-clojuredocs-lookup (button-get btn 'sym)))
'help-echo (format "Press Enter or middle click to jump to %s" see-also)))
'help-echo (format "Press Enter or middle click to jump to %s" see-also))
(insert "\n"))
(insert "Not available\n"))
(insert "\n== Examples\n\n")
(if-let ((examples (nrepl-dict-get dict "examples")))
Expand Down
Loading