Skip to content

podviaznikov/lein-instant-cheatsheet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lein-instant-cheatsheet

Clojars Project

Dependencies Status Circle CI

Instant Cheatsheet instantly creates a cheatsheet for your project and its dependecies.

  1. Add lein-instant-cheatsheet to your Leiningen :plugins
  2. Start the webserver with lein instant-cheatsheet

Instant Cheatsheet spins up a Ring server at localhost:13370 and automatically reloads documentation whenever a Clojure file in your project changes.

Screenshot

Instant Cheatsheet has a few features that might just make it your go-to Clojure reference:

Symbol Filtering

Instant Cheatsheet has a built-in filter bar at the top to search for matching symbols. A list of matching symbols and their namespaces appears on the left side of the screen; documentation for those symbols appear on the right. You can also see documentation in a tooltip by hovering over symbols on the left, and you can see source code (if available) by hovering over the source links on the right. You can also search for examples from ClojureDocs by clicking the examples link.

Filtering Based on GET Params

Instant Cheatsheet will automatically use the GET parameter q as an initial value for the filter bar. That means a request like http://localhost:13370/#?q=print will automatically search for symbols containing print.

Markdown Support

Like Marginalia, Instant Cheatsheet parses docstrs as Markdown. Add examples, links, and more to your documentation!

Emacs Keybinding

You can create an Emacs function to search Instant Cheatsheet, and even bind it to a keyboard shortcut:

(defun instant-cheatsheet-search (search-term)
  "Opens Instant Cheatsheet in a new browser tab and searches for SEARCH-TERM."
  (interactive "sSearch Instant Cheatsheet for: ")
  (browse-url
   (concat "http://localhost:13370/#?q="
           (url-hexify-string search-term))))

(define-key clojure-mode-map (kbd "<f12> i") #'instant-cheatsheet-search)
(define-key cider-repl-mode-map (kbd "<f12> i") #'instant-cheatsheet-search)

Hitting <f12> i will prompt you for a search term and open a new browser tab with that term as the initial filter text.

Changelog

  • 2.1.4 (April 14th, 2015)
    • Fix issue where cheatsheet would appear empty on launch. (#1)
    • Fix conflicts if target project had resources named app.js. (#2)
  • 2.1.3 (April 1st, 2015)
    • Fix issue where instant-cheatsheet would fail to launch in projects that did not have a :main class defined
  • 2.1.1 (March 31st, 2015)
    • Fix overflowing left-hand symbols list
    • Add custom source reader that works in cases clojure.repl/source-fn does not
    • Strip docstrings from source
  • 2.1.0 (March 30th, 2015)
    • Automatically reload documentation from files that have changed since last API call
  • 2.0.0 (March 13th, 2015)
  • 1.5.0 (Feb 4th, 2015)
  • 1.0.0 (April 5th, 2013)

About

Instant Cheatsheet is inspired by other excellent Clojure cheatsheets like this one.

Instant Cheatsheet was built with Hiccup, Bootstrap, and AngularJS.

About

Leiningen plugin that generates a cheatsheet for your Clojure project and dependencies

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 80.6%
  • JavaScript 13.4%
  • CSS 6.0%