Skip to content

Navigation for legacy documentation #5

@demurgos

Description

@demurgos

We need to agree on an initial structure for the navigation/summary of the website, the goal is to at least approve the part relevant for the legacy documentation in order to assign separate tasks more effectively.

Previous propositions

  • In february, Update site with pending information about Request #1 proposed the following structure for pending informations about Request:

    1. Home
      1.1. Quick examples so the user can choose which approach to take:
      1.1.1. Request with callbacks
      1.1.2. Request-Promise with promises
      1.1.3. Request with streams
    2. Use Cases similar to those in the Request-Promise cheat sheet
      2.1. Common use cases with callback-based and promise-based code maybe side by side
      2.2. Streaming use cases
    3. Documentation
      3.1 Full API documentation in the style of the current Request README
    4. Support / Contribute
      4.1. Link to Gitter chat
      4.2. Link to repos, contribution guidelines
      4.3. Link to Request architecture docs etc.

    Implicitly, it documents a single version of Request (when we have to also prepare some place for the next version). This is a good structure in my opinion. Use cases could be expanded to include the ones detailed in the library's README.md (forms, proxies, authentication, etc.).

  • In Legacy documentation #3, I started to import the legacy API from the library's repo to the website. It was for me the occasion to to reflect on the navigation with a bigger focus on the API. My idea is to document every publicly accessible object in its own page. I differentiated three kinds of objects:

    The main module is the object you import in your code (for example with
    require('request')). It is the entry point for Request's API and exposes most
    of this package's features.

    Some functions return objects with methods, they are described in the
    "classes" section. You should not instanciate them yourself.

    Properties of simple container objects (such as options) are documented as
    interfaces.

    "class" and "interface" might have a disputable meaning in the context of JavaScript, but I feel that it express well the "abstract" semantics of those objects (and the semantics seem more important than the actual implementation details such as prototypal inheritance).

    Given that, here is a screenshot of the summary I use in the meantime to work on the API:

    The API part itself is not structured because I couldn't find any satisfying way to make it fit into the "book summary" structure (hierarchy and ordered elements), but it seems to be good enough thanks to the relatively small number of elements.

Proposition

If we try to combine the best of those summaries, here is what I propose:

  • Home: Main page, with the logo, a short description and links to the repositories, the most important part of the documentation and other relevant URIs.
  • Introduction: Longer description of Request (why would you want to use it ? what are its limits ? a bit of history, maybe). I separated it from Home because I feel that major navigation links and the library description should not be in the same place. This may be a mistake since I might be thinking more in a "website" way than a "book" way.
  • Which version should I use ?: Since the website documents both the "legacy" and "next" versions, we should have a visible section clarifying the difference between both versions. This difference should be reminded in the sections for each version.
  • Request legacy: Or maybe simply "Request v1" ? "legacy" sounds like a cool internal name, but it might be confusing, especially since it is still supported (right ?). legacy is not as bad as deprecated but has some "warning" connotation. This section would be the home page for the documentation of the currently stable version.
    • Getting started: Should include three ways to use Request listed by @jabrena: callbacks, promises and streams.
    • Use cases: or "features" ? A simple index page for pages focusing on a library's feature. Here are some examples (most of them are imported from the library's repo).
      • Authentication: ping @simov
      • Cookies: ping @lalitkapoor
      • Custom HTTP headers
      • Debugging
      • Forms
      • HTTP Authentication: see Authentication ?
      • OAuth signing
      • Proxies
      • Streaming
      • HAR
      • Timeouts
      • TLS/SSL
      • UNIX domain sockets
      • Promises
    • API: overview of the API, definitions for the concepts used across the API (the above quote about interfaces and classes comes from here).
      • Main module: Entry point of the library
      • RequestOptions: Interface the options used in the main functions and request.defaults(...)
      • Request: The return value of the main functions is an instance of the Request class. This one is tricky, looks like the available attributes evolve in the time (but we'll deal with it in another issue).
      • ...: You get the idea, any publicly accessible object is described
    • Advanced concepts: This would be a place for complex examples involving multiple features or technical points requiring a longer description.
      • Options merging: Explains what is the actual configuration if you chain multiple request.defaults() and then call one of the main functions with an options object.
      • ...
  • Request Next: TODO
  • Request Promises: TODO
  • Contact: support and contribution links (most of them should already be on the homepage I think)

Conclusion

This is a pretty lengthy issue but we need to tackle this pretty early so we get a good view of what we actually want. It would be nice to get some feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions