Skip to content

A simple popup to show function and namespace docstrings at point

Notifications You must be signed in to change notification settings

MicahElliott/clojure-docs-peek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Clojure-Docs Peek (CDP)

A simple popup to show colorized docstrings above point, for any function and resolved namespace. Also shows some basic summary statistics for functions and namespaces.

Non-local function (showing namespace) with see-also

Caption: Point sitting on non-local function, showing colorized and resolved namespace, function name, parameters, docstring, and optional see-alsos.

You can see in the screenshots that the gray box is quick-peek at work inserting the documentation as an overlay.

This is a lot like cider-clojuredocs but:

  • is lighter in that it only shows a bare minimum of info (no examples)

  • keeps you from switching to docs or source buffers to hunt for info

  • shows docstrings for even your own functions and namespaces, encouraging you to add more of them!

  • enables using shorter namespace aliases since their resolution is right at your fingertips

Installation

Install the dependencies:

Note: Cider is a huge dependency, but it is assumed that you've already bought into that. quick-peek is tiny and has none.

(add-to-list 'load-path "path to your clone of this")
(require 'clojure-docs-peek)

Usage

Invoke clojure-docs-peek-toggle to open and close the peek.

Use universal argument (prefix C-u) to include See also section.

I use this constantly and like to bind this to be really quick and easy to use, so it's CD (as a key-chord):

(key-chord-define-global "CD" 'clojure-docs-peek-toggle)

More Screenshots

Local function (no namespace)

Namespace

Beyond

I'm sure this could be altered to depend on LSP rather than Cider.

Please let me know in a ticket if you have more ideas for getting other clojure documentation into popups.

About

A simple popup to show function and namespace docstrings at point

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published