Jest: Why are "Docs" and "API" separated?

Created on 21 Apr 2017  ·  13Comments  ·  Source: facebook/jest

It always takes me a while to find the API reference on Jest website. I couldn't figure out why (usually I'd Cmd+F to "API" in the footer and click on it). Only today did I consciously realize that "Docs" page doesn't include "API" in the sidebar, and instead "API" is a completely separate top-level item.

I was curious: why? I'd totally expect "API Reference" to be a subsection of Docs. Especially given that it documents the config format (I wouldn't think of clicking "API" to find it).

Can we merge them?

Documentation

Most helpful comment

The separation was meant to minimize clutter in the sidebar, but in practice I've run into the same issues raised by @gaearon. Let's display both in the sidebar.

All 13 comments

I think it makes sense as a top level nav item, (and I agree that Reference is a better name than API on the top level here) - to aid people that went down the same route, the reference's sidebar could also be added to the sidebar on the docs so you'd get:

Getting Started
Using Matchers
Testing Asynchronous Code
Setup and Teardown
Mock Functions
More Resources

Guides
Snapshot Testing
Testing React Apps
Testing React Native Apps
An Async Example
Timer Mocks
Manual Mocks
Using with webpack
Migrating to Jest
Testing other frameworks
Troubleshooting

API Reference
Globals
Expect
Mock Functions
The Jest Object
Configuring package.json
Jest CLI Options

On any docs page.

Yes, that’s what I would expect 👍

cc @hramos – can we add "API" to the docs sidebar?

cpojer @gaearon @orta We could merge the 'reference' and 'docs' document chains into one and have the API or Reference link at top link directly to Api/Globals.

I have a PR that adds API to the docs, but depends on my PR #3337 being accepted since the file routes change.

The separation was meant to minimize clutter in the sidebar, but in practice I've run into the same issues raised by @gaearon. Let's display both in the sidebar.

I was also confused by the separate /en/ version of the docs:

http://facebook.github.io/jest/docs/troubleshooting.html#unresolved-promises
vs.
http://facebook.github.io/jest/docs/en/troubleshooting.html#unresolved-promises

(they point to different content)

@ericnakagawa @hramos are you guys following up on this? :)

@ericnakagawa we can probably do this as part of the migration to the new website backend.

One more ping before I'm gonna close this. Is anyone interested in making this happen?

Looks like it already happened? Docs and API both show the same sidebar, with all API reference items.

screen shot 2017-12-21 at 10 19 30 am

I've also opened https://github.com/facebook/jest/pull/5155 which should fix the ordering a bit.

It's separate links in the header

Was this page helpful?
0 / 5 - 0 ratings