Skip to content

Scaladoc member permalinks now get us to destination, not to neighbors#9252

Merged
lrytz merged 2 commits intoscala:2.13.xfrom
zerosum:issue/11805
Oct 19, 2020
Merged

Scaladoc member permalinks now get us to destination, not to neighbors#9252
lrytz merged 2 commits intoscala:2.13.xfrom
zerosum:issue/11805

Conversation

@zerosum
Copy link
Copy Markdown
Contributor

@zerosum zerosum commented Oct 18, 2020

Fixes scala/bug#11805 .

This problem seems to be just because the fixed header which is identified with search had be hiding other elements.

@scala-jenkins scala-jenkins added this to the 2.13.4 milestone Oct 18, 2020
@zerosum
Copy link
Copy Markdown
Contributor Author

zerosum commented Oct 18, 2020

I've signed the CLA.
Should I do any other actions?

@som-snytt
Copy link
Copy Markdown
Contributor

/sync

@eed3si9n
Copy link
Copy Markdown
Member

eed3si9n commented Oct 18, 2020

@zerosum Could you post screenshots of before and after to demonstrate your fix similar to scala/bug#11805 (comment) please?

@zerosum
Copy link
Copy Markdown
Contributor Author

zerosum commented Oct 19, 2020

Before

  1. Open https://www.scala-lang.org/api/current/scala/PartialFunction.html (Scala 2.13.3) using Chrome 86 or Safari 14.0. Then do below steps:
  • Scroll down to def andThen[C](k: PartialFunction[B, C]): PartialFunction[A, C], right-click on the link icon, and open a new tab.
  • Repeat right-click, new-tab for applyOrElseA1<:A,B1>:B:B1.
  • Repeat right-click, new-tab for unlift:PartialFunction[A,B]

andThen[C](k: PartialFunction[B, C]): PartialFunction[A, C]

Chrome, new-tab

Safari, new-tab

applyOrElse[A1<:A,B1>:B](x:A1,default:A1=>B1):B1

Chrome, new-tab

Safari, new-tab

unlift:PartialFunction[A,B]

Chrome, new-tab

Safari, new-tab

After

steps:

  1. checkout 6112b18
  2. sbt dist/mkPack to build scaladoc
  3. generate docs by build/pack/bin/scaladoc -d build/scaladoc/ ./src/library/scala/*.scala
  4. Open generated docs using Chrome 86 or Safari 14.0. Then do steps below:
  • Scroll down to def andThen[C](k: PartialFunction[B, C]): PartialFunction[A, C], right-click on the link icon, and open a new tab.
  • Repeat right-click, new-tab for applyOrElseA1<:A,B1>:B:B1.

// member unlift haven't appears in docs by above steps.

andThen[C](k: PartialFunction[B, C]): PartialFunction[A, C]

Chrome, new-tab

Safari, new-tab

applyOrElse[A1<:A,B1>:B](x:A1,default:A1=>B1):B1

Chrome, new-tab

Safari, new-tab

note

It seems that #9120 solved the problem below:

I'm guessing that this has something to do with < and >?

(via. scala/bug#11805 (comment))

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you!

margin: 4em auto 0;
}

div#content-container > div#content > div#template > div#allMembers > div.members > ol > li > a.anchorToMember {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this path a little bit less precise? it seems that it could quite easily break when refactoring anything on that path.

it seems to me, a plain #anchorToMember would be fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. i didn't care about refactoring too much.

i'll modify it. however, i think it would be .anchorToMember, not #anchorToMember.

Copy link
Copy Markdown
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lrytz lrytz merged commit 57ae2a6 into scala:2.13.x Oct 19, 2020
@raboof
Copy link
Copy Markdown
Contributor

raboof commented Oct 19, 2020

Love it! Thanks!

@zerosum zerosum deleted the issue/11805 branch October 19, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scaladoc member link only gets me in the neighborhood, then I use streetview to find my destination

6 participants