Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to external Dokka/Javadoc sites' package-list files #237

Open
cjbrooks12 opened this issue Mar 11, 2019 · 2 comments
Open

Link to external Dokka/Javadoc sites' package-list files #237

cjbrooks12 opened this issue Mar 11, 2019 · 2 comments
Labels
enhancement Task Type: New features, additional options for existing features, etc. plugins Project Type: Plugins, Language extensions under consideration Issue Status: Under consideration

Comments

@cjbrooks12
Copy link
Contributor

cjbrooks12 commented Mar 11, 2019

Orchid has a mechanism for linking to external sites, but it only reads from its internal JSON format, currently. It should also be able to read package-list files produced by Dokka and Javadoc. This would allow Orchid sites to intelligently link to non-Orchid sites.

Example pages that Orchid should be able to read and link to:

@cjbrooks12 cjbrooks12 changed the title Link to external Dokka/Javadoc sites' package-list files Link to external Dokka/Javadoc sites' package-list files Mar 11, 2019
@cjbrooks12 cjbrooks12 added enhancement Task Type: New features, additional options for existing features, etc. under consideration Issue Status: Under consideration plugins Project Type: Plugins, Language extensions labels Mar 12, 2019
@sjjhsjjh
Copy link

Hi, Some things that might contribute to a workaround …

  • The kotlindocs plugin has an args option, according to its page in the Orchid Admin screens.

    Arbitrary command line arguments to pass through directly to Dokka.

  • Dokka has a -links command line switch by which external documentation links can be specified. See https://github.com/Kotlin/dokka#using-the-command-line

(I tried adding this to my config.yml file:

kotlindoc:
  sourceDirs:
    - '../../../../myproject/src/main/java'
  args:
    - '-links'
    - 'https://developer.android.com/reference/^https://developer.android.com/reference/package-list^^'

It seemed to have no effect, not even an error message. There's no message if I put in rubbish so my guess is that this option isn't there in the code; only in the plugin documentation.
I also tried putting something similar in the afterEvaluate { orchid { ... } } block. That only gets error messages and build failures like:

[INFO] com.google.inject.internal.MessageProcessor: An exception was caught and reported. Message: java.lang.IllegalArgumentException: Unrecognized flag: -links

@cjbrooks12
Copy link
Contributor Author

Sorry for the confusion here. The args are being passed to Dokka, but there are some flags that may not be relevant anymore with the way Orchid is using Dokka, and passing them in the afterEvaluate { orchid { ... } } block are used for configuring Orchid itself, not Dokka. The Dokka integration is much deeper than simply letting Dokka run normally, and then wrapping the outputs in a layout, so additional care will need to be done to support this.

Basically, I'm having to use Dokka for creating a data model of your Kotlin code, and then letting Orchid render that data model intelligently into templates. -links is used when Dokka resolves references to external pages, but I'm bypassing that part of Dokka and instead resolving those links from the Orchid side, not Dokka. So what needs to happen for this to be supported is not letting Dokka know how to reference external pages (which I'm not letting it do), but instead read those same package-list files from Orchid itself and resolve links properly on the Orchid side.

There are a number of things like this that currently are done very ad-hoc for these code documentation plugins, but I have been doing a ton of work over the past couple months to dramatically improve how these portions of Orchid work. I don't have a timeline for its release yet, but a lot of the problems with the code-doc plugins in their current form will be resolved with these changes, and future problems will be able to be addressed much more easily. Again, sorry for the confusion here, but infrastructural work is being done to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Task Type: New features, additional options for existing features, etc. plugins Project Type: Plugins, Language extensions under consideration Issue Status: Under consideration
Projects
None yet
Development

No branches or pull requests

2 participants