-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add missing features to scala3doc to match dotty docs #10320
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 missing features to scala3doc to match dotty docs #10320
Conversation
028bb16
to
40cf93e
Compare
- add links - implement more generic children mechanism
To not refactor half of model I needed to use a var that accepts lambda. We should probably find better way to do it (probably by processing TASTY before we start dokka) Add local alias for DRI
also expost it as fields in static site
Set cwd form generate*Documentation tasks to root project path
2a0cc49
to
7fce442
Compare
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.
So far look good
import scala.collection.JavaConverters._ | ||
|
||
|
||
case class LazyEntry(val getKey: String, value: () => String) extends JMapEntry[String, Object]: |
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.
Redundant val
This makes our source link precisily pin-point used source not what is currently on master.
EmojiExtension.ROOT_IMAGE_PATH, | ||
"https://github.global.ssl.fastly.net/images/icons/emoji/" | ||
) | ||
.set(Parser.INDENTED_CODE_BLOCK_PARSER, false) |
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.
Do we intentionally disable indented code blocks?
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.
I copied the settings over from dotty-doc so I do not have a strong feeling aboout any of this options beside ANCHORLINKS
ones.
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.
I think we should support them, unless we have a reason not to.
There's a separate topic here: linking to documentation from static site should be done with Wiki links, like in doc comments. This requires the WikiLink extension like here and some link-handling code that's already in MarkdownConverter here.
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.
Aside from the comments, LGTM!
config.staticSiteContext.foreach { p => | ||
val previous = p.memberLinkResolver | ||
p.memberLinkResolver = link => previous(link).orElse(driFor(link)) | ||
} |
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.
It shouldn't be neccessary to store multiple contexts, any of them should work for resolving links.
EmojiExtension.ROOT_IMAGE_PATH, | ||
"https://github.global.ssl.fastly.net/images/icons/emoji/" | ||
) | ||
.set(Parser.INDENTED_CODE_BLOCK_PARSER, false) |
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.
I think we should support them, unless we have a reason not to.
There's a separate topic here: linking to documentation from static site should be done with Wiki links, like in doc comments. This requires the WikiLink extension like here and some link-handling code that's already in MarkdownConverter here.
Do not fail on missing link but display a warning.
Links do generated documentation using this PR for Scala 3 and scal3doc itself (however it has just a token static site).
Scope of this PR:
Known differences:
Reference
node: https://scala3doc.virtuslab.com/pr-10320/scala3/docs/Reference/index.html)New features:
index.html
orindex.md
)