-
Notifications
You must be signed in to change notification settings - Fork 19
Support JS sidebar #302
Comments
Notes from Berlin meeting: Currently we have 2 JS sidebars: One (JSSidebar) on pages like this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference - that shows all the JS docs (tutorials and reference) We should not do this. Instead we should have a single sidebar for all the JS docs, that contains the same detail as the sidebar in (2). When the user is on a particular object page, the sidebar could expand the section of the sidebar containing that object’s methods, properties &c. Like the sidebars in the webextensions docs. For the content in (1), it seems that existing stumptown sidebar structures (directory lists, chapter lists) would be enough. For the built-in objects section of the sidebar, we’d need to add some logic to stumptown. It would be enough to allow authors to qualify a “directory” listing using a recipe, so they can say: “include all the pages in this directory that are javascript-method pages”. This would be a more constrained alternative to just supporting tags, which we don’t yet support in stumptown. |
To begin with I'd like us to agree on what a JS sidebar should look like. I've made a mock JS sidebar, more or less following the design above, and put it here: https://wiki.developer.mozilla.org/en-US/docs/User:wbamberg/mock-js-sidebar. Some things we could say about this sidebar design:
|
Here's a version that "floats" the siblings, and also doesn't contain properties for other built-in objects: https://wiki.developer.mozilla.org/en-US/docs/User:wbamberg/mock-js-sidebar2. This seems better to me actually. @Elchi3 , @chrisdavidmills , @ddbeck , I'd be happy to hear feedback when you are able. |
Thanks for giving this a go and making (bold) decisions, Will!
Yes. I agree with this 100% and this will be a nice improvement. This was the goal of {{jsSidebar}} originally. Unfortunately, it didn't do that for the reference part of the docs.
I agree to remove "Reference" as a workaround if needed, I don't think it is needed necessarily.
Styling according to page type sounds promising indeed, but for JS this falls apart quickly. Some language features are reference pages, but they mostly have English titles instead of code.
I like this! :)
Yes, I think even the spec calls these things global functions, global properties and global constructors. See also categories here https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects#Standard_objects_by_category
We talked about omitting "Inherited" sections, so that is fine with me.
This is a neat idea! I think I don't like that it then starts with tutorials again and only then you are back to your reference parent tree, but I don't know how users really travel along with sidebars. Would be interesting to research... |
@wbamberg I'm just trying to think whether I've got anything to add here beyond what @Elchi3 has already said. I don't think not having bold/code on the items is a huge loss. If we could just have code on the reference bits, that would be nice, but let's see how this goes. I think the second version is definitely better. Simpler, with less nesting levels is definitely better. It would be nice to see a case that has more than just instance methods (static methods, and instance/static properties too) — how would this work? Should the categories be "Instance methods", "Static methods", etc., just to make that clear? After you get past the reference stuff for the current Object, the order should be altered so that the other reference stuff is just below it, and then the tutorials at the end. I think that makes more logical sense in this context. I love that the summary elements are now clickable links, although we should make sure that this only occurs where it makes sense, and just non-clickable text in other cases? |
Thanks for your thoughtful comments!
You're right of course. That occurred to me too some time after writing this. I think actually we could perhaps address scannability without needing code styling.
Yeah, sorry, I shouldn't really have brought this up. Since the sidebar just slurps page titles, this emotive question is independent of sidebar design so we don't have to worry about it today. Phew!
This is very interesting. I had thought my point 8 was a fatal objection to the first proposal, but I like this design a lot. Yes, we'd need scrollable sidebars, but I think we should have that anyway. (Note that the Azure sidebars don't make
I did like version 2 better, but with Florian's suggestion to do what the MS Azure docs do and scroll to the relevant spot (https://docs.microsoft.com/en-us/cli/azure/cdn/custom-domain?view=azure-cli-latest), I think perhaps I like 1 more. Having the same sidebar on every page seems quite powerful for navigation. Also, I think it'll be easier to implement! I find it hard to think how we could have a single sidebar specification that implements version 2. I know this isn't the greatest reason though. I'll think some more about implementation choices.
Yeah, this is a really good point. Actually, for our current sidebars this distinction is made by whether or not the title include
I will have a think about how we might implement something like this. |
I think this could be good too - definitely worth protyping out.
Yup, this is the kind of thing I was thinking! Again, worth prototyping out ;-) |
I don't have much to add here. I think Florian and Chris covered this well. I'm happy with the content of the sidebars and it seems like a reasonable path to a design too. But because I can't help myself, I wanted to comment on the |
Yeah, I do agree here. It is jarring, expecting to open a section of the menu and navigating to a different page, and the analogy to clicking a label is strong. I think that's the reason MDN doesn't do this at the moment, although the alternative is clunky too. But I hope we will be able to say that this is a presentational thing for the renderer to sort out. If we just provide the content, the renderer could decide whether to include the link in the summary text or to make it the first child of the details section as the Azure docs do. |
This is now done! |
To represent the JS docs in stumptown we need to have an implementation of a sidebar in stumptown that's suitable for the JS docs.
Acceptance criteria
The text was updated successfully, but these errors were encountered: