英文:
How do I create a non-URL clickable link in Java source file?
问题
以下是翻译好的部分:
"I am experimenting with Markdown and AsciiDoc to see if we can provide richer docs-as-code than we do today. This is very promising."
"我正在尝试使用Markdown和AsciiDoc,看看是否可以提供比我们今天更丰富的文档作为代码。这非常有潜力。"
"It is possible to link from an AsciiDoc file to a Java source file, so the reader can navigate the rendered version directly. It is also possible to put a URL in a comment in a Java source file which can be Ctrl-Click'ed to go there."
"可以从AsciiDoc文件链接到Java源文件,这样读者可以直接导航到渲染的版本。还可以在Java源文件的注释中放置一个URL,用户可以Ctrl-Click以跳转到那里。"
"Is there a special syntax that is understood by IntelliJ so it can be used in a similar way to easily navigate from a Java source file (Groovy and Kotlin are also interesting) to a non-source file? I'd prefer one that can be put on any comment like an URL, but if Javadoc can do it that is fine too."
"是否有一种特殊的语法,被IntelliJ理解,以便可以以类似的方式从Java源文件(Groovy和Kotlin也很有趣)轻松导航到非源文件?我更希望可以像URL一样放在任何注释中,但如果Javadoc可以实现这一点,那也可以。"
英文:
I am experimenting with Markdown and AsciiDoc to see if we can provide richer docs-as-code than we do today. This is very promising.
It is possible to link from an AsciiDoc file to a Java source file, so the reader can navigate the rendered version directly. It is also possible to put a URL in a comment in a Java source file which can be Ctrl-Click'ed to go there.
Is there a special syntax that is understood by IntelliJ so it can be used in a similar way to easily navigate from a Java source file (Groovy and Kotlin are also interesting) to a non-source file? I'd prefer one that can be put on any comment like an URL, but if Javadoc can do it that is fine too.
答案1
得分: 1
你可以以与链接其他内容相同的方式链接文件。例如,我在我的项目中的一个Asciidoc文件中有以下行:
link:./src/main/java/javax0/jamal/test/examples/Array.java[Array.java]
在使用IntelliJ asciidoctor插件编辑的Asciidoc文件中,右侧面板将显示一个链接。如果你在编辑器中点击它,它将打开Java文件。
相反地,如果在Java注释中有一个指向非Java文件的链接,我不太确定。如果你查看2014年的IntelliJ票据
它已经对此进行了评论。
英文:
You can link a file the same way you would link anything else.
For example, I have the following line in an Asciidoc file in my project:
link:./src/main/java/javax0/jamal/test/examples/Array.java[Array.java]
in an Asciidoc file edited using the IntelliJ asciidoctor-based plugin will show you on the right pane a link. If you click on it in the editor, it will open the Java file.
The other way around, having a link in a Java comment pointing to a non-java file: I am not so sure. If you look at the IntelliJ ticket
from 2014 it is already commenting on it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论