Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Javadocs in your REPL

License

NotificationsYou must be signed in to change notification settings

clojure/java.doc

Repository files navigation

A Clojure library for accessing Javadocs in your REPL

Installation

deps.edn

{:deps {org.clojure/java.doc {:git/url"https://github.com/clojure/java.javadoc":git/sha"b534b707270836fecc2f268ee6adf1c7a986d4f7"}}}

In the REPL with add-libs

For usage without modifying your project deps:

;; This require is only necessary if not in user namespace(require '[clojure.repl.deps:refer [add-lib]])(add-lib 'io.github.clojure/java.doc {:git/sha"b534b707270836fecc2f268ee6adf1c7a986d4f7"})(require '[clojure.java.doc.api:refer [jdoc jdoc-data sigs]]);; Now you can use it(jdoc String)

From the Command Line

Invoke directly from the command line, useful for piping into a .md file to display in your editor:

clojure -Sdeps'{:deps {org.clojure/java.doc {:git/url "https://github.com/clojure/java.doc" :git/sha "b534b707270836fecc2f268ee6adf1c7a986d4f7"}}}' \  -M -e"(require '[clojure.java.doc.api :refer [jdoc]]) (jdoc String)"

Usage

The core namespace provides three functions:

jdoc

Print Javadoc HTML as Markdown for a class or qualified method (with optional param-tags).

(require '[clojure.java.doc.api:refer [jdoc jdoc-data sigs]]);; Print class description(jdoc String);; Print all overloads of a method(jdoc String/valueOf);; Specify a specific overload using param-tags(jdoc ^[char/1] String/valueOf);; Use _ to match any type:(jdoc ^[_ int] String/.substring)

sigs

Print method signatures in qualified method syntax with param tags.

(sigs String/valueOf);; => ^[boolean] String/valueOf;;    ^[char] String/valueOf;;    ^[char/1] String/valueOf;;    ^[char/1 int int] String/valueOf;;    ^[double] String/valueOf;;    ^[float] String/valueOf;;    ^[int] String/valueOf;;    ^[long] String/valueOf;;    ^[Object] String/valueOf

jdoc-data

Returns all the structured data instead of printing the description.

(jdoc-data String);; => {:classname "java.lang.String";;     :class-description-html "...";;     :class-description-md "...";;     :methods [{:signature "valueOf(int i)";;                :description "Returns the string representation...";;                :static? true;;                :clojure-call "^[int] String/valueOf"};;               ...]}(jdoc-data ^[char/1] String/valueOf);; => {:classname "java.lang.String";;     :class-description-html "...";;     :class-description-md "...";;     :methods [...];;     :selected-method [{:signature "valueOf(char[] data)";;                        :description "Returns the string representation...";;                        :static? true;;                        :clojure-call "^[char/1] String/valueOf";;                        :method-description-html "...";;                        :method-description-md "..."}]}

Requirements

  • Java 17+

Copyright and License

Copyright © 2025

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Javadocs in your REPL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp