Navigation Menu

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

ScalaDoc tool: add Permalinks to type's members #8144

Closed
scabug opened this issue Jan 12, 2014 · 5 comments
Closed

ScalaDoc tool: add Permalinks to type's members #8144

scabug opened this issue Jan 12, 2014 · 5 comments

Comments

@scabug
Copy link

scabug commented Jan 12, 2014

When I need to refer somebody directly to a specific member of the class/trait/object then I have to copy its URL and append signature of member, preluded by a '@' sign.
For example: http://doc.akka.io/api/akka/snapshot/index.html#akka.actor.ActorContext@unbecome():Unit

Doing it manually is not efficient and 'typo-prone'.
With a JavaDoc I can copy URL from "Method summary" section but I don't see equally solution for ScalaDoc.

My proposal is to add some kind of a "permalink" button (for example somewhere at the right side of member's row) which will change current location hash or copy permalink to a clipboard.

I could try to implement this with pleasure :)

@scabug
Copy link
Author

scabug commented Jan 12, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8144?orig=1
Reporter: @mkubala
Assignee: @mkubala

@scabug
Copy link
Author

scabug commented Jan 20, 2014

@VladUreche said:
Marcin, this would be a great addition to Scaladoc! A good place to start is the Template.scala page, which generates the html file:
https://github.com/scala/scala/blob/master/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala

You will need to modify the member signature:
https://github.com/scala/scala/blob/master/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala#L717 (start of def signature)
https://github.com/scala/scala/blob/master/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala#L826 (start of the def signature code)
and you can add a permalink button to the right.

To get the anchor, have a look at:
https://github.com/scala/scala/blob/master/src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala#L295-L296
which generates the anchors (the new one and the old one, for compatibility).

HTH, Vlad

@scabug
Copy link
Author

scabug commented Mar 9, 2014

@mkubala said:
Hi,
Thanks for advice!
This task tooks me more time that I predicted, but I'm still 'on the track'.
I can't assing issue to myself, so I decided to write this comment just in case.

@scabug
Copy link
Author

scabug commented Mar 9, 2014

@VladUreche said:
Great to hear that Marcin! Looking forward to reviewing your pull request. :)

@scabug
Copy link
Author

scabug commented Mar 11, 2014

@mkubala said (edited on Mar 11, 2014 9:25:16 PM UTC):
Hi Vlad,
My PR is ready for review -> scala/scala#3618

By the way, I figured out that template.js and index.js could be refactored. Resposibility for filtering members, parsing location hash, keyboard shortcuts (and so on) could be extracted into separate objects.
I have no experience with qunit, but this could be good chance to try something new and increase JS test coverage after that.

But for now I decided to leave JS code in their original form, to not hamper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant