Skip to content

Commit ff4c0ed

Browse files
jpmonettasbbatsov
authored andcommitted
Add a section in the manual for the spec browser
1 parent de973bd commit ff4c0ed

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

doc/images/spec_browser.png

72.2 KB
Loading

doc/images/spec_browser_all.png

127 KB
Loading
153 KB
Loading

doc/miscellaneous_features.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,36 @@ Keyboard shortcut | Description
193193
<kbd>n</kbd> | Go to next line.
194194
<kbd>p</kbd> | Go to previous line.
195195

196+
## Spec browser
197+
198+
If you are using Clojure 1.9.0-alpha16 or newer you can browse the Clojure specs registry.
199+
200+
If you know what you are looking for, you can type <kbd>M-x</kbd> `cider-browse-spec`.
201+
It will prompt you for a spec name to browse to, hit <kbd>RET</kbd> and you will find yourself
202+
at the spec browser.
203+
204+
![Spec Browser](images/spec_browser.png)
205+
206+
You can also type the command <kbd>M-x</kbd> `cider-browse-spec-all`. This command will prompt you for
207+
a regex you can use to filter out the specs you are interested in, and will also take you to the spec browser.
208+
209+
![Spec Browser](images/spec_browser_all.png)
210+
211+
Once in the browser you can use your mouse or the keybindings below to navigate deeper into sub specs.
212+
213+
Keyboard shortcut | Description
214+
--------------------------------|-------------------------------
215+
<kbd>RET</kbd> | Browse the spec at point.
216+
<kbd>^</kbd> | Go up in the navigation stack.
217+
<kbd>n</kbd> | Go to next spec.
218+
<kbd>p</kbd> | Go to previous spec.
219+
<kbd>e</kbd> | Generate an example for the current browser spec.
220+
221+
If your project contains a version of `org.clojure/test.check`, you can type <kbd>e</kbd> when browsing
222+
a spec to generate and print an example of it.
223+
224+
![Spec Browser Example](images/spec_browser_gen_example.png)
225+
196226
## Documentation buffers include "See Also" references
197227

198228
You can add references to other vars by including their names in `` ` `` in the docstring.

0 commit comments

Comments
 (0)