Skip to content

Commit 16b2107

Browse files
yuhan0bbatsov
authored andcommitted
Update documentation for xref regexp
1 parent 1cd7d8c commit 16b2107

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
### Changes
1414

15-
* [#2731](https://github.com/clojure-emacs/cider/pull/2731): Make the in-buffer debugging menu customizable via `cider-debug-prompt-commands`.
15+
* [#2731](https://github.com/clojure-emacs/cider/pull/2781): Extend `cider-doc-xref-regexp` to recognize `[[var]]` syntax and fully qualified symbols as xref links in cider-doc buffers. [#2731](https://github.com/clojure-emacs/cider/pull/2731): Make the in-buffer debugging menu customizable via `cider-debug-prompt-commands`.
1616

1717
### Bugs fixed
1818

doc/modules/ROOT/pages/usage/misc_features.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,10 @@ image::spec_browser_gen_example.png[Spec Browser Example]
281281

282282
Sometimes in your documentation strings, you'd like to be able to
283283
point other programmers at different definitions. If you specify the
284-
name of a definition in backticks (```), CIDER will convert these
285-
references into live links when it displays the documentation string
286-
in the documentation buffer.
284+
name of a definition as a fully qualified symbol, or surround it in
285+
backticks (`++`...`++`) or Codox-style delimiters (`+[[...]]+`), CIDER
286+
will convert these references into live links when it displays the
287+
documentation string in the documentation buffer.
287288

288289
If the name is in another namespace, then you'll have to include the
289290
fully qualified name in the docstring.
@@ -293,23 +294,22 @@ Example function with a docstring containing references:
293294
----
294295
(defn test-fn
295296
"Test function.
296-
Also see: `clojure.core/map`, `clojure.core/reduce`, `defn`.
297-
You can reference variables like `thor`, `kubaru.data.zookeeper/yoda`.
297+
Also see: clojure.core/map, clojure.core/reduce, `defn`.
298+
You can reference variables like `thor`, [[kubaru.data.zookeeper/yoda]].
298299
Also works with references to java interop forms, `java.lang.String/.length`."
299300
[]
300301
(+ 1 1))
301302
----
302303

303304
You can change the delimiters that CIDER uses to find references if
304-
you don't like using backticks. Simply update the regexp in
305+
you want to support other reference formats. Simply update the regexp in
305306
`cider-doc-xref-regexp` to match your preferred format. The first
306307
group of the regexp should always match the cross-reference name. For
307-
example, if you want to want to use
308-
https://github.com/weavejester/codox[Codox's] delimiter style
309-
(`+[[...]]+`) instead of backticks, the regexp would be:
308+
example, if you want to want to use Latex-style references
309+
(`+\ref{...}+`) instead, the regexp would be:
310310

311311
----
312-
(setq cider-doc-xref-regexp "\\[\\[\\(.*?\\)\\]\\]")
312+
(setq cider-doc-xref-regexp "\\\\ref{\\(?1:[^}]+\\)}")
313313
----
314314

315315
image::cider_see_also.gif[CIDER See Also]

0 commit comments

Comments
 (0)