Closed felixmulder closed 4 years ago
Here are a few more suggestions:
@jrudolph: pressing tab
should get you to the search field. Vlad wants Ctrl-F as well, will look into it :)
Regarding search in progress, it is feasible to inject a function to be run by the scheduler on search start. So should be able to do that :+1: Good idea!
Here's another small thing I noticed:
When you search something, then use the scroll-bar to scroll down and then try to use the arrow keys, you will select entities which are currently not visible. The selected element will not be scrolled into view until you managed to select an element which is visible.
This could be fixed in different ways. The simplest solution would be to just scroll the selected element into view. If you had nothing selected before this would make the view jump to the top, unfortunately. I wonder if it would be more sensible to always select the first element in the view, instead, when you hit
Related: if you hit
I guess this is because the unit on the right hand side is just chosen to have the same index as the entity on the left hand side. As there's no relationship between elements with the same index on the left and the right side it would make more sense to select an element on the right side by visual position than by indexing into the result array.
I'll answer this in depth later - but pretty much there's an iterator for both sides with a switch function to toggle between the two. Where the new index is the min between length and index :)
@jrudolph: I snuck a fix for this:
When you search something, then use the scroll-bar to scroll down and then try to use the arrow keys, you will select entities which are currently not visible. The selected element will not be scrolled into view until you managed to select an element which is visible.
into https://github.com/scala/scala/pull/4983 :+1:
When it comes to this:
I guess this is because the unit on the right hand side is just chosen to have the same index as the entity on the left hand side. As there's no relationship between elements with the same index on the left and the right side it would make more sense to select an element on the right side by visual position than by indexing into the result array.
You're totally right, when switching between sides - it tries to match indices, but sometimes you might have multiple method matches in the right side for every entity match on the left. What you're proposing is the better fix. I'm adding it to the list up top. M4 is reportedly coming on the 27th, this might not make it into M4, but I'll be sure to fix it before the final release of 2.12.0 :) Thanks for all the feedback!
I snuck a fix for this:
Cool :)
No urgency from my side to fix those things.
Two things in the latest merged version:
index.html
it will now show the docs of the empty root package which is probably the most boring landing page you could think of. It seems scala-library and scala-compiler have put something there but this seems more like a hack than a real solution. (E.g. what happens if you want to merge several documentation packages (like Akka does with unidoc), how would the root documentation be merged?) This doesn't seem to be a new thing, so maybe it's not so important.Another thing :)
Chromium shows this warning in the console:
'SVGElement.offsetWidth' is deprecated and will be removed in M50, around April 2016. See https://www.chromestatus.com/features/5724912467574784 for more details.
originating from the included jquery.js. It would probably make sense to proactively upgrade to a newer version of jquery to prevent future breakage.
Hej Johannes! Thanks for the update. I'll see if I can fix your text-overlap issue in the https://github.com/scala/scala/pull/4997 PR. Regarding the SVG-issues, I think that's an issue that's prevalent to the jQuery 1.9.x series (which supports the microsoft legacy browsers). I'll see how much of a pain it is to migrate, if it isn't too bad I'll put it in the same PR.
Regarding setting the root package. The "root" will be a theoretical package above the top packages. One dumb thing you might do is this: let's say you have akka._._
packages only, you'll see that in the akka directory there's an index.html
just make that the root file served on the akka pages. EEEIK You'll get broken links to the root package which will be listed in the packages on the right.
I think @VladUreche would have more insight into this, but one thing I've been toying with is getting rid of the root package and having an optional Library
page instead.
Well, if you want to land on a specific package just make the API link point to <scaladoc root>/subpackage/you/want/to/land/in
. And the first page people will see is the one for subpackage.you.want.to.land.in
.
@VladUreche yes, I guess that makes sense.
I've been seeing some unexpected behaviour when using the X to clear the member filter, It fails to clear the text.
Demo: https://youtu.be/RLG0Rb6UNMs
Firefox: 41.0 Ubuntu 14.04.3 LTS
Here's an idea.
Take a look at an example of grouped methods: https://github.com/scala/scala/pull/5034. It could be useful to have a fold/unfold arrow on the group name.
One problem with this would be a requirement to auto-expand a folded section if a user clicked a link to hidden member when that link is on the current page. There's a similar problem when the member filter has hidden members. Clicking a link to a hidden member fails to show the member.
In 2.11.x the target member of a link did a Web 2.0 style fade from yellow to show it was the target.
This shows a case when that would have been useful: https://youtu.be/MUp5NpZDHOw
Because the target method withPositioning(pos)
is close to the end of the page it cannot be scrolled to the top of the page leaving the user with no cue as the intended target.
@janekdb, first up - great work on https://github.com/scala/scala/pull/5034, it's gonna look waaay better than the current Predef page :+1:
I've been seeing some unexpected behaviour when using the X to clear the member filter, It fails to clear the text.
I figured out why this is. When the input-field loses focus, we hide the "x" - but, after a timeout, allowing a quick click. As such, if you're on a really fast computer (i.e. desktop) the timeout will actually beat your click. If you're on slow hardware and do a loooooong click - the same will happen. So how should we fix this? My suggestion is to always keep the "x" if there's text in the input-field - and on clear, remove it.
EDIT: https://github.com/scala/scala/pull/5039
One problem with this would be a requirement to auto-expand a folded section if a user clicked a link to hidden member when that link is on the current page. There's a similar problem when the member filter has hidden members. Clicking a link to a hidden member fails to show the member.
Good find, adding it to the list!
In 2.11.x the target member of a link did a Web 2.0 style fade from yellow to show it was the target.
Regression, this should still be there... :cry:
Given the prevalent use of type classes in the stdlib, cats, scalaz, shapeless, spire, algebra, etc. it would be super nice to have some kind of support for them in the Scaladoc. Some discussion on Gitter here: https://gitter.im/scala/scala?at=56f8dc3e76b6f9de194bbe35
scala.Predef is missing from sidebar when browsing other scala.X entities (might be all objects without companion class/trait)
It is all objects without companion class/trait. A few other examples I could gather:
Platform
in http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/scala/compat/index.htmlForkJoinPool
, ForkJoinTask
, and ThreadLocalRandom
in http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/scala/concurrent/forkjoin/index.htmlStdIn
in http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/scala/io/index.htmlWhen browsing, the object, class, and trait icons are proper lined up: objects always on the first column, classes and traits always on the second (first image at http://imgur.com/a/c1uyX). When searching, however, things are all over the place (second and third images). It would be nice to have the same icons always on the same columns.
I don't know how an object without a companion class/trait would currently look like (see my previous comment above), but it should display on the first column, together with the other object icons.
These icons are very similar, it is difficult to tell them apart. More contrast/differentiation would be welcome:
We have http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/lib/object.svg and http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/lib/object_comp.svg icons. However, "object_comp.svg" is conceptually wrong. We need separate "object_class_comp.svg" and "object_trait_comp.svg" icons. Take, for instance, http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/scala/collection/mutable/ArrayOps$.html: the icon suggests this object has a companion class (green background), when in reality it has a companion trait (light blue background).
Thanks for the feedback @marconilanna. I've added the spacer issue to the TODO and differentiation of object_class_comp.svg
and object_trait_comp.svg
(see initial issue).
Regarding contrast and differentiation - I disagree. They're easy to tell apart and they have colors that follow the style of scala-lang, which is one of the goals of the redesign. We want the interface to be non-obtrusive and easy to look at for longer periods of time (which was one of the problems with the previous scaladoc). That being said - if you think you have a better idea for what the icons should look like, you're more than welcome to contribute a couple of svgs :)
Looks great!
I'm having one issue on the desktop (Firefox 38 / Debian): When I try to expand the 'Full Signature' of a method that is shown as '[use case]', for example Option . max.
, the method body collapses. When I expand it again, the full signature is included. I suppose it should now collapse upon click on 'Full Signature'.
Thanks @sciss! Added it to the TODO - will have a look during the week/next week :)
@felixmulder are you aware of https://issues.scala-lang.org/browse/SI-9721 and https://issues.scala-lang.org/browse/SI-9722 ? I'd assign them to you in Jira, but you don't seem to have an account.
@SethTisue I'm aware of them and currently working on the latter in one branch. There's still one issue right now where final case class
es don't make it to the searchable index - debugging...
I have an account, I've commented on the issues so you can assign them :)
First of all, loving the new look&feel!
One of the coolest features is the smart search bar. However, the version active at http://www.scala-lang.org/files/archive/nightly/2.12.x/ doesn't allow us to search for members of "some" objects.
For an example, long2Long
shows up as a member of Predef
while int2long
doesn't show up at all despite being a member of scala.Int
@megri: https://github.com/scala/scala/pull/5069 :)
One thing I would love (and maybe there's a way to do this that I'm missing) would be a way to add standalone pages to the generated documentation. I'm thinking of things like tutorials and examples that benefit from being integrated with the rest of the documentation (have the same style, be linked to from the relevant package/classes, link back to relevant classes etc.) but aren't specific to one particular class/object/package (or would be too big to include directly on the relevant page).
re @ianmackenzie:
One of the goals with the new documentation structure is to push users toward package level documentation. When visiting: http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/, you're greeted with the rootdoc.txt
documentation specified by the -doc-root-content
flag. In my case, with the new docs, I actually read this page for the first time. This gives me an overview of the different packages and what they're supposed to contain. Each package object
that has a docstring do the same thing but for packages.
So in terms of pages that can contain examples and are somewhat decoupled from the code examples these two options are currently it. So no you're not missing anything.
My point is this - I think it'd be a nice contribution to look at how to parse rootdoc.txt
and then create a structure where one can generate tutorials/misc pages using the same syntax as in docstrings.
Let's say you can specify a misc pages directory and then it's directory structure'll be copied into the generated page structure
└── infopages
└── tutorials
├── collections
│ └── forComprehensions.txt
├── futures.txt
└── threadpools.txt
Would generate:
├── index.html
├── scala
│ └── collections
└── infopages
└── tutorials
├── collections
│ └── forComprehensions.html
├── futures.html
└── threadpools.html
Is this something you'd be willing to implement @ianmackenzie ?
@ianmackenzie @felixmulder it would be great if standalone doc could have checked/interpreted code blocks as some of us now do with tut. This style of doc is increasingly popular at least in the FP-leaning Scala community.
@tpolecat: I completely agree. Could tut be modded to check {{{5+5}}}
clauses?
@felixmulder sure ... see also sbt-doctest
@felixmulder I can hardly refuse a reasonable request like that! Should I open a new issue on https://issues.scala-lang.org? I'll take a read through the main Scala contribution guidelines/hacker guide; any other specific tips on where to start or are there any Scaladoc-specific coding conventions I should know about?
@tpolecat @felixmulder I also think it would be great to incorporate code evaluation into standalone pages, but that sounds a bit more intimidating (and sbt-doctest looks like a pretty good fallback). I'm wondering if it would be easier to provide some sort of a hook to allow plugins like tut to process documentation sources before conversion to HTML, instead of trying to build the functionality right into Scaladoc itself, but that seems like a separate issue.
@ianmackenzie: Read the scaladocs post on scala-lang.org, this should give you a head start :) Start with just getting a hello world parsing and then worry about tut/sbt-doctest later. Ping me on gitter if you need help!
Regarding the issue - not sure. Cc: @SethTisue
@ianmackenzie @felixmulder if we go in that direction we should talk about how far we want to push it and where it ends. for example, how it relates to doc pages like docs.scala-lang.org (for scala, for example the collections overview) or project doc pages like typelevel.org/cats or lihaoyi.com/fastparse and the tools that generate it.
i personally think that scaladoc's structure is too rigid for most people to use it instead of some other doc tool. how hard would it be to implement that feature? would it complicate scaladoc for the user, clutter up the interface?
cc @heathermiller
@lrytz My hope was to be able to do something like what the Qt documentation does - it has lots of tutorial/example pages like http://doc.qt.io/qt-5/qtgui-openglwindow-example.html and http://doc.qt.io/qt-5/modelview.html that are nicely integrated with the API reference. I've always liked this model - if you're reading a tutorial you can easily jump to a class page for more details, and conversely if you're looking at the documentation for a class you can jump to a tutorial that shows how it can actually be used.
In Doxygen you can create standalone pages with the 'page' command (http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdpage). I was imagining something similar for Scaladoc - no new markup options, just some way of splitting some documentation out onto a separate page. But yes, if people started putting longer-form stuff in Scaladoc then I guess it's more likely that they might also want better support for images/tables/tables of contents/footnotes, which could get complex...
I guess the alternative is to have separate API reference and user guide/examples/tutorials like is done now, and just carefully link back and forth between them - not the end of the world, but a bit harder to maintain consistency, avoid broken links etc.
@lrytz @ianmackenzie: I agree with the sentiment - and IMO this should be limited to bring able to create a page like rootdoc.txt
and linking to it.
Should I open a new issue on https://issues.scala-lang.org?
@ianmackenzie yes, I think it would be a good to have an enhancement-request ticket on this (automated checking of code examples in the doc). whether the Scala build could take on a tut
dependency in order to get it is another question —let's discuss on the ticket
This list would be better with an ordering that understands numbers,
Product Product1 Product2 ... Product20 Product21 Product22
If we restricted the scope to names matching ^[^0-9]*[0-9]*$
we would cover ProductN
, FunctionN
and TupleN
.
@janekdb @felixmulder in fact, Scaladoc had a hardcoded check to remove ProductN
, TupleN
and FunctionN
for all N > 3. It may be that the latest batch of changes removed that check...
@VladUreche @felixmulder. Alternative idea. Instead of restoring this restriction to N <= 3 stop special casing standard library class names and add a general purpose mechanism with associated command line configuration to achieve the same outcome.
And there's always an option to collapse N > 3 items from an identified sequence into some expandable UI element.
Good point @janekdb, thanks! Maybe an annotation like @notDocumentable
or @notTemplate
.
In fact, that's exactly the opposite of @template
(and its alias @documentable
), which says "although this entity is not documentable, please document it for me". As an alternative, we could use @template none
instead of inventing a new annotation.
@janekdb, you really need to write that scaladoc tutorial! We have so many ways to tweak and inherit the comments (@inheritDoc
, macros), tweak the implicits, tweak the diagrams, tweak the groups... it's really a pity that only a handful of people know all these things...
@VladUreche - tutorial - yes - will make a start this week even if it's a baby step.
:+1: :100: if you need any help, ping me or @felixmulder!
Just thought I'd mention type hierarchy diagrams.
https://github.com/scala/scala-dev/issues/105
One wish list idea is ability to navigate down the hierarchy: at Seq, I see $colon$colon
is a subclass. What makes it a subclass, I wonder? It would be fab if mousing over the subclass link also highlighted the diagram edges in which the subclass participates, so be clicking those boxes I can reach the subclass.
I'm not even a huge fan of such diagrams in general, but this seems like a useful to way to explore type forests.
Hello everyone,
Things I noticed about the new docs:
I really like the new appearance! :+1:
The search is wonderful and the aesthetics are great!
But there are some niggling issues also, where the old format is quite superior IMO, and some other places where usability could be significantly enhanced with maybe not too much work.
scala.collection.immutable
and scala.collection.mutable
. Now you're really stuck. A "pin open" feature for the tree view would help solve this.protected abstract class
or somesuch. Leaving enough room for "final class" and "abstract def" is good. More than that should wrap. Yes, you lose some vertical space when you wrap, but the gain in horizontal space is worth it.collect
is a final def
. The final
just disappears, expanded or not. It's not wrapped or clipped or anything--just gone.Great analysis! Could you open issues on these and tag them beginner friendly?
We have a blog post somewhere helping people into this part of the compiler.
These points are excellent as beginner tasks IMO, especially if you know your way around HTML/CSS/JS :)
Ideas / General Issues
@see
in docstrings, the order gets scrambled - should not happen. Same applies to@note
EntityIterator
inindex.js
switch between right and left by visibility instead of indexwriteFor
methods, no performance gain, need to profile - crashedobject_class_comp.svg
andobject_trait_comp.svg
(fixed in: https://github.com/scala/scala/pull/5077)scala.Predef
is missing from sidebar when browsing otherscala.X
entities (might be all objects without companion class/trait) (fixed in: https://github.com/scala/scala/pull/5077)Predef extends ...
needs to go away (sidebar)(c)
instead of after. Also place(o)
before(c)
or(t)
. This'll make the search uniform to the sidebar (http://imgur.com/a/c1uyX) (fixed in: https://github.com/scala/scala/pull/5077)type
members to search inIndexScript.scala
.on("blur", function () { ... })
)Template.scala
and other unused files#definition
@shortDescription
annotation for use with hover-text and short method summaryStreamBuffer
in Graphviz. Vlad says to instantiate a generator for each GraphvizDesktop issues
Mobile Issues
General
Android
iOS