最先进的 Clojure 文档工具

发布于 2024-10-22 03:06:24 字数 1539 浏览 10 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ぽ尐不点ル 2024-10-29 03:06:24

如果你想采用文学编程方法之类的东西,我真的很喜欢 Marginalia 。 Marginalia 遍历您的源代码,并生成 html 格式的版本,并以非常清晰的文本在代码旁边设置注释。注释可以采用 Markdown 格式,从而形成非常易读的最终文档。当回顾我前段时间编写的源代码时,我发现 Marginalia 确实很有帮助。 这是一个由 Marginalia 源本身制作的示例

请注意,这与原始的文学编程工作流程不同,在原始编程工作流程中,您将编写一个文件并从中生成源代码。使用 Marginalia,您可以编写一个常规源代码文件,然后从中提取文档。输出与人们对文学编程的预期类似,但通过这种方式,您仍然可以在编辑器中期望语法突出显示,而无需任何特殊的文学编程支持。

它与 Leiningen 互操作,我相信蛋糕,尽管我自己没有尝试过。

I really like Marginalia if you want to take something like a literate programming approach. Marginalia traverses your source code, and produces an html formatted version with comments set beside code in a very clear text. Comments can be markdown formatted, making for a very readable final document. When reviewing source code that I've written some time ago, I find Marginalia really helps. Here's an example made from the Marginalia source itself.

Note that this differs from the original literate programming workflow, where you would write a file and source code is generated from that. With Marginalia, you write a regular source code file, and it's the documentation that's pulled out of that. The output is similar to what one might expect from literate programming, but this way you can still expect syntax highlighting in an editor, without any special literate programming support.

It interoperates with Leiningen, and I believe cake, though I haven't tried that myself.

宣告ˉ结束 2024-10-29 03:06:24

Codox 是 Clojure 的最新文档生成器。

Codox is a more recent documentation generator for Clojure.

羅雙樹 2024-10-29 03:06:24

Autodoc 是一个简单的起点,也是 Clojure 核心 和 Clojure contrib 生产。

易于与 Maven 一起使用。我不确定 Leiningen 或 Cake 是否存在插件。

Autodoc is an easy place to start and is what Clojure core and Clojure contrib produce.

Easy to use with Maven. I'm not sure if plugins exist for Leiningen or Cake.

带刺的爱情 2024-10-29 03:06:24

如果你想完全识字,你应该给出 org-babel -clojure 看看。 org-bable 是 emacs org-mode 的文学编程扩展。

如果您想使用 nrepl,应将以下内容添加到您的 .emacs 中:

(defun org-babel-execute:clojure (body params)
  "Execute a block of Clojure code with Babel."
  (let ((result-plist (nrepl-send-string-sync (org-babel-expand-body:clojure body params) nrepl-buffer-ns))
        (result-type  (cdr (assoc :result-type params))))
    (org-babel-script-escape
     (cond ((eq result-type 'value)  (plist-get result-plist :value))
           ((eq result-type 'output) (plist-get result-plist :value))
            (t                        (message "Unknown :results type!"))))))

If you want to go fully literate you should give org-babel-clojure a look. org-bable is a literate programming extension to the emacs org-mode.

If you want to use nrepl the following should be added to your .emacs:

(defun org-babel-execute:clojure (body params)
  "Execute a block of Clojure code with Babel."
  (let ((result-plist (nrepl-send-string-sync (org-babel-expand-body:clojure body params) nrepl-buffer-ns))
        (result-type  (cdr (assoc :result-type params))))
    (org-babel-script-escape
     (cond ((eq result-type 'value)  (plist-get result-plist :value))
           ((eq result-type 'output) (plist-get result-plist :value))
            (t                        (message "Unknown :results type!"))))))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文