-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add @extref, @scaladoc and @github directives for parameterized linking to external pages #27
Conversation
I would request a feature to override the base URL for the scaladocs/javadocs so in the future we could host Lightbend-related API docs on Tech Hub. |
@eed3si9n I can add a scripted test to validate, but since the URL templates are configurable via the sbt 'project docs' \
'set paradoxProperties ++= Map("scaladoc" -> "http://developer.lightbend.com/akka-http/scaladoc/10.0.0/#%s")' \
paradox |
In terms of names, I'm not sure about |
For Akka HTTP my understanding is that it needs to have "parametrized" links for:
For concepts related to streaming and Akka core usage I'd also imagine having links to Akka scaladoc/javadoc would be useful, not to mention links to Scala language scaladoc and Java language javadoc. Slick has 9 URL templates, 2 of which are parameterized: |
For the apilinks, we can semi-automate it so the package starting with
Similarly Github can support both my project and others:
I'm ok with keeping |
Great idea. Should we keep configuration under a common prefix?
|
How about we come call these properties "base_url" or something?
|
👍 I will update the PR. |
Based on the approach taking by Slick's apilinks extension: - https://github.com/slick/slick/blob/master/slick/src/sphinx/exts/apilinks.py References lightbend#2
Supports most of the references documented in: https://help.github.com/articles/autolinked-references-and-urls
21b5363
to
e77604b
Compare
@eed3si9n I've updated the PR with the new functionality. I hope this gets it close to something mergeable. WIP branch that I'd like to land in Akka HTTP once this PR gets merged and a new version has been released: https://github.com/jonas/akka-http/tree/external-links |
LGTM |
For example, given: | ||
|
||
- `scaladoc.akka.base_url=http://doc.akka.io/api/akka/2.4.10` | ||
- `scaladoc.akka.http.base_url=http://doc.akka.io/api/akka-http/10.0.0` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! :-)
scaladoc.rfc.base_url=http://tools.ietf.org/html/rfc%s | ||
|
||
then `@extref[RFC 2119](rfc:2119)` will resolve to the URL | ||
<http://tools.ietf.org/html/rfc2119>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
👍 Nice work! Great additions. |
As suggested by @pvlugter it allows to configure simple URI templates similar to Slick's
apilink
extension. The templates can be configured via Paradox properties prefixed withlinks.ext
and the lookup uses uses the URI scheme, examples:@ext[Actor](scaladoc:akka.actor.Actor)
@ext[#1](issue:1)
I considered naming it
@link
as that might be more telling when viewing in GitHub. Let me know if you have better suggestions.Possible extensions and improvements:
scala
which links to Scala's scaladoc usingscalaVersion
settingjava
which links to Java lang javadocsapi
which links to the current project's scaladoc usingapiURL
from the Ivy XML/model (if defined)issue
which link to tickets using project'sscmInfo
(i.e.ScmInfo.browseUrl
) (if defined)github
which would support GitHub specific links:akka/akka#1234
,akka/akka@0f2da7b26b5c
and optionally use project defined in SBT'sscmInfo
setting to support more relative project links'scaladoc' to better support links to methods etc. e.g.