Open lydell opened 5 years ago
I think this is close to this request: https://github.com/dmy/elm-package-info/issues/10. I answered why it is hard to do it properly in this extension. Feel free to experiment though.
Thanks!
I’ve worked with WebExtensions before and I’m up for the challenge! Hopefully I’ll get time soon.
My initial plan is to extract all functions from the DOM, stick them in a div and show it in the empty space on the left. Then I’ll need to keep it up-to-date as the URL changes.
Here’s a fun hack:
Paste this in the console:
String.prototype.toLowerCase = function toLowerCase() { return this.trim().toLocaleLowerCase() }
Now you can get all full outline for the entire package by typing a space into the search field.
This is why it works: https://github.com/elm/package.elm-lang.org/blob/f9c3cc452e7890850ee4e554bda117d8af843cab/src/frontend/Page/Docs.elm#L425-L435
I might just stick that in my personal browser tweaks extension and call it a day.
Nice trick indeed.
Something similar but only for the current module could be a nice feature for elm-doc-preview, which I often use instead of the website during development (faster, offline, only used packages, ...).
Hi!
First, thank you very much for making this extension! I especially like the
elm install foo/bar
box with click-to-copy.Something that I do quite often is scrolling through a page, exploring which functions are available. Example: https://package.elm-lang.org/packages/elm/browser/latest/Browser-Dom
The example above has some really detailed documentation with images and stuff which is really nice. But it makes it harder to get an overview of the package.
Sometimes, I’m looking for the documentation of a function that I know exists. I’ve learned the trick to ctrl+f for the function name plus space plus colon to quickly get there, but for a long function name it can be annoying to type.
So I would like some kind of table of contents or summary or something of all functions/types in a module. Both to get an overview and to be able to click to get to the docs for a specific function.
Taking the example above, there could be a section like this:
Or like this:
Or like this:
Where should the section be?
I think this requires some experimentation. What do you think?