Skip to content

Conversation

@pzuraq
Copy link
Contributor

@pzuraq pzuraq commented May 5, 2018

  • Simplifies the API doc navigation. It now only shows the modules
    themselves, and none of their items (that is left to the API docs page).

  • Brings back nested subnavigation menus

  • Adds the break-on helper which allows us to specify when a string
    should break by inserting zero-width spaces

  • Random cleanup

  • Upgrades Tailwind

screen shot 2018-05-06 at 5 00 25 am

The one disadvantage to going this route is it hurts power users who are familiar with the library already and just want to be able to lookup an import really quickly. I think this could be better solved by having a dedicated reference page. I didn't add it in this PR, but plan on trying to figure it out soon:

screen shot 2018-05-06 at 4 57 42 am

@pzuraq pzuraq requested review from dfreeman and samselikoff May 5, 2018 01:40
@samselikoff
Copy link
Contributor

Nice – I agree we should fix this up!

Initial thoughts are nav is getting a little cluttered. Thinking about ways we can clean it up...

  • With the package names now clickable we have gray text that is both clickable and non-clickable, I think it's a little confusing. I think if something's clickable it should be black (possibly lower opacity as in the index). But reserve the gray color for headings
  • Do we need to include package namespace in nav, i.e. @ember-decorators?
  • Trying to think what grouping by namespace versus type would look like (for example, sandbox/​utils/​esdoc-module being the heading and having both the function and variable under there)
  • There's always the option of pulling API reference out into its own page...

{{#if (is-array items)}}
{{#if (is-array items)}}
{{#each items as |item|}}
{{docs-viewer/x-item item.name (concat root '.api.item') item.path}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be x-nav-item

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, definitely

@pzuraq
Copy link
Contributor Author

pzuraq commented May 5, 2018

Generally agree with everything you’re saying design-wise, feel free to change it! I can get to it on Monday most likely.

As for pulling API docs out, I think that’d be a good idea actually! Basically give them their own tab. It may be a little tricky with the Sandbox, but we can make it work!

@pzuraq
Copy link
Contributor Author

pzuraq commented May 6, 2018

So coming back to this, I actually really agree, it does feel like the nav has gotten pretty cluttered and is trying to do too much:

screen shot 2018-05-06 at 4 07 57 am

Comparing it to the Ember API docs:

screen shot 2018-05-06 at 3 57 09 am

They just link to the individual modules. For really simple addons/libraries, it may make sense to have the individual addon members listed in the nav, but in @ember-decorators it doesn't really make sense, and I think with the new index on the right, and the search functionality we have, in general it makes less sense. I'm going to update this PR to drop the nav index for modules in general and just list the individual modules.

Also, regarding the other question you had:

Do we need to include package namespace in nav, i.e. @ember-decorators?

I think this depends on the addon. For ember-decorators it makes sense, because you ember install ember-decorators, but you import from @ember-decorators, so we want to always show the fully qualified module name whenever we refer to it (also because the site is technically documenting more than one addon). I do think we should try to make this optional, maybe we can strip the namespace if it is the package that is being worked on? Or turn it into a flag? Or maybe expose a hook so people can customize the navigation index?

* Simplifies the API doc navigation. It now only shows the modules
themselves, and none of their items (that is left to the API docs page).

* Brings back nested subnavigation menus

* Adds the `break-on` helper which allows us to specify when a string
should break by inserting zero-width spaces
@pzuraq pzuraq force-pushed the fix-up-api-doc-navigation branch from 70da25c to 0d48efb Compare May 6, 2018 12:14
@pzuraq pzuraq changed the title [cleanup] Fixes up the API doc navigation [cleanup] Simplifies the API doc navigation May 6, 2018
@samselikoff
Copy link
Contributor

Just ran it locally and it looks great!

👍 from me

@pzuraq pzuraq merged commit 2651062 into master May 6, 2018
@pzuraq pzuraq deleted the fix-up-api-doc-navigation branch May 6, 2018 19:10
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.

3 participants